gatewayd-io / gatewayd

☁️ Cloud-native database gateway and framework for building data-driven applications ✨ Like API gateways, for databases ✨
https://gatewayd.io
GNU Affero General Public License v3.0
218 stars 17 forks source link

Add metric labels #612

Closed mostafa closed 4 days ago

mostafa commented 4 days ago

Ticket(s)

Closes #611.

Description

This PR adds labels to metrics to be populated with the config group and config block names.

Exposed Prometheus Metrics ```text # HELP gatewayd_bytes_received_from_client Number of bytes received from client # TYPE gatewayd_bytes_received_from_client summary gatewayd_bytes_received_from_client_sum{block="reads",group="default"} 1204 gatewayd_bytes_received_from_client_count{block="reads",group="default"} 11 gatewayd_bytes_received_from_client_sum{block="writes",group="default"} 5944 gatewayd_bytes_received_from_client_count{block="writes",group="default"} 46 # HELP gatewayd_bytes_received_from_server Number of bytes received from server # TYPE gatewayd_bytes_received_from_server summary gatewayd_bytes_received_from_server_sum{block="reads",group="default"} 1578 gatewayd_bytes_received_from_server_count{block="reads",group="default"} 8 gatewayd_bytes_received_from_server_sum{block="writes",group="default"} 12913 gatewayd_bytes_received_from_server_count{block="writes",group="default"} 33 # HELP gatewayd_bytes_sent_to_client Number of bytes sent to client # TYPE gatewayd_bytes_sent_to_client summary gatewayd_bytes_sent_to_client_sum{block="reads",group="default"} 1578 gatewayd_bytes_sent_to_client_count{block="reads",group="default"} 7 gatewayd_bytes_sent_to_client_sum{block="writes",group="default"} 12913 gatewayd_bytes_sent_to_client_count{block="writes",group="default"} 27 # HELP gatewayd_bytes_sent_to_server Number of bytes sent to server # TYPE gatewayd_bytes_sent_to_server summary gatewayd_bytes_sent_to_server_sum{block="reads",group="default"} 1188 gatewayd_bytes_sent_to_server_count{block="reads",group="default"} 8 gatewayd_bytes_sent_to_server_sum{block="writes",group="default"} 5888 gatewayd_bytes_sent_to_server_count{block="writes",group="default"} 33 # HELP gatewayd_client_connections Number of client connections # TYPE gatewayd_client_connections gauge gatewayd_client_connections{block="reads",group="default"} 1 gatewayd_client_connections{block="writes",group="default"} 1 # HELP gatewayd_plugin_hooks_executed_total Number of plugin hooks executed # TYPE gatewayd_plugin_hooks_executed_total counter gatewayd_plugin_hooks_executed_total 237 # HELP gatewayd_plugin_hooks_registered_total Number of plugin hooks registered # TYPE gatewayd_plugin_hooks_registered_total counter gatewayd_plugin_hooks_registered_total 0 # HELP gatewayd_plugins_loaded_total Number of plugins loaded # TYPE gatewayd_plugins_loaded_total counter gatewayd_plugins_loaded_total 0 # HELP gatewayd_proxied_connections Number of proxy connects # TYPE gatewayd_proxied_connections gauge gatewayd_proxied_connections{block="reads",group="default"} 1 gatewayd_proxied_connections{block="writes",group="default"} 1 # HELP gatewayd_proxy_health_checks_total Number of proxy health checks # TYPE gatewayd_proxy_health_checks_total counter gatewayd_proxy_health_checks_total{block="reads",group="default"} 2 gatewayd_proxy_health_checks_total{block="writes",group="default"} 2 # HELP gatewayd_proxy_passthroughs_to_client_total Number of successful proxy passthroughs from server to client # TYPE gatewayd_proxy_passthroughs_to_client_total counter gatewayd_proxy_passthroughs_to_client_total{block="reads",group="default"} 7 gatewayd_proxy_passthroughs_to_client_total{block="writes",group="default"} 27 # HELP gatewayd_proxy_passthroughs_to_server_total Number of successful proxy passthroughs from client to server # TYPE gatewayd_proxy_passthroughs_to_server_total counter gatewayd_proxy_passthroughs_to_server_total{block="reads",group="default"} 8 gatewayd_proxy_passthroughs_to_server_total{block="writes",group="default"} 33 # HELP gatewayd_server_connections Number of server connections # TYPE gatewayd_server_connections gauge gatewayd_server_connections{block="",group=""} -36 gatewayd_server_connections{block="reads",group="default"} 30 gatewayd_server_connections{block="writes",group="default"} 26 # HELP gatewayd_server_ticks_fired_total Total number of server ticks fired # TYPE gatewayd_server_ticks_fired_total counter gatewayd_server_ticks_fired_total 0 # HELP gatewayd_traffic_bytes Number of total bytes passed through GatewayD via client or server # TYPE gatewayd_traffic_bytes summary gatewayd_traffic_bytes_sum{block="reads",group="default"} 5548 gatewayd_traffic_bytes_count{block="reads",group="default"} 34 gatewayd_traffic_bytes_sum{block="writes",group="default"} 37658 gatewayd_traffic_bytes_count{block="writes",group="default"} 139 # HELP go_gc_duration_seconds A summary of the wall-time pause (stop-the-world) duration in garbage collection cycles. # TYPE go_gc_duration_seconds summary go_gc_duration_seconds{quantile="0"} 2.6703e-05 go_gc_duration_seconds{quantile="0.25"} 8.5377e-05 go_gc_duration_seconds{quantile="0.5"} 0.000243246 go_gc_duration_seconds{quantile="0.75"} 0.000292101 go_gc_duration_seconds{quantile="1"} 0.000323811 go_gc_duration_seconds_sum 0.001992085 go_gc_duration_seconds_count 10 # HELP go_gc_gogc_percent Heap size target percentage configured by the user, otherwise 100. This value is set by the GOGC environment variable, and the runtime/debug.SetGCPercent function. Sourced from /gc/gogc:percent # TYPE go_gc_gogc_percent gauge go_gc_gogc_percent 100 # HELP go_gc_gomemlimit_bytes Go runtime memory limit configured by the user, otherwise math.MaxInt64. This value is set by the GOMEMLIMIT environment variable, and the runtime/debug.SetMemoryLimit function. Sourced from /gc/gomemlimit:bytes # TYPE go_gc_gomemlimit_bytes gauge go_gc_gomemlimit_bytes 9.223372036854776e+18 # HELP go_goroutines Number of goroutines that currently exist. # TYPE go_goroutines gauge go_goroutines 38 # HELP go_info Information about the Go environment. # TYPE go_info gauge go_info{version="go1.23.1"} 1 # HELP go_memstats_alloc_bytes Number of bytes allocated in heap and currently in use. Equals to /memory/classes/heap/objects:bytes. # TYPE go_memstats_alloc_bytes gauge go_memstats_alloc_bytes 8.106104e+06 # HELP go_memstats_alloc_bytes_total Total number of bytes allocated in heap until now, even if released already. Equals to /gc/heap/allocs:bytes. # TYPE go_memstats_alloc_bytes_total counter go_memstats_alloc_bytes_total 3.2990824e+07 # HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table. Equals to /memory/classes/profiling/buckets:bytes. # TYPE go_memstats_buck_hash_sys_bytes gauge go_memstats_buck_hash_sys_bytes 6321 # HELP go_memstats_frees_total Total number of heap objects frees. Equals to /gc/heap/frees:objects + /gc/heap/tiny/allocs:objects. # TYPE go_memstats_frees_total counter go_memstats_frees_total 206104 # HELP go_memstats_gc_sys_bytes Number of bytes used for garbage collection system metadata. Equals to /memory/classes/metadata/other:bytes. # TYPE go_memstats_gc_sys_bytes gauge go_memstats_gc_sys_bytes 3.446832e+06 # HELP go_memstats_heap_alloc_bytes Number of heap bytes allocated and currently in use, same as go_memstats_alloc_bytes. Equals to /memory/classes/heap/objects:bytes. # TYPE go_memstats_heap_alloc_bytes gauge go_memstats_heap_alloc_bytes 8.106104e+06 # HELP go_memstats_heap_idle_bytes Number of heap bytes waiting to be used. Equals to /memory/classes/heap/released:bytes + /memory/classes/heap/free:bytes. # TYPE go_memstats_heap_idle_bytes gauge go_memstats_heap_idle_bytes 8.429568e+06 # HELP go_memstats_heap_inuse_bytes Number of heap bytes that are in use. Equals to /memory/classes/heap/objects:bytes + /memory/classes/heap/unused:bytes # TYPE go_memstats_heap_inuse_bytes gauge go_memstats_heap_inuse_bytes 1.1444224e+07 # HELP go_memstats_heap_objects Number of currently allocated objects. Equals to /gc/heap/objects:objects. # TYPE go_memstats_heap_objects gauge go_memstats_heap_objects 15094 # HELP go_memstats_heap_released_bytes Number of heap bytes released to OS. Equals to /memory/classes/heap/released:bytes. # TYPE go_memstats_heap_released_bytes gauge go_memstats_heap_released_bytes 3.915776e+06 # HELP go_memstats_heap_sys_bytes Number of heap bytes obtained from system. Equals to /memory/classes/heap/objects:bytes + /memory/classes/heap/unused:bytes + /memory/classes/heap/released:bytes + /memory/classes/heap/free:bytes. # TYPE go_memstats_heap_sys_bytes gauge go_memstats_heap_sys_bytes 1.9873792e+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.7278142067925987e+09 # HELP go_memstats_mallocs_total Total number of heap objects allocated, both live and gc-ed. Semantically a counter version for go_memstats_heap_objects gauge. Equals to /gc/heap/allocs:objects + /gc/heap/tiny/allocs:objects. # TYPE go_memstats_mallocs_total counter go_memstats_mallocs_total 221198 # HELP go_memstats_mcache_inuse_bytes Number of bytes in use by mcache structures. Equals to /memory/classes/metadata/mcache/inuse:bytes. # TYPE go_memstats_mcache_inuse_bytes gauge go_memstats_mcache_inuse_bytes 19200 # HELP go_memstats_mcache_sys_bytes Number of bytes used for mcache structures obtained from system. Equals to /memory/classes/metadata/mcache/inuse:bytes + /memory/classes/metadata/mcache/free:bytes. # TYPE go_memstats_mcache_sys_bytes gauge go_memstats_mcache_sys_bytes 31200 # HELP go_memstats_mspan_inuse_bytes Number of bytes in use by mspan structures. Equals to /memory/classes/metadata/mspan/inuse:bytes. # TYPE go_memstats_mspan_inuse_bytes gauge go_memstats_mspan_inuse_bytes 183840 # HELP go_memstats_mspan_sys_bytes Number of bytes used for mspan structures obtained from system. Equals to /memory/classes/metadata/mspan/inuse:bytes + /memory/classes/metadata/mspan/free:bytes. # 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. Equals to /gc/heap/goal:bytes. # TYPE go_memstats_next_gc_bytes gauge go_memstats_next_gc_bytes 1.4506984e+07 # HELP go_memstats_other_sys_bytes Number of bytes used for other system allocations. Equals to /memory/classes/other:bytes. # TYPE go_memstats_other_sys_bytes gauge go_memstats_other_sys_bytes 2.094287e+06 # HELP go_memstats_stack_inuse_bytes Number of bytes obtained from system for stack allocator in non-CGO environments. Equals to /memory/classes/heap/stacks:bytes. # TYPE go_memstats_stack_inuse_bytes gauge go_memstats_stack_inuse_bytes 1.015808e+06 # HELP go_memstats_stack_sys_bytes Number of bytes obtained from system for stack allocator. Equals to /memory/classes/heap/stacks:bytes + /memory/classes/os-stacks:bytes. # TYPE go_memstats_stack_sys_bytes gauge go_memstats_stack_sys_bytes 1.015808e+06 # HELP go_memstats_sys_bytes Number of bytes obtained from system. Equals to /memory/classes/total:byte. # TYPE go_memstats_sys_bytes gauge go_memstats_sys_bytes 2.669672e+07 # 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. Sourced from /sched/gomaxprocs:threads # TYPE go_sched_gomaxprocs_threads gauge go_sched_gomaxprocs_threads 16 # HELP go_threads Number of OS threads created. # TYPE go_threads gauge go_threads 16 # HELP process_cpu_seconds_total Total user and system CPU time spent in seconds. # TYPE process_cpu_seconds_total counter process_cpu_seconds_total 0.29 # HELP process_max_fds Maximum number of open file descriptors. # TYPE process_max_fds gauge process_max_fds 1.048576e+06 # HELP process_network_receive_bytes_total Number of bytes received by the process over the network. # TYPE process_network_receive_bytes_total counter process_network_receive_bytes_total 2.02998181e+08 # HELP process_network_transmit_bytes_total Number of bytes sent by the process over the network. # TYPE process_network_transmit_bytes_total counter process_network_transmit_bytes_total 2.05111159e+08 # HELP process_open_fds Number of open file descriptors. # TYPE process_open_fds gauge process_open_fds 34 # HELP process_resident_memory_bytes Resident memory size in bytes. # TYPE process_resident_memory_bytes gauge process_resident_memory_bytes 4.5420544e+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.72781407123e+09 # HELP process_virtual_memory_bytes Virtual memory size in bytes. # TYPE process_virtual_memory_bytes gauge process_virtual_memory_bytes 2.358419456e+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 promhttp_metric_handler_requests_in_flight Current number of scrapes being served. # TYPE promhttp_metric_handler_requests_in_flight gauge promhttp_metric_handler_requests_in_flight 1 # HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code. # TYPE promhttp_metric_handler_requests_total counter promhttp_metric_handler_requests_total{code="200"} 26 promhttp_metric_handler_requests_total{code="500"} 0 promhttp_metric_handler_requests_total{code="503"} 0 ```

Related PRs

N/A

Development Checklist

Legal Checklist

github-actions[bot] commented 4 days ago

Overview

Image reference ghcr.io/gatewayd-io/gatewayd:44667ca gatewaydio/gatewayd:latest
- digest a98414f892d3 c0d87a848696
- tag 44667ca latest
- provenance https://github.com/gatewayd-io/gatewayd/commit/9ec6b54128ee201dda68f8f4f839f0fb34d21c52
- vulnerabilities critical: 0 high: 0 medium: 0 low: 0 critical: 0 high: 0 medium: 0 low: 0
- platform linux/amd64 linux/amd64
- size 19 MB 17 MB (-2.3 MB)
- packages 136 132 (-4)
Base Image alpine:3
also known as:
3.20
3.20.3
latest
alpine:3.20
also known as:
3
3.20.3
latest
- vulnerabilities critical: 0 high: 0 medium: 0 low: 0 critical: 0 high: 0 medium: 0 low: 0
Packages and Vulnerabilities (5 package changes and 0 vulnerability changes) > * :heavy_minus_sign: 3 packages removed > * :infinity: 2 packages changed > * 127 packages unchanged
Changes for packages of type apk (3 changes)
Package Version
ghcr.io/gatewayd-io/gatewayd:44667ca
Version
gatewaydio/gatewayd:latest
:heavy_minus_sign: ca-certificates 20240705-r0
:heavy_minus_sign: openssl 3.3.2-r0
:heavy_minus_sign: pax-utils 1.3.7-r2
Changes for packages of type golang (2 changes)
Package Version
ghcr.io/gatewayd-io/gatewayd:44667ca
Version
gatewaydio/gatewayd:latest
:infinity: github.com/gatewayd-io/gatewayd (devel) 0.9.8
:infinity: stdlib go1.23.1 1.23.1