# OpenTelemetry

> Add General Context as one more OTLP destination. No code change if your spans already carry GenAI attributes.

We accept OTLP over HTTP, protobuf or JSON, gzip or not. Spans without GenAI attributes are ignored, so pointing a whole pipeline at us is safe.

## Send your traces

Environment:

```bash
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://generalcontextlabs.com/api/platform-collect/v1/traces
OTEL_EXPORTER_OTLP_TRACES_HEADERS=Authorization=Bearer gck_...
```

Collector:

```yaml
exporters:
  otlphttp/generalcontext:
    traces_endpoint: https://generalcontextlabs.com/api/platform-collect/v1/traces
    headers: { x-api-key: "gck_..." }
    compression: gzip
```

> **Warning:** Message content must be on the spans. Set `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true` for OpenTelemetry instrumentations, or `TRACELOOP_TRACE_CONTENT=true` for OpenLLMetry.

## What we read

| What | Attributes |
| --- | --- |
| Model calls | OpenTelemetry GenAI conventions (`gen_ai.input.messages`, `gen_ai.output.messages`) and OpenLLMetry's `gen_ai.prompt.N.*` and `gen_ai.completion.N.*` |
| Tool calls | `execute_tool` spans with `gen_ai.tool.name`, arguments and result |
| Conversation | `session.id` or `gen_ai.conversation.id`; without either, the trace id |
| Channel | `channel` or `app.channel` |
| Account | `generalcontext.account`: the company the conversation was for, if your agent works for several |
| Who and which agent | `user.id`; `service.name` or `gen_ai.agent.name` |
