> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abliteration.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenTelemetry

> Export Policy Gateway events as OTLP log records over HTTP or gRPC to any OpenTelemetry collector.

Export Policy Gateway events as OTLP log records to any compatible collector — Grafana, Honeycomb, New Relic, Jaeger, the OpenTelemetry Collector itself.

Two transports are supported — pick one when creating the connector.

## OTLP / HTTP

| Field              | Value                                                                    |
| ------------------ | ------------------------------------------------------------------------ |
| Type               | OpenTelemetry (HTTP)                                                     |
| Collector Endpoint | e.g. `https://collector:4318/v1/logs` (default OTLP/HTTP port is `4318`) |
| Auth Headers       | Map, masked in console. e.g. `Authorization: Basic ...`                  |
| Service Name       | Default `policy-gateway`                                                 |
| Verify TLS         | On by default                                                            |
| Timeout (s)        | Default 10                                                               |

## OTLP / gRPC

| Field              | Value                                                    |
| ------------------ | -------------------------------------------------------- |
| Type               | OpenTelemetry (gRPC)                                     |
| Collector Endpoint | e.g. `collector:4317` (default OTLP/gRPC port is `4317`) |
| Auth Headers       | Same as HTTP                                             |
| Service Name       | Default `policy-gateway`                                 |
| TLS                | On by default                                            |
| Verify TLS         | On by default                                            |
| Timeout (s)        | Default 10                                               |

## Mapping

Each audit field becomes an attribute on the `LogRecord`:

| Audit field            | OTLP attribute                      |
| ---------------------- | ----------------------------------- |
| `event_id`             | `event.id`                          |
| `event_type`           | `event.type`                        |
| `policy_id`            | `abliteration.policy_id`            |
| `decision`             | `abliteration.decision`             |
| `effective_decision`   | `abliteration.effective_decision`   |
| `enforced`             | `abliteration.enforced`             |
| `rollout_mode`         | `abliteration.rollout_mode`         |
| `reason_code`          | `abliteration.reason_code`          |
| `policy_target`        | `abliteration.policy_target`        |
| `project_id`           | `abliteration.project_id`           |
| `model`                | `gen_ai.request.model`              |
| `triggered_categories` | `abliteration.triggered_categories` |
| `denylist_hits`        | `abliteration.denylist_hits`        |
| `allowlist_hits`       | `abliteration.allowlist_hits`       |

Resource attributes:

```text theme={"system"}
service.name       = <your configured service_name>   (default "policy-gateway")
service.namespace  = "abliteration.ai"
```

## Verify

Filter your backend on `service.name = "policy-gateway"`. Grafana Loki example:

```logql theme={"system"}
{service_name="policy-gateway"} |= "REFUSE" | json
```

See the full field list in [connectors](/policy-gateway/connectors).
