-
Notifications
You must be signed in to change notification settings - Fork 172
Feat: add Open Agent Spec Instrumentor #2560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat: add Open Agent Spec Instrumentor #2560
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
| # Changelog | ||
|
|
||
| ## 0.1.0 (2025-12-24) | ||
|
|
||
| ### Features | ||
|
|
||
| * Agent Spec instrumentation ([#ISSUE_LINK](https://github.com/Arize-ai/openinference/issues/)) ([COMMIT_ID](https://github.com/Arize-ai/openinference/commit/)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this will be auto-generated by release please as long as the conventional commit message is setup.
| from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter | ||
| from opentelemetry.sdk.trace import TracerProvider | ||
| from opentelemetry.sdk.trace.export import SimpleSpanProcessor | ||
|
|
||
| from openinference.instrumentation.agentspec import AgentSpecInstrumentor | ||
|
|
||
| endpoint = "http://127.0.0.1:6006/v1/traces" | ||
| tracer_provider = TracerProvider() | ||
| tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint))) | ||
|
|
||
| AgentSpecInstrumentor().instrument(tracer_provider=tracer_provider) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking but this is a bit simpler with phoenix-otel if desired. https://pypi.org/project/arize-phoenix-otel/
But for this block probably best to do it this way. https://pypi.org/project/arize-phoenix-otel/
| def _to_open_inference_format_tracing_info( | ||
| span: AgentSpecSpan, mask_sensitive_information: bool = True | ||
| ) -> Dict[str, Any]: | ||
| # See https://arize.com/docs/ax/concepts/tracing/semantic-conventions for naming conventions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # See https://arize.com/docs/ax/concepts/tracing/semantic-conventions for naming conventions | |
| # See https://arize-ai.github.io/openinference/spec/ for naming conventions |
more up to date
Closes #2559
Implementation of a new Instrumentor class that supports Open Agent Specification Tracing.
The PR includes the implementation of the new Instrumentor class for Agent Spec, and all the requirements for the introduction and the release of a new Instrumentor as part of OpenInference.
Since
pyagentspec==26.1.0has not been released publicly on the Pypi index yet, it requires to be manually installed from source from https://github.com/oracle/agent-spec. As soon as it will be publicly available, we will perform a new typing check on the code, and theskip_dep_check=Trueflag setup, currently needed to correctly run examples and tests, will be removed.