# OpenTelemetry Collector (/docs/integrations/opentelemetry-collector)



OpenTelemetry Collector example [#opentelemetry-collector-example]

The Collector sends data to the OpenTelemetry app in RawTree Cloud or RawTree
BYOC, where enabled. RawTree stores the resulting rows.

If your application exports OTLP locally, use this config to send traces, logs, and metrics to RawTree.

```yaml
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

exporters:
  otlphttp/rawtree:
    endpoint: https://api.rawtree.com/otlp
    headers:
      Authorization: Bearer ${env:RAWTREE_API_KEY}

service:
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [otlphttp/rawtree]
    logs:
      receivers: [otlp]
      exporters: [otlphttp/rawtree]
    metrics:
      receivers: [otlp]
      exporters: [otlphttp/rawtree]
```

Run it with your cluster API key:

```bash
export RAWTREE_API_KEY=rt_...
otelcol --config collector.yaml
```

Applications can then export to the local Collector:

```bash
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
```

By default, the OpenTelemetry app writes traces to `traces`, logs to `logs`, and metrics to `metrics`.
To use custom destination tables, add a signal-specific header to the exporter `headers` map.
Use `x-rawtree-traces-table`, `x-rawtree-logs-table`, or `x-rawtree-metrics-table`.

See the [OpenTelemetry guide](/docs/integrations/opentelemetry) for endpoint details and the [Transforms guide](/docs/guides/transform/transforms#opentelemetry-output) for emitted row shapes.
