# OpenTelemetry Collector

The Kafka exporteris no longer bundled as part of the standard otel collector, so you'll need to use one of the [contrib releases](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases).

## Unauthenticated / BYOC WarpStream Cluster (Example)

The sample configuration file below demonstrates how to configure the OpenTelemetry collector with a Kafka exporter that writes to an unauthenticated WarpStream cluster. This setup makes the most sense when you're self-hosting the WarpStream Agents in your own cloud account / VPC using the BYOC product.

```yaml
receivers:
  otlp:
    protocols:
      http:
        cors:
          allowed_origins:
            - "*"

processors:
  batch:

exporters:
  logging:
    loglevel: debug
  kafka:
    brokers: ["<YOUR_WARPSTREAM_BOOTSTRAP_URL>:9092"]
    topic: "traces"
service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [logging, kafka]
```

## Authenticated WarpStream Cluster (Example)

The sample configuration file below demonstrates how to configure the OpenTelemetry collector with a Kafka exporter that writes to an authenticated WarpStream cluster.

<pre class="language-yaml"><code class="lang-yaml"><strong>receivers:
</strong>  otlp:
    protocols:
      http:
        cors:
          allowed_origins:
            - "*"

processors:
  batch:

exporters:
  logging:
    loglevel: debug
  kafka:
    brokers: ["&#x3C;YOUR_WARPSTREAM_BOOTSTRAP_URL>:9092"]
    topic: "traces"
    auth:
      sasl:
        username: $USERNAME
        password: $PASSWORD
        mechanism: PLAIN
        version: 1
      tls:
        insecure: true
service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [logging, kafka]
</code></pre>

## Configuring Zone Aware Routing

`v0.92.0` of the collector supports specifying Kafka client IDs like so:

```yaml
receivers:
  otlp:
    protocols:
      http:
        cors:
          allowed_origins:
            - "*"

processors:
  batch:

exporters:
  logging:
    loglevel: debug
  kafka:
    brokers: ["<YOUR_WARPSTREAM_BOOTSTRAP_URL>:9092"]
    client_id: "warpstream_az=us-east-1a"
    topic: "traces"
    auth:
      sasl:
        username: $USERNAME
        password: $PASSWORD
        mechanism: PLAIN
        version: 1
      tls:
        insecure: true
service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [logging, kafka]
```

See our documentation on [configuring WarpStream features via the Kafka Client ID](/warpstream/kafka/configure-kafka-client/configuring-kafka-client-id-features.md#warpstream_az) for more details.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.warpstream.com/warpstream/reference/integrations/opentelemetry-collector.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
