Skip to main content

Trace Agno with Future AGI

Send Agno agent, model, tool, team, knowledge retrieval, and workflow spans to Future AGI using traceai-agno. The package maintains wrappers based on the OpenInference Agno instrumentor, with input privacy and stream lifecycle handling, and installs only one span tree.

Install

Use Python 3.10 or later and Agno 2.7.2 or later. The current OpenInference instrumentor no longer supports the old Agno 2.0 API. The agno extra installs the framework and its workflow import dependencies.

pip install 'traceai-agno[agno]' openai

Set FI_API_KEY and FI_SECRET_KEY to your Future AGI project credentials, and OPENAI_API_KEY to your own OpenAI key. For a self-hosted Future AGI deployment, also set FI_BASE_URL to its origin, without /tracer/v1/traces.

Run an agent

Configure tracing once, before running agents. This example uses OTLP/HTTP protobuf with the two Future AGI authentication headers. It hides captured inputs and outputs while retaining model, usage, and span hierarchy.

import os

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from openinference.instrumentation import TraceConfig
from traceai_agno import configure_agno_tracing

tracing = configure_agno_tracing(
    otlp_endpoint=os.getenv("FI_BASE_URL", "https://api.futureagi.com").rstrip("/")
    + "/tracer/v1/traces",
    otlp_headers={
        "X-Api-Key": os.environ["FI_API_KEY"],
        "X-Secret-Key": os.environ["FI_SECRET_KEY"],
    },
    project_name="agno-agent",
    config=TraceConfig(hide_inputs=True, hide_outputs=True),
)

try:
    agent = Agent(model=OpenAIChat(id="gpt-4o-mini"), telemetry=False)
    response = agent.run("What is the capital of France?")
    print(response.content)
    tracing.tracer_provider.force_flush()
finally:
    tracing.uninstrument()

Open agno-agent in Future AGI's Observe view and inspect the agent run and its model child span. Inputs and outputs are hidden by the configuration above. Resource attributes identify the project as observe and its semantic convention as openinference.

Use an existing Future AGI provider

If your application already owns a provider, pass it explicitly. It does not need to be the global OpenTelemetry provider. Configure export and project settings on that provider, not again on configure_agno_tracing.

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType
from fi_instrumentation.otel import SemanticConvention
from openinference.instrumentation import TraceConfig
from traceai_agno import configure_agno_tracing

provider = register(
    project_type=ProjectType.OBSERVE,
    project_name="agno-agent",
    semantic_convention=SemanticConvention.OPENINFERENCE,
)
tracing = configure_agno_tracing(
    tracer_provider=provider,
    config=TraceConfig(hide_inputs=True, hide_outputs=True),
)
try:
    agent = Agent(model=OpenAIChat(id="gpt-4o-mini"), telemetry=False)
    print(agent.run("What is the capital of France?").content)
    provider.force_flush()
finally:
    tracing.uninstrument()
    provider.shutdown()

uninstrument() closes providers created by endpoint configuration. It does not close a provider you supplied. Shut shared providers down only when the application exits and in-flight runs have finished.

Choose what content to capture

Use openinference.instrumentation.TraceConfig, OPENINFERENCE_* environment variables, or the shared FI_HIDE_* controls. Both configuration families apply to supplied providers and providers created from an endpoint. A hide flag enabled in either family wins: TraceConfig(hide_inputs=False) cannot undo FI_HIDE_INPUTS=true. With no hide flags enabled, content is captured by default.

FI_HIDE_INPUTS=true and FI_HIDE_OUTPUTS=true hide inputs and outputs, including tool arguments and retrieved documents. The shared message, text, image, invocation-parameter, and embedding-vector hide flags are also bridged to OpenInference. OpenInference-specific options remain supported; neither configuration object is mutated.

FI_HIDE_ERROR_DETAILS=true removes error status descriptions, exception messages and stack traces, and error-message attributes while retaining error status and exception types. By default this protection is also enabled when input/output or message/text hiding is enabled. Set FI_HIDE_ERROR_DETAILS=false only if you deliberately want error details despite hidden content. Model invocation attributes redact authentication parameters and header containers regardless of content settings.

