Skip to content

Conversation

@simonpasquier
Copy link
Contributor

@simonpasquier simonpasquier commented Aug 5, 2025

Description

This commit adds the following metrics on controller's workqueues:

  • prometheus_operator_workqueue_depth
  • prometheus_operator_workqueue_adds_total
  • prometheus_operator_workqueue_latency_seconds_bucket
  • prometheus_operator_workqueue_latency_seconds_count
  • prometheus_operator_workqueue_latency_seconds_sum
  • prometheus_operator_workqueue_work_duration_seconds_bucket
  • prometheus_operator_workqueue_work_duration_seconds_count
  • prometheus_operator_workqueue_work_duration_seconds_sum
  • prometheus_operator_workqueue_unfinished_work_seconds
  • prometheus_operator_workqueue_longest_running_processor_seconds
  • prometheus_operator_workqueue_retries_total

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.


This commit adds the following metrics on controller's workqueues:
* prometheus_operator_workqueue_depth
* prometheus_operator_workqueue_adds_total
* prometheus_operator_workqueue_latency_seconds_bucket
* prometheus_operator_workqueue_latency_seconds_count
* prometheus_operator_workqueue_latency_seconds_sum
* prometheus_operator_workqueue_work_duration_seconds_bucket
* prometheus_operator_workqueue_work_duration_seconds_count
* prometheus_operator_workqueue_work_duration_seconds_sum
* prometheus_operator_workqueue_unfinished_work_seconds
* prometheus_operator_workqueue_longest_running_processor_seconds
* prometheus_operator_workqueue_retries_total

Signed-off-by: Simon Pasquier <[email protected]>
@simonpasquier simonpasquier requested a review from a team as a code owner August 5, 2025 14:37
Name: "prometheus_operator_workqueue_depth",
Help: "Depth of the queue",
},
[]string{"name"},
Copy link
Contributor

Choose a reason for hiding this comment

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

could we include controller_type also?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's already included because the registerer injects the controller label.

# HELP prometheus_operator_workqueue_unfinished_work_seconds How many seconds has been spent by processing work which is not yet finished. A growing number indicates a stuck thread.
# TYPE prometheus_operator_workqueue_unfinished_work_seconds gauge                                                                                                                            
prometheus_operator_workqueue_unfinished_work_seconds{controller="alertmanager",name="alertmanager"} 0              
prometheus_operator_workqueue_unfinished_work_seconds{controller="alertmanager",name="alertmanager_status"} 0
prometheus_operator_workqueue_unfinished_work_seconds{controller="prometheus",name="prometheus"} 0                         
prometheus_operator_workqueue_unfinished_work_seconds{controller="prometheus",name="prometheus_status"} 0                  
prometheus_operator_workqueue_unfinished_work_seconds{controller="prometheus-agent",name="prometheusagent"} 0            
prometheus_operator_workqueue_unfinished_work_seconds{controller="prometheus-agent",name="prometheusagent_status"} 0     
prometheus_operator_workqueue_unfinished_work_seconds{controller="thanos",name="thanosruler"} 0                           
prometheus_operator_workqueue_unfinished_work_seconds{controller="thanos",name="thanosruler_status"} 0                      

@simonpasquier simonpasquier merged commit d7f481b into prometheus-operator:main Aug 6, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants