Section 7 · Add metrics and traces

The OTLP endpoint URL and OTLP instance ID on the OpenTelemetry card, why that Instance ID can differ from the Agent Observability one, and why not to generate a second token.

Estimated time: 2 min

Two Instance IDs

To send OpenTelemetry metrics and traces directly to Grafana Cloud, you also need an OTLP endpoint URL and an OTLP instance ID.

  • The OTLP endpoint URL, the address OpenTelemetry exporters send metrics and traces to. It is the value for OTEL_EXPORTER_OTLP_ENDPOINT.
  • The OTLP Instance ID. An Instance ID is a numeric Grafana Cloud stack ID. This one is the basic auth username for OTLP. Basic auth uses a username and a secret: this Instance ID is the username, and the access policy token is the secret.

How to locate the OTLP endpoint URL and Instance ID

The page at https://grafana.com/orgs/<org>/stacks/<stack-id> shows a card for each product on your stack, and each card contains information about that product. The OpenTelemetry card shows the OTLP endpoint URL and the Instance ID.

The two Instance IDs can differ

The Instance ID on the OpenTelemetry card is not necessarily the same as the Agent Observability Instance ID you copied from the setup screen and use as AGENTO11Y_AUTH_TENANT_ID.

The Instance ID on the setup screen in Agent Observability is a numeric stack ID used as AGENTO11Y_AUTH_TENANT_ID. The Instance ID on the OpenTelemetry card on the Grafana Cloud portal is the basic auth username for OTLP.

Caution

Use the number shown on the card for OTLP.

Why not to generate a second token

The access policy token already covers the OTLP scopes because you selected metrics:write, logs:write, and traces:write when you created the access policy.

Caution

Don’t click Generate now on the OpenTelemetry card.