openlit 1.34.28__py3-none-any.whl → 1.34.30__py3-none-any.whl

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.
@@ -74,8 +74,8 @@ class SemanticConvention:
74
74
  GEN_AI_OPERATION_TYPE_IMAGE = "image"
75
75
  GEN_AI_OPERATION_TYPE_AUDIO = "audio"
76
76
  GEN_AI_OPERATION_TYPE_VECTORDB = "vectordb"
77
- GEN_AI_OPERATION_TYPE_FRAMEWORK = "framework"
78
- GEN_AI_OPERATION_TYPE_AGENT = "agent"
77
+ GEN_AI_OPERATION_TYPE_FRAMEWORK = "workflow"
78
+ GEN_AI_OPERATION_TYPE_AGENT = "invoke_agent"
79
79
  GEN_AI_OPERATION_TYPE_CREATE_AGENT = "create_agent"
80
80
  GEN_AI_OPERATION_TYPE_EXECUTE_AGENT_TASK = "execute_task"
81
81
  GEN_AI_OPERATION_TYPE_RETRIEVE = "retrieve"
@@ -135,6 +135,7 @@ class SemanticConvention:
135
135
  GEN_AI_SYSTEM_FIRECRAWL = "firecrawl"
136
136
  GEN_AI_SYSTEM_LETTA = "letta"
137
137
  GEN_AI_SYSTEM_TOGETHER = "together"
138
+ GEN_AI_SYSTEM_OPENAI_AGENTS = "openai_agents"
138
139
  GEN_AI_SYSTEM_PYDANTIC_AI = "pydantic_ai"
139
140
 
140
141
  # GenAI Framework Component Attributes (Standard)
@@ -403,3 +404,31 @@ class SemanticConvention:
403
404
  GEN_AI_FRAMEWORK_VECTOR_DIMENSION = "gen_ai.framework.vector.dimension"
404
405
  GEN_AI_FRAMEWORK_INDEX_NAME = "gen_ai.framework.index.name"
405
406
  GEN_AI_FRAMEWORK_INDEX_TYPE = "gen_ai.framework.index.type"
407
+
408
+ # === STANDARD OPENTELEMETRY SEMANTIC CONVENTIONS ===
409
+ # These are framework-agnostic and reusable across all agent frameworks
410
+
411
+ # OpenAI Agent-specific Attributes (for any framework using OpenAI models)
412
+ GEN_AI_CONVERSATION_ID = "gen_ai.conversation.id"
413
+ GEN_AI_OPENAI_ASSISTANT_ID = "gen_ai.openai.assistant.id"
414
+ GEN_AI_OPENAI_THREAD_ID = "gen_ai.openai.thread.id"
415
+ GEN_AI_OPENAI_RUN_ID = "gen_ai.openai.run.id"
416
+ GEN_AI_OPENAI_REQUEST_SERVICE_TIER = "gen_ai.openai.request.service_tier"
417
+ GEN_AI_OPENAI_RESPONSE_SERVICE_TIER = "gen_ai.openai.response.service_tier"
418
+ GEN_AI_OPENAI_RESPONSE_SYSTEM_FINGERPRINT = "gen_ai.openai.response.system_fingerprint"
419
+
420
+ # Data Source Attributes (for RAG and knowledge retrieval)
421
+ GEN_AI_DATA_SOURCE_ID = "gen_ai.data_source.id"
422
+ GEN_AI_DATA_SOURCE_TYPE = "gen_ai.data_source.type"
423
+
424
+ # Standard Tool Attributes (framework-agnostic)
425
+ GEN_AI_TOOL_TYPE = "gen_ai.tool.type"
426
+
427
+ # Standard Workflow Attributes (framework-agnostic)
428
+ GEN_AI_WORKFLOW_AGENT_COUNT = "gen_ai.workflow.agent_count"
429
+ GEN_AI_WORKFLOW_TASK_COUNT = "gen_ai.workflow.task_count"
430
+ GEN_AI_WORKFLOW_EXECUTION_TYPE = "gen_ai.workflow.execution_type"
431
+
432
+ # Standard Task Attributes (framework-agnostic)
433
+ GEN_AI_TASK_DESCRIPTION = "gen_ai.task.description"
434
+ GEN_AI_TASK_EXPECTED_OUTPUT = "gen_ai.task.expected_output"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openlit
3
- Version: 1.34.28
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)
@@ -51,8 +51,10 @@ openlit/instrumentation/controlflow/controlflow.py,sha256=hi4DtshGvnPjhElwX-ytkR
51
51
  openlit/instrumentation/crawl4ai/__init__.py,sha256=TTFFeZkTgPZJAD1Tlr2LK-CTH2A7NkZK-5SHKFfFOtU,1947
52
52
  openlit/instrumentation/crawl4ai/async_crawl4ai.py,sha256=bqtopPKOMCfBx7in08QnpjYnPO09YV_uySR19YTuV98,4893
53
53
  openlit/instrumentation/crawl4ai/crawl4ai.py,sha256=kX5B5ItHBw-_qa-SjSmIjFQg0ZwckB1tMkoemCvg2rc,4875
54
- openlit/instrumentation/crewai/__init__.py,sha256=Yh-evzhxG-x3E2oRf71S1NIx_36JGu4TeIqFl1-2H5w,1834
55
- openlit/instrumentation/crewai/crewai.py,sha256=0MuubMHnnWeLhc5LnHtr74-hQaq8EAx-pIsocb4IIeE,7223
54
+ openlit/instrumentation/crewai/__init__.py,sha256=dqoLjfBckVufp7uC4-Znq0R_YJ5FgSRfvmUuofR39ZE,4751
55
+ openlit/instrumentation/crewai/async_crewai.py,sha256=iXEagpSfpdYbbQmANd6tozjksbu7QLGBOHj3a_wuq0Q,3327
56
+ openlit/instrumentation/crewai/crewai.py,sha256=iScniCy3WDOS-GThaISiUPjOz-CZVL1t1tfOYda_fqk,3640
57
+ openlit/instrumentation/crewai/utils.py,sha256=mvnQc41eEMzKcdR3-1k01SJWf_NQTOe8BHTVVju0yzs,21043
56
58
  openlit/instrumentation/dynamiq/__init__.py,sha256=LuIYSQpQH5Pk5Ngl_3Jy3bImGjZgh61La6sbVJfC1Io,2391
57
59
  openlit/instrumentation/dynamiq/dynamiq.py,sha256=0x-76VL5KG_HytmzAOi4ERPN0Wm5KLyMxHZmFbaWxxg,5309
58
60
  openlit/instrumentation/elevenlabs/__init__.py,sha256=YDOyrxdY9VACuHY5iZ3v3FaIPcNM7lAmUInJ6H-Cw-g,1897
@@ -95,7 +97,7 @@ openlit/instrumentation/letta/letta.py,sha256=SCIpJ4tdB1l1BmeQx4raaTS4MQO5X15pLv
95
97
  openlit/instrumentation/litellm/__init__.py,sha256=D47yfDLLEKpkaRAy7_Yif70kj88AGqLQYZAABpTN4sE,2284
96
98
  openlit/instrumentation/litellm/async_litellm.py,sha256=GdMXyCLLuC9-7nXTsKTgvXOOQnw0oTbUwL_DYp_pNoE,6780
97
99
  openlit/instrumentation/litellm/litellm.py,sha256=xLna3I_jcywTtIs1tBjHAQKyKjNM07T8GHX9pIqZcQ0,6664
98
- openlit/instrumentation/litellm/utils.py,sha256=VMSnYkKn9yZtOphIh2ENNuqJtGjz1fXEYUKi5JGHC7A,13195
100
+ openlit/instrumentation/litellm/utils.py,sha256=baaNUlThexT1HIQiD6Sa4-hakXXRmqeTqF7AqDql2bo,13595
99
101
  openlit/instrumentation/llamaindex/__init__.py,sha256=B_76JO93uZiWhPGqvOVpZltOQbPw9JxuQw-HBBJZqQA,10121
