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

feat: add operator build_info metrics and go runtime metrics #6044

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

dongjiang1989
Copy link
Contributor

What type of PR is this?

/kind feature
What this PR does / why we need it:
More metrics info for prometheus and pod hpa

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

add operator build_info metrics and go runtime metrics

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 14, 2025
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 14, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 50 lines in your changes missing coverage. Please review.

Project coverage is 48.29%. Comparing base (43f2953) to head (d7fd1fd).
Report is 16 commits behind head on master.

Files with missing lines Patch % Lines
operator/cmd/operator/app/operator.go 0.00% 27 Missing ⚠️
pkg/version/version.go 0.00% 23 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6044      +/-   ##
==========================================
- Coverage   48.36%   48.29%   -0.07%     
==========================================
  Files         666      666              
  Lines       54831    54908      +77     
==========================================
- Hits        26519    26518       -1     
- Misses      26594    26666      +72     
- Partials     1718     1724       +6     
Flag Coverage Δ
unittests 48.29% <0.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: dongjiang <[email protected]>
@RainbowMango
Copy link
Member

Thanks @dongjiang1989, can you help to explain why these metrics are necessary for you?
Also, can you give a list of metrics ?

@dongjiang1989
Copy link
Contributor Author

dongjiang1989 commented Jan 14, 2025

Thanks @dongjiang1989, can you help to explain why these metrics are necessary for you? Also, can you give a list of metrics ?

Thanks @RainbowMango
When inappropriate GOGC, GOMAXPROCS and GOMEMLIMIT are set in the container, it will cause varying degrees of abnormalities in go's scheduling, memory usage, GC and distributed lock time.
Therefore, multiple golang runtime metrics are needed for further monitoring and alarming.

build_info for image upgrade monitoring.

Core Metrics list:

# HELP karmada_operator_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which karmada_operator was built, and the goos and goarch for the build.
# TYPE karmada_operator_build_info gauge
karmada_operator_build_info{branch="",goarch="amd64",goos="darwin",goversion="go1.23.3",revision="851c785640e5d66b653f31d5a5ece7f7288116c8-modified",tags="unknown",version=""} 1
# HELP go_sync_mutex_wait_total_seconds_total Approximate cumulative time goroutines have spent blocked on a sync.Mutex, sync.RWMutex, or runtime-internal lock. This metric is useful for identifying global changes in lock contention. Collect a mutex or block profile using the runtime/pprof package for more detailed contention data.
# TYPE go_sync_mutex_wait_total_seconds_total counter
go_sync_mutex_wait_total_seconds_total 0.000339344
# HELP go_sched_gomaxprocs_threads The current runtime.GOMAXPROCS setting, or the number of operating system threads that can execute user-level Go code simultaneously.
# TYPE go_sched_gomaxprocs_threads gauge
go_sched_gomaxprocs_threads 8
# HELP go_sched_goroutines_goroutines Count of live goroutines.
# TYPE go_sched_goroutines_goroutines gauge
go_sched_goroutines_goroutines 19
# HELP go_sched_latencies_seconds Distribution of the time goroutines have spent in the scheduler in a runnable state before actually running. Bucket counts increase monotonically.
# TYPE go_sched_latencies_seconds histogram
go_sched_latencies_seconds_bucket{le="6.399999999999999e-08"} 25
go_sched_latencies_seconds_bucket{le="6.399999999999999e-07"} 27
go_sched_latencies_seconds_bucket{le="7.167999999999999e-06"} 41
go_sched_latencies_seconds_bucket{le="8.191999999999999e-05"} 51
go_sched_latencies_seconds_bucket{le="0.0009175039999999999"} 52
go_sched_latencies_seconds_bucket{le="0.010485759999999998"} 52
go_sched_latencies_seconds_bucket{le="0.11744051199999998"} 52
go_sched_latencies_seconds_bucket{le="+Inf"} 52
go_sched_latencies_seconds_sum 0.000162688
go_sched_latencies_seconds_count 52

@RainbowMango
Copy link
Member

Thanks for the clarification. I will take a look and get back to you.

@RainbowMango
Copy link
Member

By the way, are you building some services based on Karmada?

@dongjiang1989
Copy link
Contributor Author

By the way, are you building some services based on Karmada?

Yes. Like: Model hub and Cloud platform.
I am willing to continue to contribute to karmada. 😄

@RainbowMango
Copy link
Member

Is it possible to introduce your platform on the Karmada community meeting?

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/assign

@dongjiang1989
Copy link
Contributor Author

Is it possible to introduce your platform on the Karmada community meeting?

Very willing to share it.

@RainbowMango
Copy link
Member

That would be great!
Note that, the latest English Meeting will be on 2025-01-21, Chinese Meeting will at 2025-02-11.
Feel free to add an agenda to the Meeting Notes.

operator/cmd/operator/app/operator.go Outdated Show resolved Hide resolved
operator/cmd/operator/app/operator.go Outdated Show resolved Hide resolved
operator/cmd/operator/app/operator.go Outdated Show resolved Hide resolved
Signed-off-by: dongjiang <[email protected]>
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from rainbowmango. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: dongjiang <[email protected]>
@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 16, 2025
@dongjiang1989
Copy link
Contributor Author

That would be great! Note that, the latest English Meeting will be on 2025-01-21, Chinese Meeting will at 2025-02-11. Feel free to add an agenda to the Meeting Notes.

@RainbowMango I don't have editing permissions. Maybe can share it at 2025-02-11.

@RainbowMango
Copy link
Member

Echo from the notes from meeting notes:

Please know:
By joining the google groups you will be able to edit the meeting notes.
Join google group mailing list: https://groups.google.com/forum/#!forum/karmada

Please join the mail group and all members from the mail group can edit this doc.

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

Given we already have some metrics related to gc, goroutine, like:

# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 3.0146e-05
go_gc_duration_seconds{quantile="0.25"} 4.6354e-05
go_gc_duration_seconds{quantile="0.5"} 5.3922e-05
go_gc_duration_seconds{quantile="0.75"} 0.000103302
go_gc_duration_seconds{quantile="1"} 0.000227208
go_gc_duration_seconds_sum 0.001537905
go_gc_duration_seconds_count 18
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge
go_goroutines 43
# HELP go_info Information about the Go environment.
# TYPE go_info gauge
go_info{version="go1.22.9"} 1
# HELP go_memstats_alloc_bytes Number of bytes allocated and still in use.
# TYPE go_memstats_alloc_bytes gauge
go_memstats_alloc_bytes 6.101576e+06

I wound like to understand the list of metrics introduced or removed by this PR and the reason behind these changes.
Additionally, If this change is accepted, my intension is to extend these metrics to all other components, not just the karmada-operator.

PS: Here is the full list metrics grabbed from v1.12.2:

Click Me to Show the List

HELP certwatcher_read_certificate_errors_total Total number of certificate read errors

TYPE certwatcher_read_certificate_errors_total counter

certwatcher_read_certificate_errors_total 0

HELP certwatcher_read_certificate_total Total number of certificate reads

TYPE certwatcher_read_certificate_total counter

certwatcher_read_certificate_total 0

HELP controller_runtime_active_workers Number of currently used workers per controller

TYPE controller_runtime_active_workers gauge

controller_runtime_active_workers{controller="karmada-operator-controller"} 0

HELP controller_runtime_max_concurrent_reconciles Maximum number of concurrent reconciles per controller

TYPE controller_runtime_max_concurrent_reconciles gauge

controller_runtime_max_concurrent_reconciles{controller="karmada-operator-controller"} 5

HELP controller_runtime_reconcile_errors_total Total number of reconciliation errors per controller

TYPE controller_runtime_reconcile_errors_total counter

controller_runtime_reconcile_errors_total{controller="karmada-operator-controller"} 0

HELP controller_runtime_reconcile_panics_total Total number of reconciliation panics per controller

TYPE controller_runtime_reconcile_panics_total counter

controller_runtime_reconcile_panics_total{controller="karmada-operator-controller"} 0

HELP controller_runtime_reconcile_time_seconds Length of time per reconciliation per controller

TYPE controller_runtime_reconcile_time_seconds histogram

controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.005"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.01"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.025"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.05"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.1"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.15"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.2"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.25"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.3"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.35"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.4"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.45"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.5"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.6"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.7"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.8"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="0.9"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="1"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="1.25"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="1.5"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="1.75"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="2"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="2.5"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="3"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="3.5"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="4"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="4.5"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="5"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="6"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="7"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="8"} 0
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="9"} 1
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="10"} 1
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="15"} 1
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="20"} 1
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="25"} 1
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="30"} 1
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="40"} 1
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="50"} 1
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="60"} 1
controller_runtime_reconcile_time_seconds_bucket{controller="karmada-operator-controller",le="+Inf"} 1
controller_runtime_reconcile_time_seconds_sum{controller="karmada-operator-controller"} 8.374751902
controller_runtime_reconcile_time_seconds_count{controller="karmada-operator-controller"} 1

