Skip to main content

Agent Ops Python SDK

OpenTelemetry tracing helpers for Python agents that send traces to Agent Ops.

Requirements

  • Python 3.11 or newer
  • An Agent Ops OTLP endpoint and ingest token

Install

pip install agent-ops-otel-sdk

Quick start

import os

from agent_ops import (
    Environment,
    TracingConfig,
    agent_run,
    configure_tracing,
    llm_call,
    shutdown_tracing,
    tool_call,
)

configure_tracing(
    TracingConfig(
        service_name="support-agent",
        service_version="1.4.0",
        app_name="customer-support",
        environment=Environment.PROD,
        endpoint="https://agent-ops.example.com/v1/traces",
        headers={
            "authorization": f"Bearer {os.environ['AGENT_OPS_INGEST_TOKEN']}"
        },
    )
)

try:
    with agent_run(
        session_id="session-123",
        task_type="support",
        input_summary="Resolve a duplicate subscription",
    ) as run:
        with llm_call(
            provider="deepseek",
            request_model="deepseek-flash",
            input_tokens=420,
            output_tokens=80,
        ):
            pass

        with tool_call(
            name="cancel_subscription",
            args_summary='{"subscriptionId":"sub-b"}',
        ):
            pass

        run.complete("success", "final_answer")
finally:
    shutdown_tracing()

To capture complete input and output content, set content_capture=True and provide content_token. Captured content is redacted and uploaded through the Agent Ops server before its content ID is attached to the span.

The package exposes __version__, contract constants such as Attr, and helpers for agent.run, llm.call, tool.call, retrieval, and sub_agent spans.

License

Apache-2.0. See LICENSE.

Metadata

Release files for agent-ops-otel-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-ops-otel-sdk 0.1.0
File Size Uploaded Provenance Actions
agent_ops_otel_sdk-0.1.0.tar.gz 15.6 kB With provenance Details for agent_ops_otel_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-ops-otel-sdk 0.1.0
File Interpreter ABI Platform Actions
agent_ops_otel_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for agent_ops_otel_sdk-0.1.0-py3-none-any.whl

Total release size: 31.2 kB

Release files / agent_ops_otel_sdk-0.1.0.tar.gz

Download URL agent_ops_otel_sdk-0.1.0.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c793a19ce4c8375d5f7093858bf3660f8baf44a6dd5d105820209b7df3439c1a
BLAKE2b-256 checksum
How to use checksums
081f0d1138ffcf5934b9132d5f416c6c8891e25d372e2e40abcdfa0eba71d85b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / agent_ops_otel_sdk-0.1.0-py3-none-any.whl

Download URL agent_ops_otel_sdk-0.1.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1184b30325471bd08e2dd9df408e19acf8537b2637df981e331290dd921c80a9
BLAKE2b-256 checksum
How to use checksums
874b3935c889c3090d8583a7735e422c38c89ca7ca45db60cc63da0da3cfb399
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for agent-ops-otel-sdk 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_ops_otel_sdk-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page