Launch Week 02 wrapped — explore all five launches

AWS Bedrock AgentCore

Export hosted agent traces to Confident AI with OpenTelemetry

Overview

Amazon Bedrock AgentCore Runtime hosts and scales AI agents. Send the OpenTelemetry spans generated by your hosted agent directly to Confident AI using an OTLP exporter.

If your agent already emits OpenTelemetry spans, you can reuse its instrumentation and configure its exporter. You do not need to install confident-trace solely to send existing spans to Confident AI. For an application that needs instrumentation, see the AgentCore SDK integration.

Before You Begin

  • An AgentCore deployment whose agent framework emits OpenTelemetry spans.
  • An OTLP/HTTP protobuf trace exporter installed and initialized in the agent process.
  • A project API key from Confident AI.
  • Outbound HTTPS access from the runtime to your Confident AI ingestion endpoint.

Configure Trace Export

  1. Configure AgentCore for external observability

    Set DISABLE_ADOT_OBSERVABILITY to true in your AgentCore deployment configuration. AWS documents this setting for using other observability platforms: it clears the runtime's default ADOT environment variables. Configure your application's own instrumentation and exporter after removing those defaults.

    This changes the default telemetry setup. If you also need application traces in CloudWatch, configure a separate export path deliberately; do not assume the default ADOT export remains enabled.

  2. Point your trace exporter to Confident AI

    Configure the following settings in the environment used by your agent's OpenTelemetry SDK:

    SettingValue
    OTEL_EXPORTER_OTLP_TRACES_ENDPOINThttps://otel.confident-ai.com/v1/traces
    OTEL_EXPORTER_OTLP_TRACES_PROTOCOLhttp/protobuf
    OTEL_EXPORTER_OTLP_TRACES_HEADERSx-confident-api-key=YOUR_CONFIDENT_PROJECT_KEY
    OTEL_SERVICE_NAMEA stable name for your agent

    For an EU project, use https://eu.otel.confident-ai.com/v1/traces. For a self-hosted deployment, use its full OTLP/HTTP traces URL. Supply the API key through your deployment's secret configuration.

    These settings are read by an initialized OTLP exporter. Environment variables alone do not create spans or initialize tracing. If your framework configures its exporter explicitly, supply the equivalent endpoint, protocol, and header there. See OpenTelemetry setup.

  3. Deploy and verify

    Deploy the updated agent and invoke it once. Open the Observatory in your Confident AI project and look for the trace generated by that invocation. Check the span hierarchy, model and tool operations, and any message content your instrumentation captures.

    Allow the exporter to flush its batch. Ensure graceful shutdown flushes pending spans when the agent process exits.

What Gets Captured

Confident AI receives the spans your application exports: agent runs, model calls, tool execution, and custom operations supported by your instrumentation. Input/output content and token usage depend on the framework's capture settings and emitted attributes.

Troubleshooting

  • No traces: confirm the agent initializes an OTLP trace exporter and actually emits spans. Check that runtime defaults have not replaced the intended configuration.
  • Authentication errors: verify the project key and x-confident-api-key header, including the project region.
  • Missing messages or model details: inspect your framework's content-capture settings and the supported span attributes.
  • Duplicate spans: check whether multiple instrumentation libraries are tracing the same operations.

See AWS's observability configuration for the runtime's external-observability setting and the separate service-telemetry options.

Need help wiring this into your stack?Bring traces and evals into the tools your team already usesTalk to an expert

Last updated on

Built byConfident AI