Instrumentation standards

OpenTelemetry for AI Agents

Implement OpenTelemetry for agents with explicit convention versions, context boundaries, content controls and conformance tests.

OpenTelemetry can provide a common way to instrument and transport evidence from AI agents, but successful export is only the first acceptance test. Your backend must interpret the operations correctly, preserve task relationships and expose missing data. Your application must still decide what counts as an authorised action or an acceptable business outcome.

For engineering teams, the safest starting point is a versioned telemetry contract. Pin the SDK, instrumentation packages, semantic conventions and collector configuration used by the service. Then test a representative agent fixture through the complete pipeline. This makes interoperability an observed result rather than an assumption attached to the OpenTelemetry name.

Separate the protocol from the GenAI conventions

The OTLP specification defines telemetry encoding and transport, including HTTP and gRPC, and marks trace, metric and log signals stable. The GenAI semantic conventions currently have Development status in their dedicated repository. The former GenAI documentation location states that the material has moved. Those are different maturity questions.

OTLP compatibility therefore does not prove that two tools use identical agent attributes or interpret them in the same way. A backend may accept an event while ignoring a field that another backend uses to construct an agent view. Recheck the applicable convention status and implementation support when selecting a release; do not treat an old tutorial as a permanent schema contract.

Create a compatibility record

Version record for an OpenTelemetry agent implementation
LayerRecordWhy it matters
Language SDKLanguage, package versions and runtimeContext, export and shutdown behaviour are implementation-specific
InstrumentationFramework and provider instrumentation versionsCoverage and emitted fields can change independently
Semantic conventionsRelease or commit and stability of used definitionsAttribute names and meanings must be interpretable later
CollectorDistribution, components and configuration revisionA processor must exist and be enabled in the deployed pipeline
TransportOTLP protocol, endpoint, authentication and size policyClient and receiver must agree on delivery
Backend mappingAccepted schema and any transformation rulesSuccessful ingestion does not guarantee the intended view
Custom business fieldsNames, types, meanings and ownersTask outcomes are not defined automatically by technical conventions

Keep this record with the service release, but allow a telemetry-only configuration change to have its own revision. That lets an investigator distinguish a real behaviour change from a field rename, changed sampling rule or missing exporter. Include a rollback procedure for the telemetry configuration itself.

Identify the service and the source of instrumentation

OpenTelemetry resources describe the entity producing telemetry, while instrumentation scope identifies the software unit emitting it. For an agent worker, set a meaningful service identity and deployment information. Preserve the instrumentation library name and version so an unexpected span shape can be traced to its producer.

Do not put per-task identifiers into resource identity. A resource describes the producing entity; a task reference belongs on the relevant observations or in the connected application record. Similarly, do not confuse the model provider's version with your service release or instruction revision. Each answers a different diagnostic question.

When several libraries instrument the same call, inspect their scopes for duplicate coverage. Choose a deliberate arrangement rather than enabling every available integration. A duplicate span can distort call counts and latency views even when each individual integration appears to work.

Represent agent, model and tool operations separately

The current agent conventions distinguish agent invocation and tool execution, including remote and in-process agent concepts. The model-operation conventions describe logical model operations. Use the applicable definitions for the pinned version; do not rename every HTTP request as an agent invocation.

For example, an agent can make one model request that proposes two tools, execute those tools, then make another model request to prepare an answer. Capture the observable operations and their relationships. The tool proposal is not evidence that execution happened, and a completed model operation is not evidence that the business task was accepted.

Use a clearly owned custom namespace for business-specific attributes where no applicable convention exists. An illustrative field such as example.task.id is a custom design choice, not a standard OpenTelemetry attribute. Document its type, permitted values and content classification. Task tracing explains how it connects multiple attempts without replacing trace context.

Propagate context across real execution boundaries

Test context through the framework, asynchronous tasks, queues and custom tools actually used by the service. Automatic propagation inside one runtime does not prove propagation into another process. Define which metadata is carried and where extraction occurs; confirm that the receiving operation joins or links to the intended context.

Keep the durable business-task reference available when execution context is absent or a later attempt starts a new trace. Never use a trace identifier or propagated field as proof of user identity or action authority. Authentication and authorisation belong to the service's security controls.

OpenTelemetry baggage propagates key-value context and can cross service boundaries. Avoid credentials and sensitive personal content there. Restrict propagation to intended destinations and review untrusted incoming context. Correlation convenience should not create a new data-disclosure channel.

Choose the content boundary before export

Decide which instructions, messages, retrieved passages and tool values may be recorded. Make metadata-only capture the starting design when it answers the operational question, then justify additional content. Use version references, categories and approved excerpts where they provide sufficient evidence.

OpenTelemetry's sensitive-data guidance makes clear that instrumentation requires context-specific review and supports minimisation or processing of sensitive attributes. Decide whether a field must be removed inside the application or may reach a trusted collector. Removing it later in the pipeline does not undo an earlier transfer.

Use synthetic markers to test root messages, nested tool arguments, exception text and metadata. Check all export destinations. A field can be absent from the primary trace view while surviving in logs, debug exports or another processor branch. Agent telemetry design provides the more detailed field, retention and cardinality contract.

Configure the collector as a controlled processing path

The Collector configuration documentation defines receivers, processors and exporters that are enabled through service pipelines. Review the deployed component set and processing order. A redaction processor listed in a configuration file but absent from the active path provides no protection.

Specify the endpoint protocol, authentication, transport protection and network exposure for your environment. Avoid copying an unrestricted development listener into production. Bound queues and memory, decide how retryable export errors are handled and monitor discarded or delayed records. Flush behaviour at process shutdown should be tested with the actual SDK and runtime.

OTLP acknowledgements apply between adjacent sender and receiver nodes; the specification does not establish an end-to-end guarantee across every intermediary. Treat application-to-collector acceptance and final backend availability as different observations. Keep telemetry delivery failures visible instead of assuming a successful first hop proves complete retention.

Use a conformance fixture, not a connectivity screenshot

Create a synthetic fixture called OT-17 for this illustrative test. It starts a task, invokes a model, runs two harmless lookup tools, crosses a queue boundary and returns a deliberately rejected result. Repeat it with a worker interruption and an unavailable exporter. The fixture makes no external business changes.

For each run, inspect expected operation types, parent or link relationships, service and instrumentation identities, custom task reference, error information and content masking. Verify that a rejection is represented as the defined business outcome rather than inferred solely from a technical span status.

Then query the backend as an operator would: find the task, locate the failed branch, identify the application and instrumentation versions, and determine which evidence is missing. Export the resulting record and check that its essential meaning survives. This is a stronger interoperability test than merely seeing a span appear.

Manage schema changes as operational changes

When a convention or instrumentation library changes, compare the fixture before and after the upgrade. Check field names, value types, operation boundaries, token units where used and score mappings. A dashboard may continue rendering while its underlying interpretation changes.

If an adapter maps old and new attributes, preserve enough version information to explain the transformation. Do not silently combine differently defined metrics into one historical trend. Mark the transition or recompute a comparable series where the retained evidence supports it.

Use release control for changes that affect required operating evidence. The acceptance gate should ask whether operators can still make the necessary decisions. Production monitoring should also watch the telemetry pipeline, not only the agent it describes.

What OpenTelemetry does not decide for you

It does not select the correct business outcome, authorise external actions, establish Saudi data-handling compliance or guarantee that every framework emits complete evidence. Those remain explicit application and operating responsibilities. Its value is a common technical foundation whose actual behaviour can be tested and maintained.

Discuss an OpenTelemetry contract for your AI agents with your language runtime, frameworks, intended backend and a masked execution flow. AgentOps services can be scoped to instrumentation, verification and operating handover requirements. Keep the contract and fixture alongside the service so later changes remain reviewable.

FAQ

Your questions, answered.

Are OpenTelemetry GenAI conventions stable?

The current GenAI convention documents carry Development status in the dedicated repository. That differs from the maturity of OTLP for traces, metrics and logs. Check the exact definitions and implementation versions you intend to use, preserve their references and test upgrades. Do not assume that all fields in an older example remain unchanged.

Does OTLP support mean any agent backend will show the same trace?

No. OTLP establishes transport and encoding, while backend interpretation depends on attributes, operation boundaries, mappings and supported conventions. Run a conformance fixture through the complete pipeline and compare the resulting investigation. A receiver accepting the payload does not prove that its agent view preserves the meaning you need.

Which agent operations should be instrumented manually?

Instrument application boundaries that automatic libraries do not cover adequately, such as custom tool execution, task admission, review handoffs and external confirmations. First inspect actual emitted telemetry to avoid duplicate coverage. Use applicable conventions for technical operations and clearly documented custom fields for business meanings that the standard does not define.

Can trace baggage carry user permissions for an agent?

Do not treat baggage as an authorisation mechanism. It is propagated context and may cross trust boundaries. Keep sensitive credentials out of it, validate external context and enforce permissions through the application security model. A propagated role name or task identifier is not proof that a caller may read evidence or execute a tool.

Does an OTLP acknowledgement guarantee the trace reached final storage?

An acknowledgement concerns a particular sender-receiver interaction. In a multi-hop pipeline, later processing or export can still fail. Monitor those stages and validate final availability where the operating requirement needs it. Preserve authoritative task evidence separately when complete accountability cannot depend on best-effort diagnostic telemetry.

How should we adopt changing GenAI conventions in production?

Pin the versions, document field meanings and maintain a small conformance fixture covering your important execution boundaries. Compare it before and after an upgrade, including masking and operator queries. Review dashboards and historical metrics for changed semantics. A deliberate migration with explicit mappings is more dependable than allowing several libraries to update their field contracts independently.

LET’S WORK TOGETHER

Ready to build what’s next?

Tell us about your project or the platform you want to explore, and we’ll come back to confirm a suitable time.