Skip to content

Kafka Exporter w/ AWS_MSK_IAM Mechanism Not Working #19747

Closed as not planned
Closed as not planned
@flyerjayden

Description

@flyerjayden

Component(s)

exporter/kafka

What happened?

Description

I am getting following error message when authentication mechanism is set to AWS_MSK_IAM:

Error: failed to build pipelines: failed to create "kafka" exporter, in pipeline "traces/*": kafka: invalid configuration (The SASL mechanism configuration is invalid. Possible values are `OAUTHBEARER`, `PLAIN`, `SCRAM-SHA-256`, `SCRAM-SHA-512` and `GSSAPI`)
2023/03/16 06:28:18 collector server run finished with error: failed to build pipelines: failed to create "kafka" exporter, in pipeline "traces/*": kafka: invalid configuration (The SASL mechanism configuration is invalid. Possible values are `OAUTHBEARER`, `PLAIN`, `SCRAM-SHA-256`, `SCRAM-SHA-512` and `GSSAPI`)

Steps to Reproduce

Deploy OpenTelemetry collector using following config:

exporters:
  kafka:
    topic: {{ kafka_topic_name }}
    brokers:
      - {{ broker1_host }}:9098
      - {{ broker2_host}}:9098
    auth:
      sasl:
        username: {{ aws_access_key }}
        password: {{ aws_secret_key }}
        mechanism: AWS_MSK_IAM
        aws_msk:
          region: us-west-2
          broker_addr: {{ broker1_host }}:9098

Expected Result

OpenTelemetry collector sends traces to MSK topic

Actual Result

Error message:

Error: failed to build pipelines: failed to create "kafka" exporter, in pipeline "traces/*": kafka: invalid configuration (The SASL mechanism configuration is invalid. Possible values are `OAUTHBEARER`, `PLAIN`, `SCRAM-SHA-256`, `SCRAM-SHA-512` and `GSSAPI`)
2023/03/16 06:28:18 collector server run finished with error: failed to build pipelines: failed to create "kafka" exporter, in pipeline "traces/*": kafka: invalid configuration (The SASL mechanism configuration is invalid. Possible values are `OAUTHBEARER`, `PLAIN`, `SCRAM-SHA-256`, `SCRAM-SHA-512` and `GSSAPI`)

Collector version

0.73

Environment information

Environment

OS: EKS 1.24 / Amazon Linux 2
Compiler(if manually compiled): Used Docker image from Docker hub

OpenTelemetry Collector configuration

exporters:
  kafka:
    topic: {{ kafka_topic_name }}
    brokers:
      - {{ broker1_host }}:9098
      - {{ broker2_host}}:9098
    auth:
      sasl:
        username: {{ aws_access_key }}
        password: {{ aws_secret_key }}
        mechanism: AWS_MSK_IAM
        aws_msk:
          region: us-west-2
          broker_addr: {{ broker1_host }}:9098

Log output

Error: failed to build pipelines: failed to create "kafka" exporter, in pipeline "traces/*": kafka: invalid configuration (The SASL mechanism configuration is invalid. Possible values are `OAUTHBEARER`, `PLAIN`, `SCRAM-SHA-256`, `SCRAM-SHA-512` and `GSSAPI`)
2023/03/16 06:28:18 collector server run finished with error: failed to build pipelines: failed to create "kafka" exporter, in pipeline "traces/*": kafka: invalid configuration (The SASL mechanism configuration is invalid. Possible values are `OAUTHBEARER`, `PLAIN`, `SCRAM-SHA-256`, `SCRAM-SHA-512` and `GSSAPI`)

Additional context

It seems Sarama (https://github.com/Shopify/sarama/blob/7dbf0b5d85538641227a30a281f1a54e18a94cb7/broker.go#L64) does not support (and they are not planning to support) AWS_MSK_IAM mechanism.

If anyone was able to configure Kafka exporter with IAM, your advices would be very appreciated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions