zalando / skipper

An HTTP router and reverse proxy for service composition, including use cases like Kubernetes Ingress
https://opensource.zalando.com/skipper/
Other
3.09k stars 350 forks source link

metrics: add start label for prometheus counters #3089

Closed AlexanderYastrebov closed 3 months ago

AlexanderYastrebov commented 4 months ago

Add start label to each counter with the value of counter creation timestamp as unix nanoseconds.

This enables OpenTelemetry cumulative temporality, see https://opentelemetry.io/docs/specs/otel/metrics/data-model/#temporality

Example:

~$ curl -s localhost:9911/metrics | grep host_count
 # HELP skipper_serve_host_count Total number of requests of serving a host.
 # TYPE skipper_serve_host_count counter
skipper_serve_host_count{code="200",host="bar_test",method="GET",start="1717066533598500794"} 1
skipper_serve_host_count{code="200",host="foo_test",method="GET",start="1717066538031805059"} 2

Fixes #3087

szuecs commented 4 months ago

:+1:

szuecs commented 4 months ago

:+1:

AlexanderYastrebov commented 3 months ago

:+1: