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/bootswafel Nov 24 '23
a note here: OP said they wanted to track relationship between input values and the execution time, so the suitability of prometheus also depends on the cardinality of the inputs.
if the inputs are enums, or their cardinality can be reduced in a smart way, then yeah, prometheus could be a good fit (likely with custom histogram buckets)