A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pkg.go.dev/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver below:

kafkareceiver package - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver - Go Packages

Kafka Receiver

Kafka receiver receives telemetry data from Kafka, with configurable topics and encodings.

If used in conjunction with the kafkaexporter configured with include_metadata_keys. The Kafka receiver will also propagate the Kafka headers to the downstream pipeline, giving access to the rest of the pipeline to arbitrary metadata keys and values.

Getting Started

[!NOTE] You can opt-in to use franz-go client by enabling the feature gate receiver.kafkareceiver.UseFranzGo when you run the OpenTelemetry Collector. See the following page for more details: Feature Gates

The franz-go client supports directly consuming from multiple topics by specifying a regex expression. To enable this feature, prefix your topic with the ^ character. This is identical to how the librdkafka client works.

If you use the ^ prefix, in the deprecated topic setting, if any of the topics have the ^ prefix, regex consuming will be enabled.

There are no required settings.

The following settings can be optionally configured:

Supported encodings

The Kafka receiver supports encoding extensions, as well as the following built-in encodings.

Available for all signals:

Available only for traces:

Available only for logs:

The Kafka receiver will extract Kafka message headers and include them as request metadata (context). This metadata can then be used throughout the pipeline, for example to set attributes using the attributes processor.

Example configurations Minimal configuration

By default, the receiver does not require any configuration. With the following configuration, the receiver will consume messages from the default topics from localhost:9092 using the otlp_proto encoding:

receivers:
  kafka:
TLS and authentication

In this example the receiver is configured to connect to Kafka using TLS for encryption, and SASL/SCRAM for authentication:

receivers:
  kafka:
    tls:
    auth:
      sasl:
        username: "user"
        password: "secret"
        mechanism: "SCRAM-SHA-512"

In addition to propagating Kafka message headers as metadata as described above in Message header propagation, the Kafka receiver can also be configured to extract and attach specific headers as resource attributes. e.g.

receivers:
  kafka:
    header_extraction: 
      extract_headers: true
      headers: ["header1", "header2"]

If we produce a Kafka message with headers "header1: value1" and "header2: value2" with the above configuration, the receiver will attach these headers as resource attributes with the prefix "kafka.header.", i.e.

"resource": {
  "attributes": {
    "kafka.header.header1": "value1",
    "kafka.header.header2": "value2",
  }
}
...

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4