100
102
  openlit/instrumentation/llamaindex/async_llamaindex.py,sha256=DdQmdhXtKgPpqsqgseB-MLZSm-1Sc51Q2uEeavhaIMw,1879
101
103
  openlit/instrumentation/llamaindex/llamaindex.py,sha256=2mmhYeZXSfXJLzu-yPNTTpoV-E2UAYdYroWIVDFgw0M,1932
@@ -119,9 +121,9 @@ openlit/instrumentation/ollama/utils.py,sha256=TIE3_ur2U-iyCclna7TzwjDIFC9PZjRnZ
119
121
  openlit/instrumentation/openai/__init__.py,sha256=4RWRhrRa589jiwvFf8_fLBW6UB5Btrd17mcDKv5VhJk,5546
120
122
  openlit/instrumentation/openai/async_openai.py,sha256=QvEEKZnZYl9Vf-wsX1voTMMZed1eNhRI9aUT8CtFJi0,18003
121
123
  openlit/instrumentation/openai/openai.py,sha256=34_FqOwSroNOm_mmLzZb8Y7xtr5StwnUyRQmHP6HHJc,17698
122
- openlit/instrumentation/openai/utils.py,sha256=dd57s93nBSbl4OUjkkoC6QuEGXVC_2XOf2C7Hs1eEww,35555
123
- openlit/instrumentation/openai_agents/__init__.py,sha256=tRTSIrUtkXc_lfQnVanXmQLd2Sy9RqBNTHF5FhhZx7o,1530
124
- openlit/instrumentation/openai_agents/openai_agents.py,sha256=kRWPgjofcOviMi3w7CsRvJO3SCjqPmuq-PM800vIM7g,2678
124
+ openlit/instrumentation/openai/utils.py,sha256=-qqRbgdJOj_XJ_5-jyjDbai_KGBCUWNrQk5vdS7JyJs,36401
125
+ openlit/instrumentation/openai_agents/__init__.py,sha256=AVQ-dMKCSSg3JsGCVBooQrVIS1F64AD-rlLQKgloYEw,2322
126
+ openlit/instrumentation/openai_agents/processor.py,sha256=DbfbEpAspARPMZb30R0A9dl-Fxv-r13Czr2zRgWwFPo,16769
125
127
  openlit/instrumentation/phidata/__init__.py,sha256=tqls5-UI6FzbjxYgq_qqAfALhWJm8dHn2NtgqiQA4f8,1557
126
128
  openlit/instrumentation/phidata/phidata.py,sha256=ohrxs6i0Oik75P2BrjNGbK71tdZg94ZMmaXixrXwV5M,4834
127
129
  openlit/instrumentation/pinecone/__init__.py,sha256=-3wD35oCnwjwBQV3-gZs2XgpZ2wT9jmiMGjalpF9BhI,3683
@@ -159,8 +161,8 @@ openlit/instrumentation/vllm/vllm.py,sha256=VzazF2f4LLwjZDO_G8lIN_d622oSJM0fIO9w
159
161
  openlit/otel/events.py,sha256=VrMjTpvnLtYRBHCiFwJojTQqqNpRCxoD4yJYeQrtPsk,3560
160
162
  openlit/otel/metrics.py,sha256=GM2PDloBGRhBTkHHkYaqmOwIAQkY124ZhW4sEqW1Fgk,7086
161
163
  openlit/otel/tracing.py,sha256=tjV2bEbEDPUB1Z46gE-UsJsb04sRdFrfbhIDkxViZc0,3103
