misusing Prometheus for IoT sensors?

911 views
Skip to first unread message

The Alchemist

unread,
Jul 11, 2018, 1:24:03 PM7/11/18
to Prometheus Users

Hi everyone!


We're using Prometheus for logging CPU/memory/disk usage of our servers, and Prometheus (and the metric library APIs) work great.

However, we wanted to store IoT sensor readings in Prometheus too. Things like voltage, temperature, humidity, etc.  come in once a second to our HTTP gateway.  Prometheus' data model is great, but we've bumped into a few issues.  A picture is worth a thousand words:


  • we had to use the pushgateway because of prometheus' focus on pulling/scraping, but the pushgateway has no TTL, so it just keeps reporting the same value for all metrics
    • that's inaccurate for us, because we wanna know when sensors stop reporting
Some potential solutions/workarounds?
  • forking the pushgateway to delete all metrics after a scrape (or wrapping it with another service)
  • don't use the pushgateway; use an expiring map like one from the Guava library that expires metrics after the scrape interval, and expose that map as a metrics endpoint
Maybe we're barking up the wrong tree, and Prometheus is the wrong tool for this job?

Thank you for everyone's time, and any feedback is greatly appreciated. :)

Cody Boggs

unread,
Jul 18, 2018, 5:03:24 PM7/18/18
to The Alchemist, Prometheus Users
You might be able to make do with the black box exporter, but I'll admit that I've never used it and I'm not sure exactly how extensible it is.

The general approach you would need here, though, is to ship your IoT sensor readings to something that will expose them to Prometheus as needed. Basically boils down to a "purpose-built push gateway," I think. Prometheus will likely be a very helpful tool for you once the data's in it, but getting it there in a rather bespoke manner might take some doing. :-)

Cody Boggs | Yak Shaver (Ops)

FreshTracks.io

Intelligent Alerting for Kubernetes and Prometheus


--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f28fae79-123b-4304-9f73-e72034fecbe5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages