-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Kafka receiver does not render otelcol_kafka_receiver_current_offset correctly #30177
Labels
Comments
spadger
added
bug
Something isn't working
needs triage
New item requiring triage
labels
Dec 22, 2023
88 tasks
spadger
added a commit
to spadger/opentelemetry-collector-contrib
that referenced
this issue
Jan 16, 2024
…y#30177) add changelog notes
MovieStoreGuy
added a commit
that referenced
this issue
Jan 17, 2024
**Description:** Fixes [#30177](#30177) The Kafka receiver now exposes the following metrics according to partition. Beforehand, if a collector were consuming from 10 partitions, one of each metric would be rendered, with its value fluctuating according to the state of each partition's consumer. Now the metrics endpoint will expose 10 sets of metrics, each with a `partition` tag. * kafka_receiver_messages * kafka_receiver_current_offset * kafka_receiver_offset_lag **Testing:** * Unit tests were run * Stats endpoint observed manually for correctness * Scraped stats charted in Prometheus to ensure stability Example output: ``` otelcol_kafka_receiver_messages{name="",partition="0",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 29 otelcol_kafka_receiver_messages{name="",partition="1",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 32 otelcol_kafka_receiver_messages{name="",partition="10",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 32 otelcol_kafka_receiver_messages{name="",partition="11",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 28 otelcol_kafka_receiver_messages{name="",partition="12",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 36 otelcol_kafka_receiver_messages{name="",partition="13",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 38 ``` **Documentation:** None added Co-authored-by: Sean Marciniak <[email protected]>
mfyuce
pushed a commit
to mfyuce/opentelemetry-collector-contrib
that referenced
this issue
Jan 18, 2024
…y#30177) (open-telemetry#30268) **Description:** Fixes [open-telemetry#30177](open-telemetry#30177) The Kafka receiver now exposes the following metrics according to partition. Beforehand, if a collector were consuming from 10 partitions, one of each metric would be rendered, with its value fluctuating according to the state of each partition's consumer. Now the metrics endpoint will expose 10 sets of metrics, each with a `partition` tag. * kafka_receiver_messages * kafka_receiver_current_offset * kafka_receiver_offset_lag **Testing:** * Unit tests were run * Stats endpoint observed manually for correctness * Scraped stats charted in Prometheus to ensure stability Example output: ``` otelcol_kafka_receiver_messages{name="",partition="0",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 29 otelcol_kafka_receiver_messages{name="",partition="1",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 32 otelcol_kafka_receiver_messages{name="",partition="10",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 32 otelcol_kafka_receiver_messages{name="",partition="11",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 28 otelcol_kafka_receiver_messages{name="",partition="12",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 36 otelcol_kafka_receiver_messages{name="",partition="13",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 38 ``` **Documentation:** None added Co-authored-by: Sean Marciniak <[email protected]>
cparkins
pushed a commit
to AmadeusITGroup/opentelemetry-collector-contrib
that referenced
this issue
Feb 1, 2024
…y#30177) (open-telemetry#30268) **Description:** Fixes [open-telemetry#30177](open-telemetry#30177) The Kafka receiver now exposes the following metrics according to partition. Beforehand, if a collector were consuming from 10 partitions, one of each metric would be rendered, with its value fluctuating according to the state of each partition's consumer. Now the metrics endpoint will expose 10 sets of metrics, each with a `partition` tag. * kafka_receiver_messages * kafka_receiver_current_offset * kafka_receiver_offset_lag **Testing:** * Unit tests were run * Stats endpoint observed manually for correctness * Scraped stats charted in Prometheus to ensure stability Example output: ``` otelcol_kafka_receiver_messages{name="",partition="0",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 29 otelcol_kafka_receiver_messages{name="",partition="1",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 32 otelcol_kafka_receiver_messages{name="",partition="10",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 32 otelcol_kafka_receiver_messages{name="",partition="11",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 28 otelcol_kafka_receiver_messages{name="",partition="12",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 36 otelcol_kafka_receiver_messages{name="",partition="13",service_instance_id="db3bae97-1856-4b49-85cb-8559db48f345",service_name="otelcontribcol",service_version="0.91.0-dev"} 38 ``` **Documentation:** None added Co-authored-by: Sean Marciniak <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Component(s)
receiver/kafka
What happened?
Description
The Kafka receiver only reports
otelcol_kafka_receiver_current_offset
metrics for a single partition. e.g. If I have a 10-partition topic, and three collectors, each will render the metric once.The value reported is correct for the single partition that is being reported on; the rest are just missing
I'm /guessing/ the issues is at kafka_receiver.go->ConsumeClaim(), where a
partition
tag needs to be introduced, with value=claim.Partition()
Steps to Reproduce
Expected Result
Each partition has its offset reported, with a
partition
tag (ideally)Actual Result
Only one partition has its offset reported. I omitted some uninteresting tag, but note that
name
was an empty stringCollector version
0.91.0
Environment information
Environment
OS: linux
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: