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¶
otel checkprints OK, and the run ends withOTel: exported N span(s).- In Grafana, open Explore with the Tempo data source (TODO-verify for your version) and search for service
credencestackin the last hour. - Open a
credencestack scenario <id> #<epoch>trace:invoke_agent,execute_toolspans, and thecredencestack.findingevents. - 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_TEMPLATEwith 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_failedinstead 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).