HELP controller_runtime_reconcile_total Total number of reconciliations per controller

TYPE controller_runtime_reconcile_total counter

controller_runtime_reconcile_total{controller="karmada-operator-controller",result="error"} 0
controller_runtime_reconcile_total{controller="karmada-operator-controller",result="requeue"} 0
controller_runtime_reconcile_total{controller="karmada-operator-controller",result="requeue_after"} 0
controller_runtime_reconcile_total{controller="karmada-operator-controller",result="success"} 1

HELP controller_runtime_terminal_reconcile_errors_total Total number of terminal reconciliation errors per controller

TYPE controller_runtime_terminal_reconcile_errors_total counter

controller_runtime_terminal_reconcile_errors_total{controller="karmada-operator-controller"} 0

HELP controller_runtime_webhook_panics_total Total number of webhook panics

TYPE controller_runtime_webhook_panics_total counter

controller_runtime_webhook_panics_total 0

HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.

TYPE go_gc_duration_seconds summary

go_gc_duration_seconds{quantile="0"} 3.0146e-05
go_gc_duration_seconds{quantile="0.25"} 4.6354e-05
go_gc_duration_seconds{quantile="0.5"} 5.3922e-05
go_gc_duration_seconds{quantile="0.75"} 0.000103302
go_gc_duration_seconds{quantile="1"} 0.000227208
go_gc_duration_seconds_sum 0.001537905
go_gc_duration_seconds_count 18

HELP go_goroutines Number of goroutines that currently exist.

TYPE go_goroutines gauge

go_goroutines 43

HELP go_info Information about the Go environment.

TYPE go_info gauge

go_info{version="go1.22.9"} 1

HELP go_memstats_alloc_bytes Number of bytes allocated and still in use.

TYPE go_memstats_alloc_bytes gauge

go_memstats_alloc_bytes 6.101576e+06

HELP go_memstats_alloc_bytes_total Total number of bytes allocated, even if freed.

TYPE go_memstats_alloc_bytes_total counter

go_memstats_alloc_bytes_total 5.3223024e+07

HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table.

TYPE go_memstats_buck_hash_sys_bytes gauge

go_memstats_buck_hash_sys_bytes 1.47988e+06

HELP go_memstats_frees_total Total number of frees.

TYPE go_memstats_frees_total counter

go_memstats_frees_total 362491

HELP go_memstats_gc_sys_bytes Number of bytes used for garbage collection system metadata.

TYPE go_memstats_gc_sys_bytes gauge

go_memstats_gc_sys_bytes 3.811048e+06

HELP go_memstats_heap_alloc_bytes Number of heap bytes allocated and still in use.

TYPE go_memstats_heap_alloc_bytes gauge

go_memstats_heap_alloc_bytes 6.101576e+06

HELP go_memstats_heap_idle_bytes Number of heap bytes waiting to be used.

TYPE go_memstats_heap_idle_bytes gauge

go_memstats_heap_idle_bytes 6.88128e+06

HELP go_memstats_heap_inuse_bytes Number of heap bytes that are in use.

TYPE go_memstats_heap_inuse_bytes gauge

go_memstats_heap_inuse_bytes 9.0112e+06

HELP go_memstats_heap_objects Number of allocated objects.

TYPE go_memstats_heap_objects gauge

go_memstats_heap_objects 47775

HELP go_memstats_heap_released_bytes Number of heap bytes released to OS.

TYPE go_memstats_heap_released_bytes gauge

go_memstats_heap_released_bytes 6.127616e+06

HELP go_memstats_heap_sys_bytes Number of heap bytes obtained from system.

TYPE go_memstats_heap_sys_bytes gauge

go_memstats_heap_sys_bytes 1.589248e+07

HELP go_memstats_last_gc_time_seconds Number of seconds since 1970 of last garbage collection.

TYPE go_memstats_last_gc_time_seconds gauge

go_memstats_last_gc_time_seconds 1.7373615791665132e+09

HELP go_memstats_lookups_total Total number of pointer lookups.

