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_tracingonce per process. Repeating the same settings is safe; different settings requireuninstrument()first. - Do not combine it with
agno.tracing.setup_tracing, a separateAgnoInstrumentor().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 isset_global=True; useFalsewhen 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, andcreate_trace_contextremain 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, andllm.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
agnoextra 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/tracesand bothX-Api-KeyandX-Secret-Key. Project names belong to resource attributes, not anx-project-nameheader. - 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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| traceai_agno-0.2.3.tar.gz | 85.6 kB | With provenance | Details for traceai_agno-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| traceai_agno-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for traceai_agno-0.2.3-py3-none-any.whl |
Total release size: 135.0 kB
Release files / traceai_agno-0.2.3.tar.gz
| Download URL | traceai_agno-0.2.3.tar.gz |
|---|---|
| Size | 85.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6adab2c96950647086ff0310163afc2dac276ba3eb1fb48bc94cfd88f72ea886
|
|
BLAKE2b-256 checksum How to use checksums |
c4f542cb8d49d26b0b4e6895b94398bee1f1dde69de679a24f10bc3a98693631
|
| 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 20, 2026.
Transparency logRelease files / traceai_agno-0.2.3-py3-none-any.whl
| Download URL | traceai_agno-0.2.3-py3-none-any.whl |
|---|---|
| Size | 49.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c99ffe63752e7c15218524c5926366ec43d5a8857ff4ec7440d32c33e17e7c7
|
|
BLAKE2b-256 checksum How to use checksums |
fdedee634212e45c14737a4bd56b9dc48862201e748253d54c704be0ce3429a0
|
| 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 20, 2026.
Transparency logSecurity for traceai-agno 0.2.3
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.
Attestation for traceai_agno-0.2.3.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 20, 2026.
Transparency logA 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.