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

# OpenTelemetry SDKs and collectors

> Send existing traces, logs and metrics through an OTLP HTTP exporter.

Send existing traces, logs and metrics through an OTLP HTTP exporter.

Start with [ingest key setup](https://docs.struct.ai/observability/instrumentation.md#create-an-ingest-key). Keep credentials in your deployment secret store.

## Configure instrumentation

Set up your language's OpenTelemetry SDK with an OTLP **HTTP** exporter first. These standard environment variables configure exporters that read them; they do not switch an exporter chosen in code from gRPC to HTTP (Go, for example, needs `otlptracehttp`, not `otlptracegrpc`). Then point it at Struct:

```bash theme={null}
export OTEL_SERVICE_NAME=checkout-api
export OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.struct.ai
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS=x-struct-ingest-key=pk-...
```

The SDK adds `/v1/traces`, `/v1/logs`, and `/v1/metrics` to the endpoint itself. Use `http/protobuf` or `http/json`: Struct does not accept OTLP over gRPC.

## Your own OpenTelemetry Collector

Add an `otlphttp` exporter for Struct and list it in each pipeline you want to send:

```yaml theme={null}
exporters:
  otlphttp/struct:
    endpoint: https://ingest.struct.ai
    compression: none
    headers:
      x-struct-ingest-key: ${env:STRUCT_INGEST_KEY}

processors:
  batch:
    send_batch_size: 512
    send_batch_max_size: 1000

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/struct]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/struct]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/struct]
```

Keep your existing receivers and exporters: Struct can be one destination among several. This example uses `compression: none`; keep each uncompressed request below 2 MiB. Use `otlphttp`, not the gRPC `otlp` exporter.

## Limits

| Limit | Value |
| - | - |
| Request body | 2 MiB as sent |
| Compression in the example above | Disabled with `compression: none` |
| Protocol | OTLP over HTTP (protobuf or JSON) at `/v1/traces`, `/v1/logs`, `/v1/metrics` |
| Telemetry on the Free plan | A monthly allowance; past it, `429` until the allowance resets |
| Telemetry on paid plans | Not refused for volume |

The SDKs batch by record count, not size, so very large logs or captured message content can still go over 2 MiB. Reduce those if an SDK gets `413`. A collector that gets `413` can lower `send_batch_size` and `send_batch_max_size`.

A `429` means your workspace is at its own limit, and the response says which in the `x-struct-ingest-limit` header. With `usage-cap`, the workspace has sent its Free plan allowance and its telemetry is paused until the allowance resets or the plan changes; `Retry-After` gives the seconds to wait, at most 600, so exporters drop the batch instead of retrying it, unless the allowance resets within their retry budget.

## Verify the result

Exercise a real operation and follow [signal verification](https://docs.struct.ai/observability/instrumentation.md#verify-instrumentation). Report which signals arrived and which were not configured.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.