Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KafkaReceiver "failed to unmarshal message" "illegal wiretype" #31679

Closed
acar-ctpe opened this issue Mar 11, 2024 · 6 comments · Fixed by #33678
Closed

KafkaReceiver "failed to unmarshal message" "illegal wiretype" #31679

acar-ctpe opened this issue Mar 11, 2024 · 6 comments · Fixed by #33678
Labels
documentation Improvements or additions to documentation receiver/kafka

Comments

@acar-ctpe
Copy link

acar-ctpe commented Mar 11, 2024

Component(s)

receiver/kafka

Description

Unable to get kafka receiver to work with a valid endpoint/topic

Steps to Reproduce

  • Deploy collector 0.95.0 with kafka receiver

Collector version

0.95.0

Environment information

Environment

Collector: Kubernetes 1.23 helm chart

OpenTelemetry Collector configuration

mode: "deployment"
config:
  receivers:
    kafka/metrics:
      brokers:
        - XYZ:9092
      client_id: ObservabilityOpentelemetryCollector-metrics
      topic: OpenTelemetry_Metrics
      encoding: otlp_proto
      auth:
        sasl:
          username: ${env:XYZ}
          password: ${env:CYZ}
          mechanism: SCRAM-SHA-256
        tls:
          insecure: false
          insecure_skip_verify: true

Log output

2024-03-11T09:27:03.951Z	info	kafkareceiver@v0.95.0/kafka_receiver.go:514	Starting consumer group	{"kind": "receiver", "name": "kafka/metrics", "data_type": "metrics", "partition": 2}
2024-03-11T09:27:03.952Z	info	kafkareceiver@v0.95.0/kafka_receiver.go:514	Starting consumer group	{"kind": "receiver", "name": "kafka/metrics", "data_type": "metrics", "partition": 18}
2024-03-11T09:27:03.952Z	info	kafkareceiver@v0.95.0/kafka_receiver.go:514	Starting consumer group	{"kind": "receiver", "name": "kafka/metrics", "data_type": "metrics", "partition": 20}
2024-03-11T09:27:12.937Z	error	kafkareceiver@v0.95.0/kafka_receiver.go:544	failed to unmarshal message	{"kind": "receiver", "name": "kafka/metrics", "data_type": "metrics", "error": "proto: illegal wireType 6"}
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver.(*metricsConsumerGroupHandler).ConsumeClaim
	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver@v0.95.0/kafka_receiver.go:544
github.com/IBM/sarama.(*consumerGroupSession).consume
	github.com/IBM/sarama@v1.42.2/consumer_group.go:952
github.com/IBM/sarama.newConsumerGroupSession.func2
Screenshot 2024-03-11 at 10 32 46

Additional context

No response

@acar-ctpe acar-ctpe added bug Something isn't working needs triage New item requiring triage labels Mar 11, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member

Related: #5908, #16078, #22934

It looks like the data coming in must not match specification, but I haven't gotten a chance to see why.

@Frapschen Frapschen removed the needs triage New item requiring triage label Mar 18, 2024
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label May 20, 2024
@crobert-1 crobert-1 removed the Stale label May 20, 2024
@maxdidkivskyi
Copy link

Got the same issue otel/opentelemetry-collector-contrib:0.102.1:

2024-06-10T16:43:37.752Z        error   kafkareceiver@v0.102.0/kafka_receiver.go:643    failed to unmarshal message     {"kind": "receiver", "name": "kafka", "data_type": "logs", "error": "proto: wrong wireType = 2 for field TimeUnixNano"}

What do I do wrong? My configuration is:
Exporter:

  kafka:
    protocol_version: "2.0.0"
    brokers: 
      - kafka.local:9092
    topic: telemetry
    client_id: exporter.local
    encoding: otlp_proto
    partition_traces_by_id: true
    producer: 
      max_message_bytes: 1048576 
      compression: none
    timeout: 5s

Receiver:

  kafka:
    protocol_version: "2.0.0"
    brokers: 
      - kafka.local:9092
    topic: telemetry
    encoding: otlp_proto
    initial_offset: earliest
    client_id: receiver.local
    group_id: otel-collector
    message_marking:
      after: true

Used telemetry signals: spans, metrics.

It seems it's some fluky issue, because sometimes it consumes and parses message successfully.

IDK if it's matter, I use the tracegen tool to generate spans.

@maxdidkivskyi
Copy link

Okay, I understand my mistake now. I expected to deliver all signals (metrics, logs, spans) through a single topic, but unfortunately, that doesn't work. By the way, I didn't see this limitation mentioned in the documentation for either the Kafka exporter or the Kafka receiver.

@crobert-1
Copy link
Member

Thanks for following up @maxdidkivskyi! That's very helpful to know. I've filed #33678 to hopefully clarify this.

@crobert-1 crobert-1 added documentation Improvements or additions to documentation and removed bug Something isn't working labels Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation receiver/kafka
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants