Skip to main content
Telemetry is the per-request event that the metrics worker builds and ships off the critical path. Each event captures everything needed to analyze cost, latency, routing, and policy decisions. TrustGate exports events with OpenTelemetry to your collector (NeuralTrust SaaS or your own). On NeuralTrust, those records feed Activity, Analytics, and Telemetry Alerts. The field-level contract used by AlertEngine is documented in the Event schema.

How export works

  1. The proxy finishes the request (including streamed responses).
  2. A background worker builds a structured event (metadata; bodies are not in the default metadata stream).
  3. The event is exported as an OpenTelemetry log record to the configured collector endpoint.
  4. Downstream systems (NeuralTrust metadata store, your SIEM, billing pipelines) consume the collector output.
Export never blocks the client response path — see Metrics worker.

Configuration

Telemetry is configured globally by environment and can be refined per gateway. Per gateway, telemetry can define exporters, static extra_params appended to every event, trace toggles, and a header_mapping that copies inbound headers into event fields. Process-level OTEL_EXPORTER_OTLP_* values supply defaults when a gateway opts into OpenTelemetry export.

Exporters

A gateway’s telemetry.exporters[] selects where its events go: On NeuralTrust Hybrid / SaaS, the control plane wires the collector endpoint for you (see Deployment overview). For self-managed collectors, set OTEL_EXPORTER_OTLP_ENDPOINT (and headers) to your OpenTelemetry Collector.

What the event carries

Events are versioned (schema_version) and carry a kind of llm or mcp. Each includes, among others: Attributes follow OpenTelemetry HTTP and GenAI conventions where applicable (http.request.method, gen_ai.request.model, gen_ai.usage.*, …), plus trustgate.* extensions for gateway-specific fields. Prompt and response bodies are not included in the default metadata export used by alerts and analytics.

Using the data

The attempts and policy_chain data make it possible to reconstruct how each request was routed and which policies fired.