162
- openlit/semcov/__init__.py,sha256=2yvcsK4l9fs7QL8pOqogg0O-KDTEfb5lFd6J6ySlpjM,18657
163
- openlit-1.34.28.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
164
- openlit-1.34.28.dist-info/METADATA,sha256=q5cGfMlB4KgoPFDOLlevkxaMizvCr2zfBx_4b4-epN4,23470
165
- openlit-1.34.28.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
166
- openlit-1.34.28.dist-info/RECORD,,
164
+ openlit/semcov/__init__.py,sha256=7sj6u3FO2fwFZuwajGsStdFOl7Nh-mU84pvTkRrfKg8,20093
165
+ openlit-1.34.30.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
166
+ openlit-1.34.30.dist-info/METADATA,sha256=qNUvSHkp_OXxSJJUeBIWgKMqu3S_-VKJhLaXtzOIRs8,23509
167
+ openlit-1.34.30.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
168
+ openlit-1.34.30.dist-info/RECORD,,
@@ -1,65 +0,0 @@
1
- """
2
- Module for monitoring AG2 API calls.
3
- """
4
-
5
- import logging
6
- from opentelemetry.trace import SpanKind, Status, StatusCode
7
- from opentelemetry.sdk.resources import SERVICE_NAME, TELEMETRY_SDK_NAME, DEPLOYMENT_ENVIRONMENT
8
- from openlit.__helpers import (
9
- handle_exception,
10
- )
11
- from openlit.semcov import SemanticConvention
12
-
13
- # Initialize logger for logging potential issues and operations
14
- logger = logging.getLogger(__name__)
15
-
16
- def set_span_attributes(span, version, operation_name, environment,
17
- application_name, server_address, server_port, request_model):
18
- """
19
- Set common attributes for the span.
20
- """
21
-
22
- # Set Span attributes (OTel Semconv)
23
- span.set_attribute(TELEMETRY_SDK_NAME, 'openlit')
24
- span.set_attribute(SemanticConvention.GEN_AI_OPERATION, operation_name)
25
- span.set_attribute(SemanticConvention.GEN_AI_SYSTEM, SemanticConvention.GEN_AI_SYSTEM_AG2)
26
- span.set_attribute(SemanticConvention.SERVER_ADDRESS, server_address)
27
- span.set_attribute(SemanticConvention.SERVER_PORT, server_port)
28
- span.set_attribute(SemanticConvention.GEN_AI_REQUEST_MODEL, request_model)
29
-
30
- # Set Span attributes (Extras)
31
- span.set_attribute(DEPLOYMENT_ENVIRONMENT, environment)
32
- span.set_attribute(SERVICE_NAME, application_name)
33
- span.set_attribute(SemanticConvention.GEN_AI_SDK_VERSION, version)
34
-
35
- def create_agent(version, environment, application_name,
36
- tracer, event_provider, pricing_info, capture_message_content, metrics, disable_metrics):
37
- """
38
- Generates a telemetry wrapper for GenAI function call
39
- """
40
- def wrapper(wrapped, instance, args, kwargs):
41
- server_address, server_port = '127.0.0.1', 80
42
-
43
- agent_name = kwargs.get('name', 'openai_agent')
44
- span_name = f'{SemanticConvention.GEN_AI_OPERATION_TYPE_CREATE_AGENT} {agent_name}'
45
-
46
- with tracer.start_as_current_span(span_name, kind=SpanKind.CLIENT) as span:
47
- try:
48
- response = wrapped(*args, **kwargs)
49
-
50
- set_span_attributes(span, version, SemanticConvention.GEN_AI_OPERATION_TYPE_CREATE_AGENT,
51
- environment, application_name, server_address, server_port, kwargs.get('model', 'gpt-4o'))
52
- span.set_attribute(SemanticConvention.GEN_AI_AGENT_NAME, agent_name)
53
-
54
- span.set_attribute(SemanticConvention.GEN_AI_AGENT_DESCRIPTION, kwargs.get('instructions', ''))
55
-
56
- span.set_status(Status(StatusCode.OK))
57
-
58
- return response
59
-
60
- except Exception as e:
61
- handle_exception(span, e)
62
- logger.error('Error in trace creation: %s', e)
63
- return response
64
-
65
- return wrapper