# Observability

> Send a trace for every request to Langfuse or any OpenTelemetry collector, with tags, filtering and control over whether prompt text leaves the gateway.

Product: AI Cost Optimizer Gateway (ACOG). Web version: https://tessarac.com/docs/acog/administer/observability. Last updated: 2026-10-16.

ACOG can send a trace for every request to your own observability tools. Traces are sent after the request, in the background: a failure here never delays or fails a request, or changes its billing.

Open **Admin → Observability**. You need the **Edit the organization's profile** permission (`admin:org`).

## Destinations

Configure either, both or neither.

| Destination | Settings | What is sent |
|---|---|---|
| **OpenTelemetry** | An OTLP/HTTP endpoint | One span per request, using the OpenTelemetry generative-AI semantic conventions |
| **Langfuse** | Host, public key and secret key (all three, or none) | A trace per request with its generation: model, tokens, cost, latency and, optionally, the prompt and completion |

The Langfuse secret key is stored encrypted and never shown again.

## Prompt and completion text

With prompt and completion capture on, each Langfuse trace includes the request's prompt and the model's reply. Off, only the economics leave the gateway: tokens, cost, latency and model. Capture is on by default once Langfuse is configured.

If you use [data loss prevention](https://tessarac.com/docs/acog/govern/data-loss-prevention.md), consider turning capture off: text DLP allowed through to the model would otherwise also be sent to Langfuse.

## Tags

Tags (for example `env:prod`) help you filter traces. They come from four places and add up, never replacing each other:

1. organization default tags, set here;
2. the application's tags ([Applications](https://tessarac.com/docs/acog/administer/applications.md));
3. the API key's tags ([API keys](https://tessarac.com/docs/acog/administer/api-keys.md));
4. the request's own `x-acog-trace-tags` header (comma-separated), plus optional JSON in `x-acog-trace-metadata`.

## Filtering

Trace filters (keep only errors, drop cache hits, sample a percentage) limit what Langfuse receives. They never affect usage reporting or billing.

## Per application

Each application can turn trace forwarding off, for example when it already sends its own traces. See [Applications](https://tessarac.com/docs/acog/administer/applications.md).
