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  {"kind": "receiver", "name": "kafka/metrics", "data_type": "metrics", "error": "proto: MetricsData: wiretype end group for non-group"} #34850

Open
narayanbhawar10 opened this issue Aug 26, 2024 · 3 comments
Labels
bug Something isn't working needs triage New item requiring triage receiver/kafka

Comments

@narayanbhawar10
Copy link

Component(s)

receiver/kafka

What happened?

Description

Getting error while using kafka reciever to get metrics

Steps to Reproduce

Expected Result

Actual Result

Collector version

Latest

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

receivers:
kafka:
protocol_version: 2.0.0
topic: mykafka
brokers:
- "localhost:9092"
resolve_canonical_bootstrap_servers_only: true
metadata:
retry:
max: 10
backoff: 5s
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
grpc:
endpoint: 0.0.0.0:4317
processors:
batch:
timeout: 5s
send_batch_size: 100000
resource:
attributes:
- key: test.key
value: "test-value"
action: insert

exporters:
debug:
verbosity: normal
clickhouse:
endpoint: tcp://127.0.0.1:9000?dial_timeout=10s
database: otel
async_insert: true
ttl: 72h
compress: lz4
create_schema: true
logs_table_name: otel_logs
traces_table_name: otel_traces
metrics_table_name: otel_metrics
timeout: 5s
retry_on_failure:
enabled: true
initial_interval: 5s
max_interval: 30s
max_elapsed_time: 300s

extensions:
health_check: {}
zpages: {}


service:
extensions: [zpages, health_check]
pipelines:
logs:
receivers: [ kafka ]
processors: [ batch ]
exporters: [ clickhouse ]
traces:
receivers: [ kafka ]
processors: [ batch ]
exporters: [ clickhouse ]
metrics:
receivers: [ kafka ]
processors: [ batch ]
exporters: [ clickhouse ]

Log output

2024-08-25T14:38:37.456+0530  info  kafkareceiver/kafka_receiver.go:551  Starting consumer group  {"kind": "receiver", "name": "kafka/metrics", "data_type": "metrics", "partition": 0}
2024-08-25T14:38:38.946+0530  debug  kafkareceiver/kafka_receiver.go:561  Kafka message claimed  {"kind": "receiver", "name": "kafka/metrics", "data_type": "metrics", "value": "Hello 11", "timestamp": "2024-08-25T14:38:38.942+0530", "topic": "quickstart"}
2024-08-25T14:38:38.946+0530  error  kafkareceiver/kafka_receiver.go:580  failed to unmarshal message  {"kind": "receiver", "name": "kafka/metrics", "data_type": "metrics", "error": "proto: MetricsData: wiretype end group for non-group"}

Additional context

No response

@narayanbhawar10 narayanbhawar10 added bug Something isn't working needs triage New item requiring triage labels Aug 26, 2024
Copy link
Contributor

Pinging code owners:

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

@narayanbhawar10 narayanbhawar10 changed the title [kafkareceiver] getting error kafkareceiver/kafka_receiver.go:580  failed to unmarshal message  {"kind": "receiver", "name": "kafka/metrics", "data_type": "metrics", "error": "proto: MetricsData: wiretype end group for non-group"} [kafkareceiver] failed to unmarshal message  {"kind": "receiver", "name": "kafka/metrics", "data_type": "metrics", "error": "proto: MetricsData: wiretype end group for non-group"} Aug 27, 2024
@iblancasa
Copy link
Contributor

Could you format the config properly? @narayanbhawar10

@wildum
Copy link
Contributor

wildum commented Aug 28, 2024

Hello, the problem that you have is that you specify a topic "topic: mykafka" but you try to use it for your metrics and logs and traces pipelines. A topic should only contain one signal: either metrics, logs or traces.
You have two options to solve your problem:

  • either you have three different topics named exactly "otlp_metrics", "otlp_tracees" and "otlp_spans". Then you can remove the "topic: mykafka" to use the default version per pipeline.
  • or if you want different names for your topics, you will need to create 3 kafka receivers in your config

more details about it in this ticket: #32735

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage receiver/kafka
Projects
None yet
Development

No branches or pull requests

6 participants
@iblancasa @wildum @narayanbhawar10 and others