TYPE go_memstats_lookups_total counter

go_memstats_lookups_total 0

HELP go_memstats_mallocs_total Total number of mallocs.

TYPE go_memstats_mallocs_total counter

go_memstats_mallocs_total 410266

HELP go_memstats_mcache_inuse_bytes Number of bytes in use by mcache structures.

TYPE go_memstats_mcache_inuse_bytes gauge

go_memstats_mcache_inuse_bytes 4800

HELP go_memstats_mcache_sys_bytes Number of bytes used for mcache structures obtained from system.

TYPE go_memstats_mcache_sys_bytes gauge

go_memstats_mcache_sys_bytes 15600

HELP go_memstats_mspan_inuse_bytes Number of bytes in use by mspan structures.

TYPE go_memstats_mspan_inuse_bytes gauge

go_memstats_mspan_inuse_bytes 179840

HELP go_memstats_mspan_sys_bytes Number of bytes used for mspan structures obtained from system.

TYPE go_memstats_mspan_sys_bytes gauge

go_memstats_mspan_sys_bytes 228480

HELP go_memstats_next_gc_bytes Number of heap bytes when next garbage collection will take place.

TYPE go_memstats_next_gc_bytes gauge

go_memstats_next_gc_bytes 1.0777016e+07

HELP go_memstats_other_sys_bytes Number of bytes used for other system allocations.

TYPE go_memstats_other_sys_bytes gauge

go_memstats_other_sys_bytes 843752

HELP go_memstats_stack_inuse_bytes Number of bytes in use by the stack allocator.

TYPE go_memstats_stack_inuse_bytes gauge

go_memstats_stack_inuse_bytes 884736

HELP go_memstats_stack_sys_bytes Number of bytes obtained from system for stack allocator.

TYPE go_memstats_stack_sys_bytes gauge

go_memstats_stack_sys_bytes 884736

HELP go_memstats_sys_bytes Number of bytes obtained from system.

TYPE go_memstats_sys_bytes gauge

go_memstats_sys_bytes 2.3155976e+07

HELP go_threads Number of OS threads created.

TYPE go_threads gauge

go_threads 10

HELP leader_election_master_status Gauge of if the reporting system is master of the relevant lease, 0 indicates backup, 1 indicates master. 'name' is the string used to identify the lease. Please make sure to group by name.

TYPE leader_election_master_status gauge

leader_election_master_status{name="karmada-operator"} 1

HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.

TYPE process_cpu_seconds_total counter

process_cpu_seconds_total 2.51

HELP process_max_fds Maximum number of open file descriptors.

TYPE process_max_fds gauge

process_max_fds 1.048576e+06

HELP process_open_fds Number of open file descriptors.

TYPE process_open_fds gauge

process_open_fds 11

HELP process_resident_memory_bytes Resident memory size in bytes.

TYPE process_resident_memory_bytes gauge

process_resident_memory_bytes 4.9225728e+07

HELP process_start_time_seconds Start time of the process since unix epoch in seconds.

TYPE process_start_time_seconds gauge

process_start_time_seconds 1.73736126681e+09

HELP process_virtual_memory_bytes Virtual memory size in bytes.

TYPE process_virtual_memory_bytes gauge

process_virtual_memory_bytes 1.307947008e+09

HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes.

TYPE process_virtual_memory_max_bytes gauge

process_virtual_memory_max_bytes 1.8446744073709552e+19

HELP rest_client_requests_total Number of HTTP requests, partitioned by status code, method, and host.

TYPE rest_client_requests_total counter

rest_client_requests_total{code="200",host="10.96.0.1:443",method="GET"} 35
rest_client_requests_total{code="200",host="10.96.0.1:443",method="PUT"} 226
rest_client_requests_total{code="200",host="172.18.0.7:32574",method="GET"} 13
rest_client_requests_total{code="200",host="172.18.0.7:32574",method="PATCH"} 2
rest_client_requests_total{code="200",host="172.18.0.7:32574",method="PUT"} 8
rest_client_requests_total{code="201",host="10.96.0.1:443",method="POST"} 2
rest_client_requests_total{code="201",host="172.18.0.7:32574",method="POST"} 4
rest_client_requests_total{code="409",host="10.96.0.1:443",method="POST"} 17
rest_client_requests_total{code="409",host="172.18.0.7:32574",method="POST"} 26

HELP workqueue_adds_total Total number of adds handled by workqueue

