Skip to content

Elastic Observability

Send CredenceStack's traces to Elastic Observability (APM) over OTLP, directly or through an OpenTelemetry Collector.

Facts on this page

Elastic's OTLP intake address and its auth header (a secret token or API key) are from memory. This build ran offline, so the values marked TODO-verify were not confirmed: check them against Elastic's documentation before relying on them.

Prerequisites

  • pip install "credencestack[otel]"
  • An Elastic deployment with APM or its managed OTLP intake.

What you need from Elastic

  • The OTLP endpoint of your deployment and its auth header (secret token or API key): TODO-verify.

Configure

export OTEL_EXPORTER_OTLP_ENDPOINT="<your deployment's OTLP endpoint>"            # TODO-verify
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=<scheme>%20${ELASTIC_APM_TOKEN}"   # TODO-verify the scheme

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 Kibana, open Observability's APM services and the service credencestack (TODO-verify the menu path).
  3. Open a transaction or trace named credencestack scenario <id> #<epoch> and check the spans and credencestack.* labels.

Useful views and alerts

  • Filter with labels.credencestack_result : "fail" or the field Elastic maps the attribute to (TODO-verify the field naming).

Filter generated scenarios and difficulty

Scenario spans of generated scenarios carry credencestack.forge.* attributes (reference). In Discover or the APM trace search, filter with KQL (TODO-verify whether your deployment maps OTLP attributes to attributes.* or labels.*):

attributes.credencestack.forge.level >= 4 and attributes.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

  • Elastic may rename dotted attribute keys when it stores them (TODO-verify).

Last verified

2026-11-28, offline: not tested against an Elastic deployment. Docs: https://www.elastic.co/docs/solutions/observability/apm/opentelemetry (TODO-verify the URL).