Skip to content

Add task/waiting/time metric#18735

Merged
jtuglu1 merged 2 commits into
apache:masterfrom
jtuglu1:add-task-queue-waiting-time-metric
Nov 11, 2025
Merged

Add task/waiting/time metric#18735
jtuglu1 merged 2 commits into
apache:masterfrom
jtuglu1:add-task-queue-waiting-time-metric

Conversation

@jtuglu1

@jtuglu1 jtuglu1 commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

Description

Adds a metric task/waiting/time which measures the time it takes for a task to be placed onto the task runner for scheduling+running. This time encompasses initial persistent storage insertion, lock acquisition time, any task queue-related latencies, noisy-neighbor-related slowness, and any other delays between when a task is first added and when it is scheduled for running on the task runner. Useful for debugging issues related to task startup.

task/run/time ~= task/waiting/time + task/pending/time + <task run time> .

This codepath is called in a hot-loop but emission is non-blocking so this should be alright. Manual testing indicates no material increase in overhead.

Release note

Add task/waiting/time metric.


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@kfaraz kfaraz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor docs suggestions, otherwise looks good.
Thanks for adding the metric, @jtuglu1 !

Comment thread indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java Outdated
Comment thread docs/operations/metrics.md Outdated
Comment thread docs/operations/metrics.md Outdated
@jtuglu1
jtuglu1 requested a review from kfaraz November 11, 2025 06:42
@jtuglu1
jtuglu1 merged commit db2b81e into apache:master Nov 11, 2025
103 of 104 checks passed
@kgyrtkirk kgyrtkirk added this to the 36.0.0 milestone Jan 19, 2026
riovic918data pushed a commit to riovic918data/druid that referenced this pull request Jun 12, 2026
Adds a metric `task/waiting/time` that measures the time it takes for a task to be placed onto the task runner for scheduling+running. This time encompasses initial persistent storage insertion, lock acquisition time, any task queue-related latencies, noisy-neighbor-related slowness, and any other delays between when a task is first added and when it is scheduled for running on the task runner. Useful for debugging issues related to task startup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants