scy,
@scy@chaos.social avatar

For reasons that I don’t want to get into right now, I have an application that provides #Prometheus metrics. But not via an HTTP /metrics endpoint, but instead by streaming Prom’s text-based format over a serial port. The stream is endless, metrics are sent in random order. Their values update infrequently by simply appearing a second time in the stream, with the new value.

Is there already an utility that can consume such a stream and provide a normal /metrics HTTP endpoint?

scy,
@scy@chaos.social avatar

Okay, there is now.

It's a pretty dirty hack, but it works, and once I find the time to clean it up a little I might even release it.

Why did I need it in the first place? To get some sensor readings off of an #MicroPython board. I wrote classes that can output #Prometheus text to serve via HTTP, but then found out that running BLE & Wi-Fi simultaneously is a fickle bitch, so I had to pivot to, erm, USB UART and simply gave Gauge.update() a print(str(self)). 🤷‍♂️

Whatever, it works, okay?

scy,
@scy@chaos.social avatar

When you're writing code to make sure your 100 liter water tank and plumbing in your fucking van don't explode tonight, some clean code aspirations become secondary.

paule,
@paule@chaos.social avatar

@scy dafuck?! 🤯

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines