# \[APP\] Prometheus.io exporter

**URL:** <https://community.homey.app/t/app-prometheus-io-exporter/7375>\
**Category:** Apps\
**Tags:** app, homey-pro\
**Created:** [January 19, 2019, 12:07pm UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375 "2019-01-19T12:07:51Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![matrover](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matrover/32/12112_2.png) [@matrover](https://community.homey.app/u/matrover)\
**Post date:** [May 15, 2020, 7:54am UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/62 "2020-05-15T07:54:41Z")

</div>

@Kyrcio

Is the new version gonna be submitted to the appstore? maybe as test?

---

<div class="post-metadata">

**Author:** ![vandermark](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vandermark/32/154_2.png) [@vandermark](https://community.homey.app/u/vandermark)\
**Post date:** [May 16, 2020, 5:44pm UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/63 "2020-05-16T17:44:43Z")

</div>

I started using the prometheus app to store solar panels information and visualize it in Grafana. Is there a way to make a selection in the data is stored? I do only need two sets of data and i am collecting way more now with everything from my Homey.

Is there some setting in the config file (.yml) where i can specify what to scrape? I allready set the interval to 5 minutes.

---

<div class="post-metadata">

**Author:** ![meistereder](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/meistereder/32/5953_2.png) [@meistereder](https://community.homey.app/u/meistereder)\
**Post date:** [May 16, 2020, 8:41pm UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/64 "2020-05-16T20:41:41Z")

</div>

Does anybody know how to get the data from pometheus back to Homey? 🙂

I would like to have the following flow:  
when: it’s start to rain  
then: write me a push msg with all open windows  
`curl -s "http://prometheus:9090/api/v1/query?query=homey_device_alarm_contact>0" | jq -r '.data.result[].metric.name'`

The tricky part is how to parse the json from prometheus in homey. Query works perfectly on my laptop though.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [May 17, 2020, 6:42am UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/65 "2020-05-17T06:42:26Z")

</div>

You can use the [HTTP request flow cards app](https://homey.app/en-gb/app/com.internet/HTTP-request-flow-cards/) to perform the query and extract the data with its JSONPath support.

You can use [http://jsonpath.com/](http://jsonpath.com/) to test JSONPath queries against the data that Prometheus returns.

---

<div class="post-metadata">

**Author:** ![Kyrcio](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kyrcio/32/10170_2.png) [@Kyrcio](https://community.homey.app/u/Kyrcio)\
**Post date:** [June 28, 2020, 9:52pm UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/66 "2020-06-28T21:52:32Z")

</div>

You could also have a look at using the Alert functionality within Grafana to do the heavy lifting, instead relying on webhooks.

> **[Alert notifications](https://grafana.com/docs/grafana/latest/alerting/notifications/#webhook)**
>
> Alerting notifications guide

I have not used this in the context of Homey, but I have been using Grafana Alerting in some enterprise application I have been working (during my day job) and it sometimes does the job well if you can overlook the somewhat quirky setup process.

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [June 30, 2020, 7:05am UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/67 "2020-06-30T07:05:44Z")

</div>

![20200630_085943](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/4/a4613360b283dd47a3a566002515c131d865d0bc.png)

I see other people already reported this, but I only noticed yesterday that [prometheus.io](http://prometheus.io) exporter is creating an unacceptable load on my Homey pro. I uninstalled the app around 9 pm yesterday, and the system load is significantly lower since then.

Anything you can optimize in your code to reduce the load maybe @Kyrcio? I really love your app, but it takes my average load above 1 😯 As you can see the app started working on June 25th, and I uninstallled on June 29th.

 ![20200630_091228](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/1/414efed15f613c2f8fc1c966520b4c17548b92fe.png)

---

<div class="post-metadata">

**Author:** ![Kyrcio](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kyrcio/32/10170_2.png) [@Kyrcio](https://community.homey.app/u/Kyrcio)\
**Post date:** [June 30, 2020, 2:27pm UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/68 "2020-06-30T14:27:46Z")

</div>

Could you please install dashboard 10586 and paste back what it spends CPU time on. I think last time I saw this, the physical storage of the Homey was slow due to a hardware or OS issue IIRC. The new polling should also be much nicer on the system so this is potentially a new issue.

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [July 1, 2020, 12:37pm UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/69 "2020-07-01T12:37:07Z")

</div>

I already de-installed prometheus. So I need to set that up again, including grafana to get the dashboard running. Maybe if I’m realy bored I will try that 🤔

Edit: OK, I just got bored. Dashboard 10586 is running. So now what do you need from me?

 ![2020-07-01](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/3/d36ab9f0406751a9f3093c0adb085af048eb0d71.png)

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [July 3, 2020, 5:06am UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/70 "2020-07-03T05:06:37Z")

</div>

Anything you want me to look at in the dashboard @Kyrcio?

---

<div class="post-metadata">

**Author:** ![Kyrcio](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kyrcio/32/10170_2.png) [@Kyrcio](https://community.homey.app/u/Kyrcio)\
**Post date:** [July 4, 2020, 6:54pm UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/71 "2020-07-04T18:54:57Z")

</div>

The interesting graphs would be the ones showing what time is spent on, especially the systeminfo call.

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [July 4, 2020, 7:33pm UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/72 "2020-07-04T19:33:01Z")

</div>

Those remain empty (no data)

---

<div class="post-metadata">

**Author:** ![Kyrcio](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kyrcio/32/10170_2.png) [@Kyrcio](https://community.homey.app/u/Kyrcio)\
**Post date:** [July 4, 2020, 9:53pm UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/73 "2020-07-04T21:53:23Z")

</div>

Sorry, I did not realize the old beta version expired once Athom changed the dev experience. New test version published here: [Prometheus.io App for Homey | Homey](https://homey.app/a/io.prometheus/test/)

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [July 5, 2020, 10:36am UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/74 "2020-07-05T10:36:13Z")

</div>

OK, reinstalled everything again with your test version. It is collecting data now.I shall post the graphs in some hours.

edit: this is after 30 minutes running:

 ![2020-07-05](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/e/6ea1f42e401e5e978ac7bac9c39ad808312ee8bc.png)

edit: 3 hrs graph:

 ![2020-07-05 (2)](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/d/9d1c314a6431790a589754b672be1794f0f78dd1.png)

---

<div class="post-metadata">

**Author:** ![matrover](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matrover/32/12112_2.png) [@matrover](https://community.homey.app/u/matrover)\
**Post date:** [July 9, 2020, 12:21pm UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/75 "2020-07-09T12:21:03Z")

</div>

Hi @Gruijter

If i compare yours to mine, the time spent per device seems factor 10 higher. this was the case on my homey too, before the change below.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/8/c8f9dd7404a3024f1aaf7d51d870823566ef9cb1.png)

Can you try this:  
edited this line (in the app.js file) :

```auto
setTimeout(this.updateSystemInfo.bind(this), 30000);

```

To this:

```auto
setTimeout(this.updateSystemInfo.bind(this), 300000);

```

after i made that change, my load went down.

---

<div class="post-metadata">

**Author:** ![Rudolph\_Marks](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rudolph_marks/32/22781_2.png) [@Rudolph\_Marks](https://community.homey.app/u/Rudolph_Marks)\
**Post date:** [July 11, 2020, 5:22pm UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/76 "2020-07-11T17:22:41Z")

</div>

I’m new with docker files. How can i change the yml file… it’s not on my local system. I installed the docker on my NAS

---

<div class="post-metadata">

**Author:** ![Kyrcio](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kyrcio/32/10170_2.png) [@Kyrcio](https://community.homey.app/u/Kyrcio)\
**Post date:** [July 20, 2020, 10:23pm UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/77 "2020-07-20T22:23:49Z")

</div>

@Gruijter The problem here is that your Homey spends lots of time refreshing devices. Normally, updatedevicelist and registerdevice times should be more or less zero. I suspect that there is something (an app?) that cause the Homey to spam device changes events. Can you please create a diagnostic report for the Prometheus app and send me the UUID for it?

@matrover Actually, the system info loops looks quite normal. Of course it will always be a trade off between update frequency and system load. Note that this metric has its own y-scale in the chart, and that time spent does not equal system load (lots of async calls to the Homey APIs).

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [July 21, 2020, 4:46am UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/78 "2020-07-21T04:46:06Z")

</div>

df243a78-2382-4593-895d-83e1237ad3bc

I only had the app running for 5 minutes when creating the report. Is that ok @Kyrcio ?

---

<div class="post-metadata">

**Author:** ![Kyrcio](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kyrcio/32/10170_2.png) [@Kyrcio](https://community.homey.app/u/Kyrcio)\
**Post date:** [July 21, 2020, 10:31am UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/79 "2020-07-21T10:31:12Z")

</div>

Thanks. I can see that the device update event is indeed triggered very frequently. I would have to add more logging to get a better understanding of why this is happening.

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [July 21, 2020, 10:52am UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/80 "2020-07-21T10:52:21Z")

</div>

well, I have a lot of devices that each have a lot of updates 🙂 E.g. my power plugs update every 10 seconds, and I have around 30 plugs or so. And another 50 devices updating every minute. And then I have apps monitoring these devices and turning them into new virtual devices. like the PowerByTheHour app.

---

<div class="post-metadata">

**Author:** ![Kyrcio](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kyrcio/32/10170_2.png) [@Kyrcio](https://community.homey.app/u/Kyrcio)\
**Post date:** [July 21, 2020, 11:28am UTC](https://community.homey.app/t/app-prometheus-io-exporter/7375/81 "2020-07-21T11:28:49Z")

</div>

@Gruijter It is not the state changes that trigger device update events ([https://developer.athom.com/docs/api/HomeyAPI.ManagerDevices.html#.event:%22device.update%22](https://developer.athom.com/docs/api/HomeyAPI.ManagerDevices.html#.event:%2522device.update%2522)), rather updates to device metadata. I have created version 0.2.7 which improves logging (in addition to a larger timeout on device updates). Could you please try that and do the diagnostics report again? This should at least tell us which driver is the culprit.

[Previous page](https://community.homey.app/t/app-prometheus-io-exporter/7375.md?page=3)

[Next page](https://community.homey.app/t/app-prometheus-io-exporter/7375.md?page=5)
