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

simple sptp<-> prometheus metrics gw #313

Closed
wants to merge 1 commit into from
Closed

Conversation

deathowl
Copy link
Member

@deathowl deathowl commented Nov 27, 2023

Json exporter is tedious
This is a simple sptp<-> prometheus metrics exporter sidecar
Test plan:

[root@foreman ~]# curl client-1:6942/metrics
# HELP ptp_sptp_gms_available_pct ptp.sptp.gms.available_pct
# TYPE ptp_sptp_gms_available_pct gauge
ptp_sptp_gms_available_pct 100
# HELP ptp_sptp_gms_total ptp.sptp.gms.total
# TYPE ptp_sptp_gms_total gauge
ptp_sptp_gms_total 2
# HELP ptp_sptp_portstats_rx_announce ptp.sptp.portstats.rx.announce
# TYPE ptp_sptp_portstats_rx_announce gauge
ptp_sptp_portstats_rx_announce 59988
# HELP ptp_sptp_portstats_rx_sync ptp.sptp.portstats.rx.sync
# TYPE ptp_sptp_portstats_rx_sync gauge
ptp_sptp_portstats_rx_sync 59988
# HELP ptp_sptp_portstats_tx_delay_req ptp.sptp.portstats.tx.delay_req
# TYPE ptp_sptp_portstats_tx_delay_req gauge
ptp_sptp_portstats_tx_delay_req 59988
# HELP ptp_sptp_tick_duration_ns ptp.sptp.tick_duration_ns
# TYPE ptp_sptp_tick_duration_ns gauge
ptp_sptp_tick_duration_ns 1.000706292e+09
# HELP sptp_process_cpu_pct_avg_60 sptp.process.cpu_pct.avg.60
# TYPE sptp_process_cpu_pct_avg_60 gauge
sptp_process_cpu_pct_avg_60 0
# HELP sptp_process_num_fds sptp.process.num_fds
# TYPE sptp_process_num_fds gauge
sptp_process_num_fds 10
# HELP sptp_process_num_threads sptp.process.num_threads
# TYPE sptp_process_num_threads gauge
sptp_process_num_threads 18
# HELP sptp_process_rss sptp.process.rss
# TYPE sptp_process_rss gauge
sptp_process_rss 3.0486528e+07
# HELP sptp_process_swap sptp.process.swap
# TYPE sptp_process_swap gauge
sptp_process_swap 0
# HELP sptp_process_uptime sptp.process.uptime
# TYPE sptp_process_uptime gauge
sptp_process_uptime 30000
# HELP sptp_process_vms sptp.process.vms
# TYPE sptp_process_vms gauge
sptp_process_vms 2.556514304e+09
# HELP sptp_runtime_cpu_cgo_calls sptp.runtime.cpu.cgo_calls
# TYPE sptp_runtime_cpu_cgo_calls gauge
sptp_runtime_cpu_cgo_calls 7
# HELP sptp_runtime_cpu_goroutines sptp.runtime.cpu.goroutines
# TYPE sptp_runtime_cpu_goroutines gauge
sptp_runtime_cpu_goroutines 8
# HELP sptp_runtime_gc_count_sum_60 sptp.runtime.gc.count.sum.60
# TYPE sptp_runtime_gc_count_sum_60 gauge
sptp_runtime_gc_count_sum_60 0
# HELP sptp_runtime_gc_pause_ns_sum_60 sptp.runtime.gc.pause_ns.sum.60
# TYPE sptp_runtime_gc_pause_ns_sum_60 gauge
sptp_runtime_gc_pause_ns_sum_60 0
# HELP sptp_runtime_lookups_sum_60 sptp.runtime.lookups.sum.60
# TYPE sptp_runtime_lookups_sum_60 gauge
sptp_runtime_lookups_sum_60 0
# HELP sptp_runtime_mem_alloc sptp.runtime.mem.alloc
# TYPE sptp_runtime_mem_alloc gauge
sptp_runtime_mem_alloc 2.156296e+06
# HELP sptp_runtime_mem_frees sptp.runtime.mem.frees
# TYPE sptp_runtime_mem_frees gauge
sptp_runtime_mem_frees 6.420503e+06
# HELP sptp_runtime_mem_frees_sum_60 sptp.runtime.mem.frees.sum.60
# TYPE sptp_runtime_mem_frees_sum_60 gauge
sptp_runtime_mem_frees_sum_60 1033
# HELP sptp_runtime_mem_gc_count sptp.runtime.mem.gc.count
# TYPE sptp_runtime_mem_gc_count gauge
sptp_runtime_mem_gc_count 249
# HELP sptp_runtime_mem_gc_last sptp.runtime.mem.gc.last
# TYPE sptp_runtime_mem_gc_last gauge
sptp_runtime_mem_gc_last 1.7011100326196572e+18
# HELP sptp_runtime_mem_gc_next sptp.runtime.mem.gc.next
# TYPE sptp_runtime_mem_gc_next gauge
sptp_runtime_mem_gc_next 4.194304e+06
# HELP sptp_runtime_mem_gc_pause sptp.runtime.mem.gc.pause
# TYPE sptp_runtime_mem_gc_pause gauge
sptp_runtime_mem_gc_pause 176443
# HELP sptp_runtime_mem_gc_pause_total sptp.runtime.mem.gc.pause_total
# TYPE sptp_runtime_mem_gc_pause_total gauge
sptp_runtime_mem_gc_pause_total 3.9480542e+07
# HELP sptp_runtime_mem_gc_sys sptp.runtime.mem.gc.sys
# TYPE sptp_runtime_mem_gc_sys gauge
sptp_runtime_mem_gc_sys 3.831808e+06
# HELP sptp_runtime_mem_heap_alloc sptp.runtime.mem.heap.alloc
# TYPE sptp_runtime_mem_heap_alloc gauge
sptp_runtime_mem_heap_alloc 2.156296e+06
# HELP sptp_runtime_mem_heap_idle sptp.runtime.mem.heap.idle
# TYPE sptp_runtime_mem_heap_idle gauge
sptp_runtime_mem_heap_idle 8.077312e+06
# HELP sptp_runtime_mem_heap_inuse sptp.runtime.mem.heap.inuse
# TYPE sptp_runtime_mem_heap_inuse gauge
sptp_runtime_mem_heap_inuse 3.293184e+06
# HELP sptp_runtime_mem_heap_objects sptp.runtime.mem.heap.objects
# TYPE sptp_runtime_mem_heap_objects gauge
sptp_runtime_mem_heap_objects 17297
# HELP sptp_runtime_mem_heap_released sptp.runtime.mem.heap.released
# TYPE sptp_runtime_mem_heap_released gauge
sptp_runtime_mem_heap_released 6.971392e+06
# HELP sptp_runtime_mem_heap_sys sptp.runtime.mem.heap.sys
# TYPE sptp_runtime_mem_heap_sys gauge
sptp_runtime_mem_heap_sys 1.1370496e+07
# HELP sptp_runtime_mem_lookups sptp.runtime.mem.lookups
# TYPE sptp_runtime_mem_lookups gauge
sptp_runtime_mem_lookups 0
# HELP sptp_runtime_mem_malloc sptp.runtime.mem.malloc
# TYPE sptp_runtime_mem_malloc gauge
sptp_runtime_mem_malloc 6.4378e+06
# HELP sptp_runtime_mem_mallocs_sum_60 sptp.runtime.mem.mallocs.sum.60
# TYPE sptp_runtime_mem_mallocs_sum_60 gauge
sptp_runtime_mem_mallocs_sum_60 12860
# HELP sptp_runtime_mem_othersys sptp.runtime.mem.othersys
# TYPE sptp_runtime_mem_othersys gauge
sptp_runtime_mem_othersys 2.316534e+06
# HELP sptp_runtime_mem_stack_inuse sptp.runtime.mem.stack.inuse
# TYPE sptp_runtime_mem_stack_inuse gauge
sptp_runtime_mem_stack_inuse 1.212416e+06
# HELP sptp_runtime_mem_stack_mcache_inuse sptp.runtime.mem.stack.mcache_inuse
# TYPE sptp_runtime_mem_stack_mcache_inuse gauge
sptp_runtime_mem_stack_mcache_inuse 62400
# HELP sptp_runtime_mem_stack_mcache_sys sptp.runtime.mem.stack.mcache_sys
# TYPE sptp_runtime_mem_stack_mcache_sys gauge
sptp_runtime_mem_stack_mcache_sys 62400
# HELP sptp_runtime_mem_stack_mspan_inuse sptp.runtime.mem.stack.mspan_inuse
# TYPE sptp_runtime_mem_stack_mspan_inuse gauge
sptp_runtime_mem_stack_mspan_inuse 223104
# HELP sptp_runtime_mem_stack_mspan_sys sptp.runtime.mem.stack.mspan_sys
# TYPE sptp_runtime_mem_stack_mspan_sys gauge
sptp_runtime_mem_stack_mspan_sys 277032
# HELP sptp_runtime_mem_stack_sys sptp.runtime.mem.stack.sys
# TYPE sptp_runtime_mem_stack_sys gauge
sptp_runtime_mem_stack_sys 1.212416e+06
# HELP sptp_runtime_mem_sys sptp.runtime.mem.sys
# TYPE sptp_runtime_mem_sys gauge
sptp_runtime_mem_sys 2.055092e+07
# HELP sptp_runtime_mem_total sptp.runtime.mem.total
# TYPE sptp_runtime_mem_total gauge
sptp_runtime_mem_total 4.56619056e+08
# HELP sptp_runtime_mem_total_alloc_sum_60 sptp.runtime.mem.total_alloc.sum.60
# TYPE sptp_runtime_mem_total_alloc_sum_60 gauge
sptp_runtime_mem_total_alloc_sum_60 12860

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 27, 2023
@facebook-github-bot
Copy link
Contributor

@deathowl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@deathowl merged this pull request in 4139d74.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants