Skip to content

Commit 946b1ec

Browse files
committed
Merge branch 'enhance-instrumentation' of https://github.com/AgentOps-AI/agentops into fix_openai
2 parents 77cfc6d + a92c07e commit 946b1ec

File tree

24 files changed

+59
-58
lines changed

24 files changed

+59
-58
lines changed

agentops/instrumentation/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ This package provides OpenTelemetry instrumentation for various LLM providers an
1313
- **Google ADK** (`v0.1.0+`)
1414
- **Agno** (`v0.0.1+`)
1515
- **Mem0** (`v0.1.0+`)
16-
- **SmolAgents** (`v0.1.0+`)
16+
- **smolagents** (`v0.1.0+`)
1717

1818
## Common Module Usage
1919

2020
The `agentops.instrumentation.common` module provides shared utilities for creating instrumentations:
2121

2222
### Base Instrumentor
2323

24-
Use `BaseAgentOpsInstrumentor` for creating new instrumentations:
24+
Use `CommonInstrumentor` for creating new instrumentations:
2525

2626
```python
27-
from agentops.instrumentation.common import BaseAgentOpsInstrumentor, InstrumentorConfig, WrapConfig
27+
from agentops.instrumentation.common import CommonInstrumentor, InstrumentorConfig, WrapConfig
2828

29-
class MyInstrumentor(BaseAgentOpsInstrumentor):
29+
class MyInstrumentor(CommonInstrumentor):
3030
def __init__(self):
3131
config = InstrumentorConfig(
3232
library_name="my-library",
@@ -138,7 +138,7 @@ recorder.record_duration(1.5)
138138

139139
1. Create a new directory under `agentops/instrumentation/` for your provider
140140
2. Create an `__init__.py` file with version information
141-
3. Create an `instrumentor.py` file extending `BaseAgentOpsInstrumentor`
141+
3. Create an `instrumentor.py` file extending `CommonInstrumentor`
142142
4. Create attribute handlers in an `attributes/` subdirectory
143143
5. Add your instrumentor to the main `__init__.py` configuration
144144

agentops/instrumentation/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class InstrumentorConfig(TypedDict):
4848
PROVIDERS: dict[str, InstrumentorConfig] = {
4949
"openai": {
5050
"module_name": "agentops.instrumentation.providers.openai",
51-
"class_name": "OpenAIInstrumentor",
51+
"class_name": "OpenaiInstrumentor",
5252
"min_version": "1.0.0",
5353
},
5454
"anthropic": {
@@ -58,12 +58,12 @@ class InstrumentorConfig(TypedDict):
5858
},
5959
"ibm_watsonx_ai": {
6060
"module_name": "agentops.instrumentation.providers.ibm_watsonx_ai",
61-
"class_name": "IBMWatsonXInstrumentor",
61+
"class_name": "WatsonxInstrumentor",
6262
"min_version": "0.1.0",
6363
},
6464
"google.genai": {
6565
"module_name": "agentops.instrumentation.providers.google_genai",
66-
"class_name": "GoogleGenAIInstrumentor",
66+
"class_name": "GoogleGenaiInstrumentor",
6767
"min_version": "0.1.0",
6868
"package_name": "google-genai", # Actual pip package name
6969
},
@@ -89,7 +89,7 @@ class InstrumentorConfig(TypedDict):
8989
AGENTIC_LIBRARIES: dict[str, InstrumentorConfig] = {
9090
"crewai": {
9191
"module_name": "agentops.instrumentation.agentic.crewai",
92-
"class_name": "CrewAIInstrumentor",
92+
"class_name": "CrewaiInstrumentor",
9393
"min_version": "0.56.0",
9494
},
9595
"autogen": {
@@ -104,7 +104,7 @@ class InstrumentorConfig(TypedDict):
104104
},
105105
"google.adk": {
106106
"module_name": "agentops.instrumentation.agentic.google_adk",
107-
"class_name": "GoogleADKInstrumentor",
107+
"class_name": "GooogleAdkInstrumentor",
108108
"min_version": "0.1.0",
109109
},
110110
"agno": {
@@ -114,7 +114,7 @@ class InstrumentorConfig(TypedDict):
114114
},
115115
"smolagents": {
116116
"module_name": "agentops.instrumentation.agentic.smolagents",
117-
"class_name": "SmolAgentsInstrumentor",
117+
"class_name": "SmolagentsInstrumentor",
118118
"min_version": "1.0.0",
119119
},
120120
}

agentops/instrumentation/agentic/ag2/instrumentor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from agentops.logging import logger
1616
from agentops.instrumentation.common import (
17-
BaseAgentOpsInstrumentor,
17+
CommonInstrumentor,
1818
InstrumentorConfig,
1919
StandardMetrics,
2020
create_span,
@@ -28,7 +28,7 @@
2828
from agentops.semconv.tool import ToolAttributes
2929

3030

31-
class AG2Instrumentor(BaseAgentOpsInstrumentor):
31+
class AG2Instrumentor(CommonInstrumentor):
3232
"""Instrumentor for AG2 (AutoGen)
3333
3434
This instrumentor captures high-level events from AG2's agent interactions,

agentops/instrumentation/agentic/agno/instrumentor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
from agentops.logging import logger
2727
from agentops.instrumentation.common import (
28-
BaseAgentOpsInstrumentor,
28+
CommonInstrumentor,
2929
StandardMetrics,
3030
InstrumentorConfig,
3131
)
@@ -912,7 +912,7 @@ def get_agent_context_for_llm():
912912
return None, None
913913

914914

915-
class AgnoInstrumentor(BaseAgentOpsInstrumentor):
915+
class AgnoInstrumentor(CommonInstrumentor):
916916
"""Agno instrumentation class."""
917917

918918
def __init__(self):
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""OpenTelemetry CrewAI instrumentation"""
22

33
from agentops.instrumentation.agentic.crewai.version import __version__
4-
from agentops.instrumentation.agentic.crewai.instrumentation import CrewAIInstrumentor
4+
from agentops.instrumentation.agentic.crewai.instrumentation import CrewaiInstrumentor
55

6-
__all__ = ["CrewAIInstrumentor", "__version__"]
6+
__all__ = ["CrewaiInstrumentor", "__version__"]

agentops/instrumentation/agentic/crewai/instrumentation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from opentelemetry.instrumentation.utils import unwrap
1010

1111
from agentops.instrumentation.common import (
12-
BaseAgentOpsInstrumentor,
12+
CommonInstrumentor,
1313
InstrumentorConfig,
1414
StandardMetrics,
1515
create_wrapper_factory,
@@ -68,7 +68,7 @@ def attach_tool_executions_to_agent_span(span):
6868
del _tool_executions_by_agent[span_id]
6969

7070

71-
class CrewAIInstrumentor(BaseAgentOpsInstrumentor):
71+
class CrewaiInstrumentor(CommonInstrumentor):
7272
"""Instrumentor for CrewAI framework."""
7373

7474
def __init__(self):

agentops/instrumentation/agentic/google_adk/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
LIBRARY_NAME = _library_info.name
1414
LIBRARY_VERSION = _library_info.version
1515

16-
from agentops.instrumentation.agentic.google_adk.instrumentor import GoogleADKInstrumentor # noqa: E402
16+
from agentops.instrumentation.agentic.google_adk.instrumentor import GooogleAdkInstrumentor # noqa: E402
1717
from agentops.instrumentation.agentic.google_adk import patch # noqa: E402
1818

19-
__all__ = ["LIBRARY_NAME", "LIBRARY_VERSION", "GoogleADKInstrumentor", "patch"]
19+
__all__ = ["LIBRARY_NAME", "LIBRARY_VERSION", "GooogleAdkInstrumentor", "patch"]

agentops/instrumentation/agentic/google_adk/instrumentor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
from agentops.logging import logger
1313
from opentelemetry.metrics import Meter
14-
from agentops.instrumentation.common import BaseAgentOpsInstrumentor, StandardMetrics, InstrumentorConfig
14+
from agentops.instrumentation.common import CommonInstrumentor, StandardMetrics, InstrumentorConfig
1515
from agentops.instrumentation.agentic.google_adk.patch import patch_adk, unpatch_adk
1616

1717
# Library info for tracer/meter
1818
LIBRARY_NAME = "agentops.instrumentation.google_adk"
1919
LIBRARY_VERSION = "0.1.0"
2020

2121

22-
class GoogleADKInstrumentor(BaseAgentOpsInstrumentor):
22+
class GooogleAdkInstrumentor(CommonInstrumentor):
2323
"""An instrumentor for Google Agent Development Kit (ADK).
2424
2525
This instrumentor patches Google ADK to:

agentops/instrumentation/agentic/openai_agents/attributes/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
AgentAttributes.AGENT_TOOLS: "tools",
3838
AgentAttributes.HANDOFFS: "handoffs",
3939
WorkflowAttributes.WORKFLOW_INPUT: "input",
40-
WorkflowAttributes.WORKFLOW_FINAL_OUTPUT: "output",
40+
WorkflowAttributes.WORKFLOW_OUTPUT: "output",
4141
}
4242

4343

agentops/instrumentation/agentic/smolagents/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This module provides OpenTelemetry instrumentation for the SmoLAgents framework.
2626

2727
```python
2828
from agentops import init
29-
from agentops.instrumentation.smolagents import SmoLAgentsInstrumentor
29+
from agentops.instrumentation.smolagents import SmolagentsInstrumentor
3030

3131
# Initialize AgentOps with your API key
3232
init(api_key="your-api-key")

0 commit comments

Comments
 (0)