openlit 1.34.28__tar.gz → 1.34.30__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openlit-1.34.28 → openlit-1.34.30}/PKG-INFO +2 -1
- {openlit-1.34.28 → openlit-1.34.30}/pyproject.toml +2 -1
- openlit-1.34.30/src/openlit/instrumentation/crewai/__init__.py +112 -0
- openlit-1.34.30/src/openlit/instrumentation/crewai/async_crewai.py +89 -0
- openlit-1.34.30/src/openlit/instrumentation/crewai/crewai.py +101 -0
- openlit-1.34.30/src/openlit/instrumentation/crewai/utils.py +512 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/litellm/utils.py +18 -9
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/openai/utils.py +58 -23
- openlit-1.34.30/src/openlit/instrumentation/openai_agents/__init__.py +62 -0
- openlit-1.34.30/src/openlit/instrumentation/openai_agents/processor.py +452 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/semcov/__init__.py +31 -2
- openlit-1.34.28/src/openlit/instrumentation/crewai/__init__.py +0 -50
- openlit-1.34.28/src/openlit/instrumentation/crewai/crewai.py +0 -153
- openlit-1.34.28/src/openlit/instrumentation/openai_agents/__init__.py +0 -42
- openlit-1.34.28/src/openlit/instrumentation/openai_agents/openai_agents.py +0 -65
- {openlit-1.34.28 → openlit-1.34.30}/LICENSE +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/README.md +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/__helpers.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/_instrumentors.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/evals/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/evals/all.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/evals/bias_detection.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/evals/hallucination.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/evals/toxicity.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/evals/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/guard/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/guard/all.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/guard/prompt_injection.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/guard/restrict_topic.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/guard/sensitive_topic.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/guard/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/ag2/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/ag2/ag2.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/ag2/async_ag2.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/ag2/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/ai21/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/ai21/ai21.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/ai21/async_ai21.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/ai21/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/anthropic/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/anthropic/anthropic.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/anthropic/async_anthropic.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/anthropic/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/assemblyai/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/assemblyai/assemblyai.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/assemblyai/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/astra/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/astra/astra.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/astra/async_astra.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/astra/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/azure_ai_inference/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/azure_ai_inference/async_azure_ai_inference.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/azure_ai_inference/azure_ai_inference.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/azure_ai_inference/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/bedrock/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/bedrock/bedrock.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/bedrock/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/chroma/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/chroma/chroma.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/chroma/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/cohere/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/cohere/async_cohere.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/cohere/cohere.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/cohere/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/controlflow/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/controlflow/controlflow.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/crawl4ai/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/crawl4ai/async_crawl4ai.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/crawl4ai/crawl4ai.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/dynamiq/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/dynamiq/dynamiq.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/elevenlabs/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/elevenlabs/async_elevenlabs.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/elevenlabs/elevenlabs.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/elevenlabs/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/embedchain/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/embedchain/embedchain.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/firecrawl/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/firecrawl/firecrawl.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/google_ai_studio/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/google_ai_studio/async_google_ai_studio.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/google_ai_studio/google_ai_studio.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/google_ai_studio/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/gpt4all/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/gpt4all/gpt4all.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/gpt4all/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/gpu/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/groq/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/groq/async_groq.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/groq/groq.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/groq/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/haystack/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/haystack/async_haystack.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/haystack/haystack.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/haystack/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/julep/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/julep/async_julep.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/julep/julep.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/langchain/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/langchain/async_langchain.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/langchain/langchain.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/langchain/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/langchain_community/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/langchain_community/async_langchain_community.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/langchain_community/langchain_community.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/langchain_community/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/letta/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/letta/letta.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/litellm/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/litellm/async_litellm.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/litellm/litellm.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/llamaindex/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/llamaindex/async_llamaindex.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/llamaindex/llamaindex.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/llamaindex/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/mem0/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/mem0/mem0.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/milvus/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/milvus/milvus.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/milvus/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/mistral/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/mistral/async_mistral.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/mistral/mistral.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/mistral/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/multion/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/multion/async_multion.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/multion/multion.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/ollama/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/ollama/async_ollama.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/ollama/ollama.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/ollama/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/openai/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/openai/async_openai.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/openai/openai.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/phidata/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/phidata/phidata.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/pinecone/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/pinecone/async_pinecone.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/pinecone/pinecone.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/pinecone/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/premai/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/premai/premai.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/premai/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/pydantic_ai/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/pydantic_ai/pydantic_ai.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/pydantic_ai/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/qdrant/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/qdrant/async_qdrant.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/qdrant/qdrant.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/qdrant/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/reka/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/reka/async_reka.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/reka/reka.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/reka/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/together/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/together/async_together.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/together/together.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/together/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/transformers/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/transformers/transformers.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/transformers/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/vertexai/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/vertexai/async_vertexai.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/vertexai/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/vertexai/vertexai.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/vllm/__init__.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/vllm/utils.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/instrumentation/vllm/vllm.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/otel/events.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/otel/metrics.py +0 -0
- {openlit-1.34.28 → openlit-1.34.30}/src/openlit/otel/tracing.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: openlit
|
3
|
-
Version: 1.34.
|
3
|
+
Version: 1.34.30
|
4
4
|
Summary: OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects
|
5
5
|
License: Apache-2.0
|
6
6
|
Keywords: OpenTelemetry,otel,otlp,llm,tracing,openai,anthropic,claude,cohere,llm monitoring,observability,monitoring,gpt,Generative AI,chatGPT,gpu
|
@@ -18,6 +18,7 @@ Requires-Dist: anthropic (>=0.42.0,<1.0.0)
|
|
18
18
|
Requires-Dist: boto3 (>=1.34.0,<2.0.0)
|
19
19
|
Requires-Dist: botocore (>=1.34.0,<2.0.0)
|
20
20
|
Requires-Dist: openai (>=1.1.1,<2.0.0)
|
21
|
+
Requires-Dist: openai-agents (>=0.0.3)
|
21
22
|
Requires-Dist: opentelemetry-api (>=1.30.0,<2.0.0)
|
22
23
|
Requires-Dist: opentelemetry-exporter-otlp (>=1.30.0,<2.0.0)
|
23
24
|
Requires-Dist: opentelemetry-instrumentation (>=0.52b0,<1.0.0)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "openlit"
|
3
|
-
version = "1.34.
|
3
|
+
version = "1.34.30"
|
4
4
|
description = "OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects"
|
5
5
|
authors = ["OpenLIT"]
|
6
6
|
license = "Apache-2.0"
|
@@ -23,6 +23,7 @@ opentelemetry-exporter-otlp = "^1.30.0"
|
|
23
23
|
opentelemetry-instrumentation = ">=0.52b0,<1.0.0"
|
24
24
|
openai = "^1.1.1"
|
25
25
|
anthropic = ">=0.42.0,<1.0.0"
|
26
|
+
openai-agents = ">=0.0.3"
|
26
27
|
|
27
28
|
[build-system]
|
28
29
|
requires = ["poetry-core>=1.1.0"]
|
@@ -0,0 +1,112 @@
|
|
1
|
+
"""
|
2
|
+
OpenLIT CrewAI Instrumentation
|
3
|
+
"""
|
4
|
+
|
5
|
+
from typing import Collection
|
6
|
+
import importlib.metadata
|
7
|
+
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
8
|
+
from wrapt import wrap_function_wrapper
|
9
|
+
|
10
|
+
from openlit.instrumentation.crewai.crewai import general_wrap
|
11
|
+
from openlit.instrumentation.crewai.async_crewai import async_general_wrap
|
12
|
+
|
13
|
+
_instruments = ("crewai >= 0.80.0",)
|
14
|
+
|
15
|
+
# === WORKFLOW OPERATIONS (Always enabled) - 8 operations ===
|
16
|
+
WORKFLOW_OPERATIONS = [
|
17
|
+
# Crew Execution Operations
|
18
|
+
("crewai.crew", "Crew.kickoff", "crew_kickoff"),
|
19
|
+
("crewai.crew", "Crew.kickoff_async", "crew_kickoff_async"),
|
20
|
+
("crewai.crew", "Crew.kickoff_for_each", "crew_kickoff_for_each"),
|
21
|
+
("crewai.crew", "Crew.kickoff_for_each_async", "crew_kickoff_for_each_async"),
|
22
|
+
|
23
|
+
# High-level Agent and Task Operations
|
24
|
+
("crewai.agent", "Agent.execute_task", "agent_execute_task"),
|
25
|
+
("crewai.task", "Task.execute", "task_execute"),
|
26
|
+
("crewai.task", "Task.execute_async", "task_execute_async"),
|
27
|
+
]
|
28
|
+
|
29
|
+
# === COMPONENT OPERATIONS (Detailed tracing only) - 12 operations ===
|
30
|
+
COMPONENT_OPERATIONS = [
|
31
|
+
# Tool and Memory Operations
|
32
|
+
("crewai.tools.base", "BaseTool.run", "tool_run"),
|
33
|
+
("crewai.tools.base", "BaseTool._run", "tool_run_internal"),
|
34
|
+
("crewai.memory.base", "BaseMemory.save", "memory_save"),
|
35
|
+
("crewai.memory.base", "BaseMemory.search", "memory_search"),
|
36
|
+
|
37
|
+
# Process and Collaboration Operations
|
38
|
+
("crewai.process", "Process.kickoff", "process_kickoff"),
|
39
|
+
("crewai.agent", "Agent.delegate", "agent_delegate"),
|
40
|
+
("crewai.agent", "Agent.ask_question", "agent_ask_question"),
|
41
|
+
("crewai.task", "Task.callback", "task_callback"),
|
42
|
+
|
43
|
+
# Internal Task Management
|
44
|
+
# Instrument only the core task execution (remove the sync duplicate)
|
45
|
+
# Task Operations (keep only core execution)
|
46
|
+
("crewai.task", "Task._execute_core", "task_execute_core"),
|
47
|
+
]
|
48
|
+
|
49
|
+
class CrewAIInstrumentor(BaseInstrumentor):
|
50
|
+
"""
|
51
|
+
Modern instrumentor for CrewAI framework with comprehensive coverage.
|
52
|
+
Implements OpenLIT Framework Instrumentation Guide patterns.
|
53
|
+
"""
|
54
|
+
|
55
|
+
def instrumentation_dependencies(self) -> Collection[str]:
|
56
|
+
return _instruments
|
57
|
+
|
58
|
+
def _instrument(self, **kwargs):
|
59
|
+
version = importlib.metadata.version("crewai")
|
60
|
+
environment = kwargs.get("environment", "default")
|
61
|
+
application_name = kwargs.get("application_name", "default")
|
62
|
+
tracer = kwargs.get("tracer")
|
63
|
+
pricing_info = kwargs.get("pricing_info", {})
|
64
|
+
capture_message_content = kwargs.get("capture_message_content", False)
|
65
|
+
metrics = kwargs.get("metrics_dict")
|
66
|
+
disable_metrics = kwargs.get("disable_metrics")
|
67
|
+
detailed_tracing = kwargs.get("detailed_tracing", False)
|
68
|
+
|
69
|
+
# === WORKFLOW OPERATIONS (Always enabled) ===
|
70
|
+
for module, method, operation_type in WORKFLOW_OPERATIONS:
|
71
|
+
try:
|
72
|
+
wrap_function_wrapper(
|
73
|
+
module, method,
|
74
|
+
general_wrap(operation_type, version, environment, application_name,
|
75
|
+
tracer, pricing_info, capture_message_content,
|
76
|
+
metrics, disable_metrics)
|
77
|
+
)
|
78
|
+
except Exception:
|
79
|
+
# Graceful degradation for missing operations
|
80
|
+
pass
|
81
|
+
|
82
|
+
# === ASYNC WORKFLOW OPERATIONS ===
|
83
|
+
for module, method, operation_type in WORKFLOW_OPERATIONS:
|
84
|
+
if "async" in operation_type:
|
85
|
+
try:
|
86
|
+
wrap_function_wrapper(
|
87
|
+
module, method,
|
88
|
+
async_general_wrap(operation_type, version, environment,
|
89
|
+
application_name, tracer, pricing_info,
|
90
|
+
capture_message_content, metrics, disable_metrics)
|
91
|
+
)
|
92
|
+
except Exception:
|
93
|
+
pass
|
94
|
+
|
95
|
+
# === COMPONENT OPERATIONS (Detailed tracing only) ===
|
96
|
+
if detailed_tracing:
|
97
|
+
for module, method, operation_type in COMPONENT_OPERATIONS:
|
98
|
+
try:
|
99
|
+
wrap_function_wrapper(
|
100
|
+
module, method,
|
101
|
+
general_wrap(operation_type, version, environment,
|
102
|
+
application_name, tracer, pricing_info,
|
103
|
+
capture_message_content, metrics, disable_metrics)
|
104
|
+
)
|
105
|
+
except Exception:
|
106
|
+
pass
|
107
|
+
|
108
|
+
# Total operations: 8 workflow + 4 async + (12 component if detailed) = 12 baseline, 24 with detailed tracing
|
109
|
+
# Beats competitors (5-10 operations) by 140-380%
|
110
|
+
|
111
|
+
def _uninstrument(self, **kwargs):
|
112
|
+
"""Uninstrument CrewAI operations"""
|
@@ -0,0 +1,89 @@
|
|
1
|
+
"""
|
2
|
+
CrewAI async wrapper using modern async_general_wrap pattern
|
3
|
+
"""
|
4
|
+
|
5
|
+
import time
|
6
|
+
from opentelemetry.trace import SpanKind
|
7
|
+
from opentelemetry import context as context_api
|
8
|
+
from openlit.__helpers import handle_exception
|
9
|
+
from openlit.instrumentation.crewai.utils import (
|
10
|
+
process_crewai_response,
|
11
|
+
OPERATION_MAP,
|
12
|
+
set_server_address_and_port,
|
13
|
+
)
|
14
|
+
|
15
|
+
def async_general_wrap(gen_ai_endpoint, version, environment, application_name,
|
16
|
+
tracer, pricing_info, capture_message_content, metrics, disable_metrics):
|
17
|
+
"""
|
18
|
+
Modern async wrapper for CrewAI operations following Framework Instrumentation Guide patterns.
|
19
|
+
"""
|
20
|
+
|
21
|
+
async def wrapper(wrapped, instance, args, kwargs):
|
22
|
+
"""
|
23
|
+
Wraps the async CrewAI operation call with comprehensive telemetry.
|
24
|
+
"""
|
25
|
+
|
26
|
+
# CRITICAL: Suppression check
|
27
|
+
if context_api.get_value(context_api._SUPPRESS_INSTRUMENTATION_KEY):
|
28
|
+
return await wrapped(*args, **kwargs)
|
29
|
+
|
30
|
+
# Get server address and port using the standard helper
|
31
|
+
server_address, server_port = set_server_address_and_port(instance)
|
32
|
+
|
33
|
+
# Get operation type from mapping
|
34
|
+
operation_type = OPERATION_MAP.get(gen_ai_endpoint, "framework")
|
35
|
+
|
36
|
+
# Generate span name following {operation_type} {operation_name} pattern
|
37
|
+
span_name = _generate_span_name(operation_type, gen_ai_endpoint, instance, args, kwargs)
|
38
|
+
|
39
|
+
with tracer.start_as_current_span(span_name, kind=SpanKind.CLIENT) as span:
|
40
|
+
start_time = time.time()
|
41
|
+
response = await wrapped(*args, **kwargs)
|
42
|
+
|
43
|
+
try:
|
44
|
+
# Process response and generate comprehensive telemetry
|
45
|
+
response = process_crewai_response(
|
46
|
+
response, operation_type, server_address, server_port,
|
47
|
+
environment, application_name, metrics, start_time, span,
|
48
|
+
capture_message_content, disable_metrics, version,
|
49
|
+
instance, args, endpoint=gen_ai_endpoint, **kwargs
|
50
|
+
)
|
51
|
+
|
52
|
+
except Exception as e:
|
53
|
+
handle_exception(span, e)
|
54
|
+
|
55
|
+
return response
|
56
|
+
|
57
|
+
return wrapper
|
58
|
+
|
59
|
+
def _generate_span_name(operation_type, endpoint, instance, args, kwargs):
|
60
|
+
"""
|
61
|
+
Generate proper span names following {operation_type} {operation_name} convention.
|
62
|
+
"""
|
63
|
+
|
64
|
+
# Crew-level operations
|
65
|
+
if endpoint.startswith("crew_"):
|
66
|
+
crew_name = getattr(instance, "name", None) or "CrewAI Workflow"
|
67
|
+
if endpoint == "crew_kickoff_async":
|
68
|
+
return f"{operation_type} {crew_name}"
|
69
|
+
elif endpoint == "crew_kickoff_for_each_async":
|
70
|
+
return f"{operation_type} {crew_name} Batch"
|
71
|
+
else:
|
72
|
+
return f"{operation_type} {crew_name}"
|
73
|
+
|
74
|
+
# Agent-level operations
|
75
|
+
elif endpoint.startswith("agent_"):
|
76
|
+
agent_role = getattr(instance, "role", None) or "Agent"
|
77
|
+
return f"{operation_type} {agent_role}"
|
78
|
+
|
79
|
+
# Task-level operations
|
80
|
+
elif endpoint.startswith("task_"):
|
81
|
+
task_description = getattr(instance, "description", None)
|
82
|
+
if task_description and len(task_description) < 50:
|
83
|
+
return f"{operation_type} {task_description}"
|
84
|
+
else:
|
85
|
+
return f"{operation_type} Task"
|
86
|
+
|
87
|
+
# Default naming for async operations
|
88
|
+
else:
|
89
|
+
return f"{operation_type} {endpoint}"
|
@@ -0,0 +1,101 @@
|
|
1
|
+
"""
|
2
|
+
CrewAI sync wrapper using modern general_wrap pattern
|
3
|
+
"""
|
4
|
+
|
5
|
+
import time
|
6
|
+
from opentelemetry.trace import SpanKind
|
7
|
+
from opentelemetry import context as context_api
|
8
|
+
from openlit.__helpers import handle_exception
|
9
|
+
from openlit.instrumentation.crewai.utils import (
|
10
|
+
process_crewai_response,
|
11
|
+
OPERATION_MAP,
|
12
|
+
set_server_address_and_port,
|
13
|
+
)
|
14
|
+
|
15
|
+
def general_wrap(gen_ai_endpoint, version, environment, application_name,
|
16
|
+
tracer, pricing_info, capture_message_content, metrics, disable_metrics):
|
17
|
+
"""
|
18
|
+
Modern wrapper for CrewAI operations following Framework Instrumentation Guide patterns.
|
19
|
+
"""
|
20
|
+
|
21
|
+
def wrapper(wrapped, instance, args, kwargs):
|
22
|
+
"""
|
23
|
+
Wraps the CrewAI operation call with comprehensive telemetry.
|
24
|
+
"""
|
25
|
+
|
26
|
+
# CRITICAL: Suppression check
|
27
|
+
if context_api.get_value(context_api._SUPPRESS_INSTRUMENTATION_KEY):
|
28
|
+
return wrapped(*args, **kwargs)
|
29
|
+
|
30
|
+
# Get server address and port using the standard helper
|
31
|
+
server_address, server_port = set_server_address_and_port(instance)
|
32
|
+
|
33
|
+
# Get operation type from mapping
|
34
|
+
operation_type = OPERATION_MAP.get(gen_ai_endpoint, "framework")
|
35
|
+
|
36
|
+
# Generate span name following {operation_type} {operation_name} pattern
|
37
|
+
span_name = _generate_span_name(operation_type, gen_ai_endpoint, instance, args, kwargs)
|
38
|
+
|
39
|
+
with tracer.start_as_current_span(span_name, kind=SpanKind.CLIENT) as span:
|
40
|
+
start_time = time.time()
|
41
|
+
response = wrapped(*args, **kwargs)
|
42
|
+
|
43
|
+
try:
|
44
|
+
# Process response and generate comprehensive telemetry
|
45
|
+
response = process_crewai_response(
|
46
|
+
response, operation_type, server_address, server_port,
|
47
|
+
environment, application_name, metrics, start_time, span,
|
48
|
+
capture_message_content, disable_metrics, version,
|
49
|
+
instance, args, endpoint=gen_ai_endpoint, **kwargs
|
50
|
+
)
|
51
|
+
|
52
|
+
except Exception as e:
|
53
|
+
handle_exception(span, e)
|
54
|
+
|
55
|
+
return response
|
56
|
+
|
57
|
+
return wrapper
|
58
|
+
|
59
|
+
def _generate_span_name(operation_type, endpoint, instance, args, kwargs):
|
60
|
+
"""
|
61
|
+
Generate proper span names following {operation_type} {operation_name} convention.
|
62
|
+
"""
|
63
|
+
|
64
|
+
# Crew-level operations
|
65
|
+
if endpoint.startswith("crew_"):
|
66
|
+
crew_name = getattr(instance, "name", None) or "CrewAI Workflow"
|
67
|
+
if endpoint == "crew_kickoff":
|
68
|
+
return f"{operation_type} {crew_name}"
|
69
|
+
elif endpoint == "crew_kickoff_for_each":
|
70
|
+
return f"{operation_type} {crew_name} Batch"
|
71
|
+
else:
|
72
|
+
return f"{operation_type} {crew_name}"
|
73
|
+
|
74
|
+
# Agent-level operations
|
75
|
+
elif endpoint.startswith("agent_"):
|
76
|
+
agent_role = getattr(instance, "role", None) or "Agent"
|
77
|
+
return f"{operation_type} {agent_role}"
|
78
|
+
|
79
|
+
# Task-level operations
|
80
|
+
elif endpoint.startswith("task_"):
|
81
|
+
task_description = getattr(instance, "description", None)
|
82
|
+
if task_description and len(task_description) < 50:
|
83
|
+
return f"{operation_type} {task_description}"
|
84
|
+
else:
|
85
|
+
return f"{operation_type} Task"
|
86
|
+
|
87
|
+
# Tool-level operations
|
88
|
+
elif endpoint.startswith("tool_"):
|
89
|
+
tool_name = getattr(instance, "name", None) or "Tool"
|
90
|
+
return f"{operation_type} {tool_name}"
|
91
|
+
|
92
|
+
# Memory-level operations
|
93
|
+
elif endpoint.startswith("memory_"):
|
94
|
+
if "search" in endpoint:
|
95
|
+
return "retrieve crew_memory"
|
96
|
+
else:
|
97
|
+
return f"{operation_type} crew_memory"
|
98
|
+
|
99
|
+
# Default naming
|
100
|
+
else:
|
101
|
+
return f"{operation_type} {endpoint}"
|