Repository navigation
Enhance streaming ingestion metrics - #13331
Merged
kfaraz merged 3 commits intoNov 9, 2022
Merged
Conversation
gianm
reviewed
Nov 9, 2022
| emitter.emit( | ||
| ServiceMetricEvent.builder() | ||
| .setDimension(DruidMetrics.DATASOURCE, dataSource) | ||
| .setDimension(DruidMetrics.PARTITION, entry.getKey()) |
Contributor
There was a problem hiding this comment.
Shall we add stream too? (And to all the existing metrics too?)
Contributor
Author
There was a problem hiding this comment.
Yes, I'll make the change
| { | ||
| final ServiceMetricEvent.Builder metricBuilder = ServiceMetricEvent.builder(); | ||
| IndexTaskUtils.setTaskDimensions(metricBuilder, task); | ||
| metricBuilder.setDimension(DruidMetrics.TASK_ACTION_TYPE, taskAction.getClass().getName()); |
Contributor
There was a problem hiding this comment.
I raised a PR here with an alternate approach, using ObjectMapper to get the JSON type instead of using the Java class name: #13333. IMO, the JSON type is better since it's more stable (it's part of the API). Thoughts?
Contributor
Author
There was a problem hiding this comment.
Thanks, I wasn't aware of it. I'll revert these changes
Contributor
There was a problem hiding this comment.
I just raised it now, so it's understandable you weren't aware of it!
AmatyaAvadhanula
marked this pull request as ready for review
November 9, 2022 06:53
gianm
reviewed
Nov 9, 2022
| "ingest/kafka/lag" : { "dimensions" : ["dataSource", "stream"], "type" : "gauge", "help": "Total lag between the offsets consumed by the Kafka indexing tasks and latest offsets in Kafka brokers across all partitions. Minimum emission period for this metric is a minute."}, | ||
| "ingest/kafka/maxLag" : { "dimensions" : ["dataSource", "stream"], "type" : "gauge", "help": "Max lag between the offsets consumed by the Kafka indexing tasks and latest offsets in Kafka brokers across all partitions. Minimum emission period for this metric is a minute."}, | ||
| "ingest/kafka/avgLag" : { "dimensions" : ["dataSource", "stream"], "type" : "gauge", "help": "Average lag between the offsets consumed by the Kafka indexing tasks and latest offsets in Kafka brokers across all partitions. Minimum emission period for this metric is a minute."}, | ||
| "ingest/kafka/avgLag" : { "dimensions" : ["dataSource", "stream", "partition"], "type" : "gauge", "help": "Partition-wise lag between the offsets consumed by the Kafka indexing tasks and latest offsets in Kafka brokers. Minimum emission period for this metric is a minute."}, |
Contributor
Author
There was a problem hiding this comment.
Sorry. fixed
kfaraz
reviewed
Nov 9, 2022
Comment on lines
+4084
to
+4086
| // Don't emit metrics if the supervisor is suspended. Also, | ||
| // to emit metrics, the state must be in {healthy steady state, idle or UNHEALTHY_TASKS or UNHEALTHY_SUPERVISOR} | ||
| // (lag should still be available in the status report) |
Contributor
There was a problem hiding this comment.
Suggested change
| // Don't emit metrics if the supervisor is suspended. Also, | |
| // to emit metrics, the state must be in {healthy steady state, idle or UNHEALTHY_TASKS or UNHEALTHY_SUPERVISOR} | |
| // (lag should still be available in the status report) | |
| // Emit metrics only if the supervisor state is RUNNING, IDLE, UNHEALTHY_TASKS or UNHEALTHY_SUPERVISOR | |
| // (lag should still be available in the status report in other supervisor states) |
kfaraz
approved these changes
Nov 9, 2022
This was referenced Dec 18, 2022
riovic918data
pushed a commit
to riovic918data/druid
that referenced
this pull request
Jun 12, 2026
Changes:
- Add a metric for partition-wise kafka/kinesis lag for streaming ingestion.
- Emit lag metrics for streaming ingestion when supervisor is not suspended and state is in {RUNNING, IDLE, UNHEALTHY_TASKS, UNHEALTHY_SUPERVISOR}
- Document metrics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a metric for partition-wise kafka/kinesis lag for streaming ingestion.
Emit lag metrics for streaming ingestion when supervisor is not suspended and state is in {RUNNING, IDLE, UNHEALTHY_TASKS, UNHEALTHY_SUPERVISOR}
Document metrics
This PR has: