OTel observability
The platform emits OpenTelemetry traces per invocation. Spans cover each step: kernel-service calls, LLM calls, capability calls, DB operations.
What's emitted#
Each invocation produces a trace with:
| Span | Attributes |
|---|---|
invocation.handle (root) | agent.id, agent.version, tenant.id, invocation.id, invocation.mode |
kernel.<service>.<op> (child) | service.name, op, latency.ms, kernel.disabled |
llm.complete (child) | model, provider, tokens.input, tokens.output, cost.usd |
capability.call (child) | capability.name, connector.alias, connector.type |
connector.call (child) | alias, method, rows.returned |
human.request (child) | kind, tier, status, wait.seconds |
Spans are nested so a capability.call under which a connector.call
fires shows the full causal chain. Durations + errors propagate up to
the root span.
Export to a collector#
The platform exposes OTel traces at /api/invocations/<id>/trace and
can push to any OTLP collector:
Push mode (preferred)#
Portal → Settings → Observability → OTLP endpoint:
Endpoint: https://otel.your-company.internal:4317
Protocol: grpc
Headers: authorization: Bearer <token>
Resource attrs:
deployment.environment: production
service.namespace: konstera
Every invocation's trace is batched and pushed. Default batch: 100 spans or 10 seconds, whichever comes first. Configurable per tenant.
Pull mode (CLI)#
konstera invocation export inv-abc123 --format otel > trace.json
# JSON file conforming to the OTLP/JSON spec
# Pipe into otelcol, Jaeger, or whatever accepts OTLP
Collector configurations#
Datadog:
exporters:
datadog:
api:
key: ${DD_API_KEY}
site: datadoghq.com
service:
pipelines:
traces:
receivers: [otlp]
exporters: [datadog]
Honeycomb:
exporters:
otlp:
endpoint: api.honeycomb.io:443
headers:
x-honeycomb-team: ${HONEYCOMB_API_KEY}
x-honeycomb-dataset: konstera-production
service:
pipelines:
traces:
receivers: [otlp]
exporters: [otlp]
Jaeger / Tempo / self-hosted Elastic APM: standard OTLP, no Konstera-specific config.
Correlation with the portal#
OTel spans carry Konstera's native invocation.id so you can jump from
Datadog / Honeycomb back to the portal:
https://app.konstera.ai/invocations/<invocation.id>
Set this as a trace-attribute link in your observability tool and it becomes clickable in flame-graph views.
Semantic conventions#
Konstera follows OTel semantic conventions where they exist and adds
Konstera-specific namespaces (konstera.*) where they don't:
- Standard:
http.*,db.*,rpc.* - Konstera:
konstera.agent.id,konstera.tenant.id,konstera.capability.name,konstera.llm.purpose
Documented at docs.konstera.ai/otel-conventions (lands with v0.7.0;
until then, span inspector in the portal shows every attribute).
Sampling#
Default: trace every invocation. For high-volume production (10k+ invocations/day) this gets expensive on observability-tool side.
Head-based sampling (configure in collector):
processors:
probabilistic_sampler:
sampling_percentage: 10 # 10% of all traces
Tail-based sampling (configure in collector):
processors:
tail_sampling:
policies:
- name: errors
type: status_code
status_code: { status_codes: [ERROR] }
- name: slow
type: latency
latency: { threshold_ms: 5000 }
- name: baseline
type: probabilistic
probabilistic: { sampling_percentage: 1 }
Tail-based keeps all errors + all slow traces + 1% of normal — the typical production setup.
Logs correlation#
Agent logs (ctx.log.*) are not currently in the OTel trace — they're
in the kernel's invocation_logs table + the portal UI. Future releases
will add log correlation via trace ID (ADR follow-up).
Until then, pivot from a trace in your observability tool to the portal's
log view via the konstera.invocation.id attribute.
Pitfalls#
- PII in span attributes: don't put customer emails, order IDs, or credential values in span attributes. OTel exports flow outside the tenant's data residency boundary.
- Over-sampling at head: head-based 10% means you'll miss 90% of errors too. Use tail-based for production.
- High-cardinality labels: tenants with 1000s of distinct connector
aliases will blow up label cardinality in Prometheus-adjacent systems.
Portal's OTel export doesn't emit
aliasesas labels — only as span attributes, which don't suffer from cardinality explosions.
See also#
- Debugging failed invocations — portal-side trace view
- Why Temporal — the workflow activities that become spans
- Deploy — collector endpoints per deployment shape