Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle UNDEFs #1

Open
imaginator opened this issue May 14, 2019 · 2 comments · May be fixed by #2
Open

Handle UNDEFs #1

imaginator opened this issue May 14, 2019 · 2 comments · May be fixed by #2

Comments

@imaginator
Copy link

This is exactly what I was looking for. Thanks.

Small issue: some of my values are UNDEF:

openhab2_metric_number{name="Hs110GlassCubeLight_Current"} 0.034 1557829413308
openhab2_metric_number{name="Hs110IndustrialLight_EnergyUsage"} 0.287 1557829413308
openhab2_metric_number{name="LocalSun_EveningNightDuration"} UNDEF 1557829413308
openhab2_metric_number{name="Hs110Fridge_Rssi"} -41 1557829413308
openhab2_metric_number{name="XiaomiImagiSuck_ConsumablesMainBrushTime"} 258.0 1557829413308
openhab2_metric_number{name="ChromecastMiniMainbath_EpisodeNumber"} UNDEF 1557829413308
openhab2_metric_number{name="LocalSun_PositionElevation"} 54.990202533513 1557829413308
openhab2_metric_number{name="LocalSun_NoonDuration"} 1 1557829413308

Which leads to this:

May 14 10:23:33 bunker prometheus[14105]: level=warn ts=2019-05-14T10:23:33.665419592Z caller=scrape.go:686 component="scrape manager" scrape_pool=openhab target=http://bunker.imagilan:9997/metrics msg="append failed" err="strconv.ParseFloat: parsing \"UNDEF\": invalid syntax"
imaginator added a commit to imaginator/openhab2-prometheus-exporter that referenced this issue May 14, 2019
@imaginator imaginator linked a pull request May 14, 2019 that will close this issue
@gersilex
Copy link

Hmm yes. UNDEF is basically hard to display. What would be the right thing to do with the metric when it’s not defined? Simply leaving it out of the output is my first thought about this. Pretty sure that using a pre-defined number would be wrong.

@imaginator
Copy link
Author

imaginator commented May 14, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants