Skip to content

Grafana Cloud and Tempo

Send CredenceStack's traces to Grafana Cloud (Tempo behind its OTLP gateway), or to a self-run Tempo.

Facts on this page

Grafana Cloud's OTLP gateway URL and its Basic-auth scheme are from memory. This build ran offline, so the values marked TODO-verify were not confirmed: check them against Grafana's documentation before relying on them.

Prerequisites

  • pip install "credencestack[otel]"
  • A Grafana Cloud stack, or a Tempo instance with its OTLP receiver enabled.

What you need from Grafana

  • Grafana Cloud: the stack's OTLP endpoint (shown in the stack's OpenTelemetry settings), its instance id and an access token with write scope; the endpoint form and the auth scheme (Basic, instance id:token) are TODO-verify.
  • Self-run Tempo: its OTLP receiver address (by default the OpenTelemetry ports 4317 and 4318).

Configure

# Grafana Cloud (TODO-verify the endpoint and the auth scheme)
AUTH="$(printf '%s:%s' "$GRAFANA_INSTANCE_ID" "$GRAFANA_TOKEN" | base64 | tr -d '\n')"
export OTEL_EXPORTER_OTLP_ENDPOINT="<your stack's OTLP endpoint>"
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic%20${AUTH}"

# Self-run Tempo instead:
# export OTEL_EXPORTER_OTLP_ENDPOINT="http://tempo.internal:4318"

Run

credencestack otel check
credencestack run -p payments --agent my_agent:policy --otel

Verify

  1. otel check prints OK, and the run ends with OTel: exported N span(s).
  2. In Grafana, open Explore with the Tempo data source (TODO-verify for your version) and search for service credencestack in the last hour.
  3. Open a credencestack scenario <id> #<epoch> trace: invoke_agent, execute_tool spans, and the credencestack.finding events.
  4. TraceQL such as { span.credencestack.result = "fail" } lists failed scenarios.

Useful views and alerts

  • TraceQL: { span.credencestack.findings.max_severity = "critical" }.
  • Report links: CREDENCESTACK_OTEL_TRACE_URL_TEMPLATE with your Grafana Explore URL for a trace id (TODO-verify the URL format).

Filter generated scenarios and difficulty

Scenario spans of generated scenarios carry credencestack.forge.* attributes (reference). In Explore with the Tempo data source, use TraceQL:

{ span.credencestack.forge.generated = true && span.credencestack.forge.level >= 4 && span.credencestack.result = "fail" }

Compare the failure rate by level with the fixed scenarios (credencestack.forge.generated absent) to see the brittleness of an agent in your own traces.

Limitations and troubleshooting

  • Spans use wall-clock time; widen the time range if you ran a while ago.
  • A failed test leaves the status unset; query credencestack.test_failed instead of status.

Last verified

2026-11-28, offline: not tested against Grafana Cloud or Tempo. Docs: https://grafana.com/docs/grafana-cloud/send-data/otlp/ (TODO-verify the URL).