kuskoman / logstash-exporter

Prometheus exporter for Logstash written in Go
MIT License
63 stars 24 forks source link

node stats: support infinity #373

Closed fbs closed 1 month ago

fbs commented 1 month ago

These values are often float64 but sometimes a string, from the api docs1:

An "Infinity" value for a given flow window indicates that worker millis have been spent without any events completing processing

This adds a custom float64 type to enable the use of a custom marshaller.

fixes: #372

kuskoman commented 1 month ago

@fbs would you mind adding a test to the new type that you created?

fbs commented 1 month ago

Still need to update the tests, will work on that.

Guess I also need to target v2/master with this PR, what is the process for that? Shall I open a 2nd PR after this lands?

edit: you're too fast @kuskoman :D

kuskoman commented 1 month ago

v2 is way less urgent i will create test suite with e2e for it when the weekend starts

fbs commented 1 month ago

I pushed a fix so the tests pass, but let me figure out how to test the infinity values as well

fbs commented 1 month ago

done