New Add-on bundle for Prometheus health Metrics

@diyha you mentioned (Presence with Android after using Iphone) you would like to see some “stats” from your openHAB instance. I think this bundle will do the thing for you.
In detail:

  • what bindings are installed :white_check_mark:
  • what bindings were uninstalled after they were installed :white_check_mark: (you record the installed bundles over time in prometheus and look at them, can even issue PromQL queries to filter bundles for specific properties, e.g. changed from installed to uninstalled)
  • how many things a binding serves :x:(this is not directly implemented yet, but you will get a list of all things)
  • how many exceptions are thrown by a binding shortly after being installed (may indicate poor docs and poor parm descriptions) :white_check_mark: (the metrics bundle counts the number of log messages by level)
  • how many exceptions are thrown by a binding in a given time :white_check_mark: (see above)
  • how many exceptions are thrown by platform (may indicate popular platform issue) :white_check_mark: (see above and additionally the events per source are counted, this will also be revealing)
  • how often OH reboots :white_check_mark: not directly counted but can be inferred from resetting event counters
  • how often rule engine throws errors (may indicate poor rue language VM and tooling) :white_check_mark: (counted in the logs and event bus)
  • etc :white_check_mark: (number of inbox entries, bundle and thing state, thread/pool size and counts, jvm/process/memory insights)

Let me know if you have any questions, suggestions or feature requests or if the bundle helps you in any way.

1 Like

Thanks man! :+1:
Will definitely look into this.

Hello, is there potential/initiative to get this as a plugin in (some of) the store?
Would love to get statistics on what is openhab doing inside prometheus

Since this relies on so many external services I don’t see how this could be made into a binding or add-on. It could probably be added to openHABian though.

Setting this up is still on my todo list but I don’t have a lot of time to work on additions to my system these days. I’m fighting a bit of bit rot at the moment that is taking a lot of my time (RPi that controls my garage has gone wonky, Wunderground is shutting off it’s free API, etc).

Yes, there is an initiative to team up with Deutsche Telekom and get the metrics into Eclipse Smart Home core. But this may take a little while.
Meanwhile, following the instructions above and in the readme over at GitHub, it is already possible to use our bundle. Just drop the .jar files into your addons directory.
The bundle only relies on the prometheus library bundles, which you can download and also just drop into the directory, it is not relying on any external service!

Hello @friesenkiwi - is the working jar still available on your github? the link of your above is deceased - https://github.com/KuguHome/openhab-prometheus-metrics/releases/download/v0.9/com.kuguhome.openhab.prometheusmetrics-2.4.0-SNAPSHOT.1.jar

I would like to test and feeback on your really promising approach.

have a look at https://github.com/KuguHome/openhab-prometheus-metrics/releases/

2 Likes

I finally got it up & running :slight_smile: As it was kind of a challenge, I’m posting the complete instruction here:

To get this cool dashboard in Grafana you need to:

  1. Have a working Prometheus setup. (See https://prometheus.io/docs/prometheus/latest/getting_started/).

  2. Have a working Grafana setup. (See InfluxDB+Grafana persistence and graphing).

  3. Download http://central.maven.org/maven2/io/prometheus/simpleclient/0.4.0/simpleclient-0.4.0.jar and place it in the addons directory. Monitor the Openhab log file and wait until the jar has successfully registered in Openhab.

2018-12-15 03:15:44.636 [INFO ] [org.apache.felix.fileinstall        ] - Installing bundle io.prometheus.simpleclient / 0.4.0
2018-12-15 03:15:44.881 [INFO ] [org.apache.felix.fileinstall        ] - Started bundle: file:/usr/share/openhab2/addons/simpleclient-0.4.0.jar
  1. Download http://central.maven.org/maven2/io/prometheus/simpleclient_common/0.4.0/simpleclient_common-0.4.0.jar and place it in the addons directory. Monitor the Openhab log file and wait until the jar has successfully registered in Openhab.
2018-12-15 03:16:14.901 [INFO ] [org.apache.felix.fileinstall        ] - Installing bundle io.prometheus.simpleclient_common / 0.4.0
2018-12-15 03:16:15.296 [INFO ] [org.apache.felix.fileinstall        ] - Started bundle: file:/usr/share/openhab2/addons/simpleclient_common-0.4.0.jar
  1. Download http://repo1.maven.org/maven2/io/prometheus/simpleclient_hotspot/0.4.0/simpleclient_hotspot-0.4.0.jar and place it in the addons directory. Monitor the Openhab log file and wait until the jar has successfully registered in Openhab.
2018-12-15 03:17:56.501 [INFO ] [org.apache.felix.fileinstall        ] - Installing bundle io.prometheus.simpleclient_hotspot / 0.4.0
2018-12-15 03:17:56.613 [INFO ] [org.apache.felix.fileinstall        ] - Started bundle: file:/usr/share/openhab2/addons/simpleclient_hotspot-0.4.0.jar
  1. Download the latest jar from https://github.com/KuguHome/openhab-prometheus-metrics/releases/ and place it in the addons directory. Monitor the Openhab log file and wait until the jar has successfully registered in Openhab.
2018-12-15 03:18:27.292 [INFO ] [vice.internal.HttpServiceFactoryImpl] - Binding bundle: [com.kuguhome.openhab.prometheusmetrics_2.4.0.201808140810 [312]] to http service
2018-12-15 03:18:27.402 [INFO ] [rg.ops4j.pax.web.utils.ClassPathUtil] - Ignoring bundle scan for /META-INF/services javax.servlet.ServletContainerInitializer.
2018-12-15 03:18:27.407 [INFO ] [ce.jetty.internal.HttpServiceContext] - registering context DefaultHttpContext [bundle=com.kuguhome.openhab.prometheusmetrics_2.4.0.201808140810 [312], contextID=default], with context-name:
2018-12-15 03:18:27.419 [INFO ] [.jetty.server.handler.ContextHandler] - Started HttpServiceContext{httpContext=DefaultHttpContext [bundle=com.kuguhome.openhab.prometheusmetrics_2.4.0.201808140810 [312], contextID=default]}
2018-12-15 03:18:27.481 [INFO ] [org.apache.felix.fileinstall        ] - Started bundle: file:/usr/share/openhab2/addons/com.kuguhome.openhab.prometheusmetrics-2.4.0-SNAPSHOT.jar
  1. If loading of the bindings went ok, you should be able to open http://openhabserver:8080/rest/metrics/prometheus and you will see a page like https://github.com/KuguHome/openhab-prometheus-metrics/wiki/Example-scrape . If an error occured in the previous steps, you’ll see a 404 error.

  2. Now add a job in Prometheus. I installed it today so I’m by no means an expert. In prometheus.yaml, add the following under scrape_configs:

  - job_name: 'openhab_metrics'
    scrape_interval: 10s
    scheme: http
    metrics_path: /rest/metrics/prometheus
    static_configs:
    - targets:
      - 'openhabserver:8080'
  1. After a Prometheus service restart, you can browse to http://prometheusserver:9090/targets, and the scraper is up:
## [openhab_metrics (1/1 up)](http://prometheusserver:9090/targets#job-openhab_metrics)

|Endpoint|State|Labels|Last Scrape|Scrape Duration|Error
|http://openhabserver:8080/rest/metrics/prometheus|UP|instance="openhabserver:8080" job="openhab_metrics"|8.967s ago|78.19ms|
  1. Now download the Grafana dashboard from https://github.com/KuguHome/openhab-prometheus-metrics/wiki/Grafana-source and replace the data source “kugu-prometheus” to the correct data source. For me, it was just “Prometheus”.

  2. Import the dashboard in Grafana. Grafana shouldn’t complain about missing data sources.

I’m really impressed by the amount of insight you get when using this dashboard. Thanks, @friesenkiwi !

6 Likes

Great instructions.

Is anyone aware of a similar Prometheus exporter to scrape item values. It would be awesome to be able to expose values like power consumption or lumens or or water flow… to Prometheus’ calculation functions. I did see one approach that could work via exporting values first to MQTT.

https://github.com/hikhvar/mqtt2prometheus looks like it comes somewhat close but since Prometheus need to know whether each metric is a gauge or a counter it would require that each metric is individually configured.

You should be able to go via InfluxDB → Prometheus (InfluxDB Now Supports Prometheus Remote Read & Write Natively | InfluxData) or indeed the MQTT way.

Oh, wow I’m very sorry I didn’t reply in time, somehow I didn’t get or notice the forum mail notifications :frowning:

Thanks @ricadelic for the detailed instructions. Actually it should be no problem to place all the .jar files into the addons folder at the same time or at a random order. @mdnx the link https://github.com/KuguHome/openhab-prometheus-metrics/releases/ as @ricadelic posted it is the right place to look. The bundle is currently running in several field systems for us in beta state, development is somewhat paused but we are very interested in feedback!

@imaginator I am not aware of a similar approach for a direct item Prometheus exporter.From our point of view, the InfluxDB or any other persistence plugin would be the “correct” way to get the item values (going MQTT->Prometheus seems one step too much for me). We instead wanted to get values/metrics, which were (until now) hidden. Also, to our mind, Prometheus is more of a health metrics monitoring tool and less of a general value scraper. But you can certainly use it that way. It also shouldn’t be too much of a problem, to write an “Exposable” along the lines of https://github.com/KuguHome/openhab-prometheus-metrics/blob/master/com.kuguhome.openhab.prometheusmetrics/src/main/java/com/kuguhome/openhab/prometheusmetrics/exposable/OpenHABThingStateMetric.java which queries the item registry instead of the thing registry and outputs their values.
If it would be “switchable” within the bundle, we could include it, if you do a PR on GitHub.

I haven’t set this this up myself yet, but my understand is that Prometheus users Grafana as the display. So there shouldn’t be anything stopping you from adding graphs of stuff saved to InfluxDB through Persistence to the same Graphana dashboard.

Grafana can display all kinds of data sources, including MySQL, Prometheus or InfluxDB, you can mix them on the same board or even on the same graph.

My thinking on Prometheus is less about the graphing and more about the Prometheus query functions. I’d love to be able to detect water leaks by looking for sustained low values. Or predict energy consumption for the rest of the month. Or hook into the Prometheus alert manager … Or… :grinning:

That’s actually a nice idea. As I said, it should be pretty easy to implement.

…next level awesome would be the ability to include PromQL in rules.

If prometheus(sum(count_over_time(basement-humidity[60m])), then...
1 Like

Very interesting suggestion :+1::+1:

Does anyone having this working with 2.5.0 release?

I get this error message:

[WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/openhab/addons/com.kuguhome.openhab.prometheusmetrics-2.4.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: com.kuguhome.openhab.prometheusmetrics [207]
  Unresolved requirement: Import-Package: io.swagger.annotations; version="1.5.7.SNAPSHOT"

@gersilex just mentioned to me that https://github.com/baaym/openhab2-prometheus-exporter now exists. I’ve got it running and it seems to work for exporting openhab item values. One small issue with UNDEFs.

Here’s the output:

# TYPE openhab2_metric_number gauge
openhab2_metric_number{name="XiaomiImagiSuck_ConsumablesMainBrushPercent"} 86 1557828884718
openhab2_metric_number{name="LocalSun_RadiationDiffuse"} 123.95447796048198 1557828884718
openhab2_metric_number{name="Hs110Fridge_Current"} 0.031 1557828884718
openhab2_metric_number{name="Hs110WashingMachine_EnergyUsage"} 4.878 1557828884718
openhab2_metric_number{name="Hs110GlassCubeLight_Current"} 0.034 1557828884718
openhab2_metric_number{name="Hs110IndustrialLight_EnergyUsage"} 0.287 1557828884718
openhab2_metric_number{name="LocalSun_EveningNightDuration"} UNDEF 1557828884718
openhab2_metric_number{name="Hs110Fridge_Rssi"} -40 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_ConsumablesMainBrushTime"} 258.0 1557828884718
openhab2_metric_number{name="ChromecastMiniMainbath_EpisodeNumber"} UNDEF 1557828884718
openhab2_metric_number{name="LocalSun_PositionElevation"} 54.46863800193032 1557828884718
openhab2_metric_number{name="LocalSun_NoonDuration"} 1 1557828884718
openhab2_metric_number{name="LocalSun_RadiationDirect"} 580.4890535278574 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_CleaningLastCleanError"} 0 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_StatusCleanTime"} 6 1557828884718
openhab2_metric_number{name="Hs110IndustrialLight_Rssi"} -56 1557828884718
openhab2_metric_number{name="PingableNetworkDevice_Latency_simon"} UNDEF 1557828884718
openhab2_metric_number{name="Hs110IndustrialLight_Power"} 0.0 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_StatusMapPresent"} 1 1557828884718
openhab2_metric_number{name="Hs110GlassCubeLight_Power"} 0.0 1557828884718
openhab2_metric_number{name="Hs110WashingMachine_Voltage"} 237.603566 1557828884718
openhab2_metric_number{name="Hs110GlassCubeLight_Voltage"} 239.433 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_NetworkRssi"} -23 1557828884718
openhab2_metric_number{name="SpotifyPlayerBridge_TrackNumber"} 0 1557828884718
openhab2_metric_number{name="LocalSun_CivilDawnDuration"} 43 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_HistoryTotalCleanArea"} 13450.325 1557828884718
openhab2_metric_number{name="Hs110WashingMachine_Current"} 0.030592 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_ConsumablesSideBrushTime"} 158.0 1557828884718
openhab2_metric_number{name="ChromecastAudiogroupAll_SeasonNumber"} UNDEF 1557828884718
openhab2_metric_number{name="LocalSun_PositionAzimuth"} 158.01577425730804 1557828884718
openhab2_metric_number{name="Hs110Catgenie_Voltage"} 237.649138 1557828884718
openhab2_metric_number{name="ChromecastAudiogroupAll_EpisodeNumber"} UNDEF 1557828884718
openhab2_metric_number{name="LocalSun_DaylightDuration"} 932 1557828884718
openhab2_metric_number{name="Hs110GlassCubeLight_EnergyUsage"} 0.015 1557828884718
openhab2_metric_number{name="Hs110WashingMachine_Rssi"} -57 1557828884718
openhab2_metric_number{name="LocalSun_RiseDuration"} 4 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_HistoryTotalCleanCount"} 511 1557828884718
openhab2_metric_number{name="Hs110IndustrialLight_Current"} 0.034 1557828884718
openhab2_metric_number{name="Hs110Catgenie_Current"} 0.017069 1557828884718
openhab2_metric_number{name="SpotifyPlayerBridge_TrackDiscNumber"} 0 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_ActionsFan"} 60 1557828884718
openhab2_metric_number{name="LocalSun_AstroDawnDuration"} 95 1557828884718
openhab2_metric_number{name="LocalSun_SetDuration"} 4 1557828884718
openhab2_metric_number{name="Hs110IndustrialLight_Voltage"} 239.579 1557828884718
openhab2_metric_number{name="ChromecastUltraLounge_SeasonNumber"} UNDEF 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_ConsumablesSideBrushPercent"} 79 1557828884718
openhab2_metric_number{name="SpotifyPlayerBridge_TrackDurationMs"} 0 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_HistoryTotalCleanTime"} 16915 1557828884718
openhab2_metric_number{name="LocalSun_RadiationTotal"} 704.4435314883394 1557828884718
openhab2_metric_number{name="Hs110GlassCubeLight_Rssi"} -44 1557828884718
openhab2_metric_number{name="ChromecastMiniMainbath_TrackNumber"} UNDEF 1557828884718
openhab2_metric_number{name="Hs110Fridge_EnergyUsage"} 81.087 1557828884718
openhab2_metric_number{name="LocalSun_MorningNightDuration"} 113 1557828884718
openhab2_metric_number{name="Hs110WashingMachine_Power"} 0.0 1557828884718
openhab2_metric_number{name="Hs110Fridge_Power"} 0.0 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_CleaningLastCleanDuration"} 0 1557828884718
openhab2_metric_number{name="LocalSun_CivilDuskDuration"} 43 1557828884718
openhab2_metric_number{name="LocalSun_NauticDuskDuration"} 59 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_StatusInCleaning"} 0 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_ConsumablesSensorDirtTime"} 0.0 1557828884718
openhab2_metric_number{name="ChromecastMiniMainbath_SeasonNumber"} UNDEF 1557828884718
openhab2_metric_number{name="Hs110Catgenie_Power"} 1.653184 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_StatusCleanArea"} 2.9225 1557828884718
openhab2_metric_number{name="ChromecastUltraLounge_TrackNumber"} UNDEF 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_NetworkLife"} 30738 1557828884718
openhab2_metric_number{name="ChromecastAudiogroupAll_TrackNumber"} UNDEF 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_ConsumablesFilterPercent"} 34 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_StatusFanPower"} 60 1557828884718
openhab2_metric_number{name="LocalSun_AstroDuskDuration"} 95 1557828884718
openhab2_metric_number{name="Hs110Catgenie_Rssi"} -46 1557828884718
openhab2_metric_number{name="ChromecastMiniMainbath_DiscNumber"} UNDEF 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_ConsumablesFilterTime"} 51.0 1557828884718
openhab2_metric_number{name="ChromecastUltraLounge_EpisodeNumber"} UNDEF 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_StatusBattery"} 100 1557828884718
openhab2_metric_number{name="Hs110Catgenie_EnergyUsage"} 15.923 1557828884718
openhab2_metric_number{name="ChromecastUltraLounge_DiscNumber"} UNDEF 1557828884718
openhab2_metric_number{name="Tablet_Connected"} 1557828879096 1557828884718
openhab2_metric_number{name="SpotifyPlayerBridge_TrackProgressMs"} 0 1557828884718
openhab2_metric_number{name="Hs110Fridge_Voltage"} 238.068 1557828884718
openhab2_metric_number{name="Tablet_Battery_Level"} 100 1557828884718
openhab2_metric_number{name="LocalSun_NauticDawnDuration"} 59 1557828884718
openhab2_metric_number{name="LocalSun_NightDuration"} 99 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_CleaningLastCleanArea"} 0.0 1557828884718
openhab2_metric_number{name="ChromecastAudiogroupAll_DiscNumber"} UNDEF 1557828884718
openhab2_metric_number{name="XiaomiImagiSuck_ConsumablesSensorDirtPercent"} 0 1557828884718
openhab2_metric_number{name="Tablet_Brightness"} 38 1557828884718
# TYPE openhab2_metric_dimmer gauge
openhab2_metric_dimmer{name="DaylightCT"} 50.0 1557828884718
openhab2_metric_dimmer{name="PlexTVVolume"} 100 1557828884718
openhab2_metric_dimmer{name="SpotifyAllSpeakers_DeviceVolume"} 100 1557828884718
openhab2_metric_dimmer{name="Desklamp_ColorTemperature"} 50 1557828884718
openhab2_metric_dimmer{name="ChromecastAudiogroupAll_Volume"} 100 1557828884718
openhab2_metric_dimmer{name="LoungeOverhead_ColorTemperature"} 80 1557828884718
openhab2_metric_dimmer{name="ChromecastMiniMainbath_Volume"} 26 1557828884718
openhab2_metric_dimmer{name="KitchenOverhead_ColorTemperature"} 71 1557828884718
openhab2_metric_dimmer{name="SpotifyLoungeHifi_DeviceVolume"} 0 1557828884718
openhab2_metric_dimmer{name="SpotifyPlayerBridge_DeviceVolume"} UNDEF 1557828884718
openhab2_metric_dimmer{name="ChromecastUltraLounge_Volume"} 100 1557828884718
openhab2_metric_dimmer{name="ChromecastMiniLounge_Volume"} 30 1557828884718
openhab2_metric_dimmer{name="Dressingroom_ColorTemperature"} 63 1557828884718
openhab2_metric_dimmer{name="Dressingroom_Brightness"} 0 1557828884718
openhab2_metric_dimmer{name="PlexTVProgress"} 0 1557828884718
openhab2_metric_dimmer{name="SpotifyKitchenMini_DeviceVolume"} 100 1557828884718
openhab2_metric_dimmer{name="Desklamp_Brightness"} 0 1557828884718
# TYPE openhab2_metric_switch gauge
openhab2_metric_switch{name="ChromecastUltraLounge_Mute"} 0 1557828884718
openhab2_metric_switch{name="SpotifyLoungeHifi_DeviceShuffle"} 0 1557828884718
openhab2_metric_switch{name="Hs110Catgenie_Switch"} 1 1557828884718
openhab2_metric_switch{name="SpotifyKitchenMini_DeviceActive"} 0 1557828884718
openhab2_metric_switch{name="XiaomiImagiSuck_CleaningLastCleanFinish"} 0 1557828884718
openhab2_metric_switch{name="ChromecastAudiogroupAll_Idling"} 1 1557828884718
openhab2_metric_switch{name="EyeInTheSky_MotionAlarm"} 1 1557828884718
openhab2_metric_switch{name="SpotifyAllSpeakers_DeviceActive"} 0 1557828884718
openhab2_metric_switch{name="XiaomiImagiSuck_StatusDndEnabled"} 0 1557828884718
openhab2_metric_switch{name="EyeInTheSky_ExternalAlarmInput"} 0 1557828884718
openhab2_metric_switch{name="ChromecastAudiogroupAll_Mute"} 0 1557828884718
openhab2_metric_switch{name="SpotifyKitchenMini_DeviceShuffle"} 0 1557828884718
openhab2_metric_switch{name="Hs110IndustrialLight_Switch"} 0 1557828884718
openhab2_metric_switch{name="PlexTVStop"} 1 1557828884718
openhab2_metric_switch{name="Hs110WashingMachine_Switch"} 1 1557828884718
openhab2_metric_switch{name="SpotifyAllSpeakers_DeviceShuffle"} 0 1557828884718
openhab2_metric_switch{name="ChromecastUltraLounge_Idling"} 1 1557828884718
openhab2_metric_switch{name="SpotifyPlayerBridge_DeviceShuffle"} 0 1557828884718
openhab2_metric_switch{name="SpotifyKitchenMini_DeviceRestricted"} 1 1557828884718
openhab2_metric_switch{name="PlexTVPlay"} 0 1557828884718
openhab2_metric_switch{name="ChromecastMiniLounge_Mute"} 0 1557828884718
openhab2_metric_switch{name="ChromecastMiniLounge_Idling"} 1 1557828884718
openhab2_metric_switch{name="PingableNetworkDevice_Online_simon"} 0 1557828884718
openhab2_metric_switch{name="Hs110Fridge_Switch"} 1 1557828884718
openhab2_metric_switch{name="ChromecastMiniMainbath_Idling"} 1 1557828884718
openhab2_metric_switch{name="XiaomiImagiSuck_ActionsVacuum"} 0 1557828884718
openhab2_metric_switch{name="Hs110WashingMachine_Led"} 0 1557828884718
openhab2_metric_switch{name="ChromecastMiniMainbath_Mute"} 0 1557828884718
openhab2_metric_switch{name="Hs110Fridge_Led"} 1 1557828884718
openhab2_metric_switch{name="SpotifyAllSpeakers_DeviceRestricted"} 1 1557828884718
openhab2_metric_switch{name="SpotifyLoungeHifi_DeviceActive"} 0 1557828884718
openhab2_metric_switch{name="XiaomiImagiSuck_DndDndFunction"} 1 1557828884718
openhab2_metric_switch{name="Hs110GlassCubeLight_Led"} 1 1557828884718
openhab2_metric_switch{name="Bedroom1Lamp_Switch"} 0 1557828884718
openhab2_metric_switch{name="Hs110Catgenie_Led"} 1 1557828884718
openhab2_metric_switch{name="Hs110GlassCubeLight_Switch"} 0 1557828884718
openhab2_metric_switch{name="Hs110IndustrialLight_Led"} 1 1557828884718
openhab2_metric_switch{name="PlexTVPause"} 0 1557828884718
openhab2_metric_switch{name="SpotifyLoungeHifi_DeviceRestricted"} 1 1557828884718
# TYPE openhab2_metric_contact gauge
openhab2_metric_contact{name="Tablet_Battery_Charging"} 0 1557828884718
openhab2_metric_contact{name="Tablet_Battery_Low"} 1 1557828884718
openhab2_metric_contact{name="Tablet_Screen"} 0 1557828884718
3 Likes

(moved discussion about the UDEFs into the Issues Area of the GitHub repository)