TYPE workqueue_adds_total counter

workqueue_adds_total{controller="karmada-operator-controller",name="karmada-operator-controller"} 1

HELP workqueue_depth Current depth of workqueue

TYPE workqueue_depth gauge

workqueue_depth{controller="karmada-operator-controller",name="karmada-operator-controller"} 0

HELP workqueue_longest_running_processor_seconds How many seconds has the longest running processor for workqueue been running.

TYPE workqueue_longest_running_processor_seconds gauge

workqueue_longest_running_processor_seconds{controller="karmada-operator-controller",name="karmada-operator-controller"} 0

HELP workqueue_queue_duration_seconds How long in seconds an item stays in workqueue before being requested

TYPE workqueue_queue_duration_seconds histogram

workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="1e-08"} 0
workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="1e-07"} 0
workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="1e-06"} 0
workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="9.999999999999999e-06"} 0
workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="9.999999999999999e-05"} 1
workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="0.001"} 1
workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="0.01"} 1
workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="0.1"} 1
workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="1"} 1
workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="10"} 1
workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="100"} 1
workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="1000"} 1
workqueue_queue_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="+Inf"} 1
workqueue_queue_duration_seconds_sum{controller="karmada-operator-controller",name="karmada-operator-controller"} 1.3487e-05
workqueue_queue_duration_seconds_count{controller="karmada-operator-controller",name="karmada-operator-controller"} 1

HELP workqueue_retries_total Total number of retries handled by workqueue

TYPE workqueue_retries_total counter

workqueue_retries_total{controller="karmada-operator-controller",name="karmada-operator-controller"} 0

HELP workqueue_unfinished_work_seconds How many seconds of work has been done that is in progress and hasn't been observed by work_duration. Large values indicate stuck threads. One can deduce the number of stuck threads by observing the rate at which this increases.

TYPE workqueue_unfinished_work_seconds gauge

workqueue_unfinished_work_seconds{controller="karmada-operator-controller",name="karmada-operator-controller"} 0

HELP workqueue_work_duration_seconds How long in seconds processing an item from workqueue takes.

TYPE workqueue_work_duration_seconds histogram

workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="1e-08"} 0
workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="1e-07"} 0
workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="1e-06"} 0
workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="9.999999999999999e-06"} 0
workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="9.999999999999999e-05"} 0
workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="0.001"} 0
workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="0.01"} 0
workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="0.1"} 0
workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="1"} 0
workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="10"} 1
workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="100"} 1
workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="1000"} 1
workqueue_work_duration_seconds_bucket{controller="karmada-operator-controller",name="karmada-operator-controller",le="+Inf"} 1
workqueue_work_duration_seconds_sum{controller="karmada-operator-controller",name="karmada-operator-controller"} 8.374788526
workqueue_work_duration_seconds_count{controller="karmada-operator-controller",name="karmada-operator-controller"} 1

)

// Info contains versioning information.
type Info struct {
GitVersion string `json:"gitVersion"`
GitCommit string `json:"gitCommit"`
GitRevision string `json:"gitRevision"`
Copy link
Member

Choose a reason for hiding this comment

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

Is the GitRevision redundant with GitCommit?

Copy link
Contributor Author

@dongjiang1989 dongjiang1989 Jan 20, 2025

Choose a reason for hiding this comment

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

GitCommit for git commit ID from git rev-parse HEAD and GitRevision for commit short ID from git rev-parse --short HEAD. Short ID is more friendly to CTL version help info and prometheus metric tag value.

Comment on lines 122 to 125
collectors.MetricsGC,
collectors.MetricsScheduler,
collectors.MetricsMemory,
collectors.GoRuntimeMetricsRule{Matcher: regexp.MustCompile(`^/sync/.*`)},
Copy link
Member

Choose a reason for hiding this comment

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

I'm not familiar with these metrics either.
Could you add some simple comments indicating the purpose or usage of each metric?

Copy link
Contributor Author

@dongjiang1989 dongjiang1989 Jan 20, 2025

Choose a reason for hiding this comment

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

Thanks @chaosi-zju .
I got it.
Add comments for each metric.

Please re-check it.

BTW, I will extend these metrics to all other components.

Signed-off-by: dongjiang <[email protected]>
@RainbowMango
Copy link
Member

BTW, I will extend these metrics to all other components.

Hold on, we can postpone this until we make the final decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants