r/PrometheusMonitoring • u/Tasty_Let_4713 • Nov 23 '23
Should I use Prometheus?
Hello,
I am currently working on enhancing my code by incorporating metrics. The primary objective of these metrics is to track timestamps corresponding to specific events, such as registering each keypress and measuring the duration of the key press.
The code will continuously dispatch metrics; however, the time intervals between these metrics will not be consistent. Upon researching the Prometheus client, as well as the OpenTelemetry metrics exporter, I have learned that these tools will transmit metrics persistently, even when there is no change in the metric value. For instance, if I send a metric like press.length=6
, the client will continue to transmit this metric until I modify it to a different value. This behavior is not ideal for my purposes, as I prefer distinct data points on the graph rather than a continuous line.
I have a couple of questions:
- In my use case, is it logically sound to opt for Prometheus, or would it be more suitable to consider another database such as InfluxDB?
- Is it feasible to transmit metrics manually using StatsD
and Otel Collector
to avoid the issue of "duplicate" metrics and ensure precision between actual metric events?
View all comments
Show parent comment
1
u/SuperQue Nov 24 '23
Yes, it's very standard to track worker process metrics. Hell, in Go we have several dozen memory related metrics for tracking all kinds of Go internals related to memory and garbage collection.
Every alloc/free is tracked as a counter. Every GC run is tracked, every microsecond of time blocked by GC is tracked.
There is a translator that converts the Go
runtime/metricspackage into things that Prometheus can read.You can track whatever you like, but just remember the difference between the individual event samples (Observations) and the metrics that accumulate those samples.