Input/output hiding is not a blanket secret scrubber: names, data-source identities and custom metadata can still contain sensitive text. Keep secrets out of those fields. These controls affect Agno spans, not unrelated instrumentation on a shared provider.

Knowledge retrieval

Knowledge.search and Knowledge.asearch emit an OpenInference RETRIEVER span with the query, knowledge name (gen_ai.data_source.id), document count and returned document IDs/content. Content obeys the privacy controls above; embeddings and arbitrary document metadata are not serialized. Span start/end timestamps provide duration.

These are framework-level INTERNAL spans. The package does not wrap vector-store clients or suppress their instrumentation. If a vector-store instrumentor is enabled independently, its database/client span remains a single child of the framework retrieval span, rather than a duplicate client operation.

Configuration and helpers

  • Call configure_agno_tracing once per process. Repeating the same settings is safe; different settings require uninstrument() first.
  • Do not combine it with agno.tracing.setup_tracing, a separate AgnoInstrumentor().instrument(), or another model instrumentor for the same calls. Use one instrumentation path to avoid duplicate spans.
  • setup_traceai_exporter(endpoint, headers, ..., project_name=..., set_global=False) creates a provider without instrumenting Agno. Its historical default is set_global=True; use False when another library owns the global provider. Flush and shut down the returned provider yourself.
  • get_agent_attributes, get_tool_attributes, get_team_attributes, get_model_provider, and create_trace_context remain available. They return values for manual use; they do not attach attributes or context to automatically emitted spans.
  • Automatic spans retain OpenInference names such as openinference.span.kind, llm.model_name, and llm.token_count.prompt. The manual helpers' gen_ai.* attributes are not an automatic mapper.

See the examples for agent, tool, team, and workflow applications.

Troubleshooting

  • Setup raises an import or dependency error: install the agno extra and check that Agno and OpenInference satisfy the package requirements. Setup does not report success when the instrumentor is missing.
  • No spans: supply either a configured provider or a complete OTLP traces URL. Setting exporter environment variables alone does not create a provider. Flush before exiting.
  • Authentication fails: use /tracer/v1/traces and both X-Api-Key and X-Secret-Key. Project names belong to resource attributes, not an x-project-name header.
  • Already instrumented: remove the other Agno setup call. The wrapper does not replace or take ownership of another instrumentor's configuration.

License

Apache-2.0

Metadata

Release files for traceai-agno 0.2.1

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

Source distribution (sdist)

Source distribution for traceai-agno 0.2.1
File Size Uploaded Provenance Actions
traceai_agno-0.2.1.tar.gz 77.7 kB With provenance Details for traceai_agno-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for traceai-agno 0.2.1
File Interpreter ABI Platform Actions
traceai_agno-0.2.1-py3-none-any.whl Python 3 none any Details for traceai_agno-0.2.1-py3-none-any.whl

Total release size: 122.4 kB

Release files / traceai_agno-0.2.1.tar.gz

Download URL traceai_agno-0.2.1.tar.gz
Size 77.7 kB
Tags Source
SHA-256 checksum
How to use checksums
92295949401474d1868badfcfcb679784c808aa4a5865ff9ab52ce9cea97e7f2
BLAKE2b-256 checksum
How to use checksums
e6fa761efb852bcf695871acf578d73fa659e3bc1acadad6b039b76e2edbad51
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 8, 2026.

Transparency log

Release files / traceai_agno-0.2.1-py3-none-any.whl

Download URL traceai_agno-0.2.1-py3-none-any.whl
Size 44.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50f623d78784352c3c43ab3bbe8fd0afd7ca699eed307f9848eb4cbb5b46bbfb
BLAKE2b-256 checksum
How to use checksums
d66797b951331a528d4a555dc499d26d5a427f44eb58ed715665f016a274fe3b
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 8, 2026.

Transparency log

Security for traceai-agno 0.2.1

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 traceai_agno-0.2.1.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 8, 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.

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