Section 7 · Add metrics and traces

The export setup this route depends on when your generation is in Conversations but no span or metric from the SDK has reached Traces or Metrics.

Estimated time: 1 min

When traces or metrics don’t arrive

Your generation is in Conversations, but no span or metric from the SDK has reached your Grafana Cloud Traces or Metrics data source. These are the export setup facts this route depends on.

The export setup

Each one is a value you set while exporting metrics and traces.

  • Providers are configured before the client. Your application must configure a TracerProvider and MeterProvider before creating the Agent Observability client. Without them, SDK-emitted metrics and traces are dropped.
  • The Base64 header has no trailing newline. base64 adds a trailing newline that invalidates the header, so the tr -d '\n' in the command is not optional.
  • Use the OTLP Instance ID. The Base64 value encodes the Instance ID from the OpenTelemetry card, which can differ from the Agent Observability Instance ID.
  • Your token covers the OTLP scopes. The access policy token already covers the OTLP scopes if you selected them when you created the access policy.