# Pushing check results to influxdb?

**URL:** <https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793>\
**Category:** Sensu Go\
**Created:** [May 21, 2020, 6:58pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793 "2020-05-21T18:58:46Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulp](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@paulp](https://discourse.sensu.io/u/paulp)\
**Post date:** [May 21, 2020, 6:58pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/1 "2020-05-21T18:58:46Z")

</div>

Hello,

I can’t seem to figure out how to push sensu go check results into influxdb. I’m not referring to metrics collection (which works fine for me), but a basic service check that returns OK, WARNING, CRITICAL results. I want to keep long term data for certain checks in influxdb and all the examples and documentation I find seems to refer only to metrics collection. I’ve tried mixing some of the example metrics collection config parameters into regular checks without joy. I’m sure it’s easy and I am doing something silly, but can anyone provide a basic service check example that push result to influxdb?

Thanks!

---

<div class="post-metadata">

**Author:** ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)\
**Post date:** [May 21, 2020, 8:02pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/2 "2020-05-21T20:02:50Z")

</div>

Hey!

I think the best way forward for you is to add a mutator into your event pipeline and mutator the event definition and convert the check status into a metric of your choice. You should be able to do this with jq in a bash script for now, I’m going to work on a more general golang mutator asset that should work in the more general case and get back to you.

---

<div class="post-metadata">

**Author:** ![paulp](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@paulp](https://discourse.sensu.io/u/paulp)\
**Post date:** [May 21, 2020, 10:40pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/3 "2020-05-21T22:40:40Z")

</div>

Thanks Jef, that would be super helpful if you could provide a generic example!

---

<div class="post-metadata">

**Author:** ![todd](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/todd/32/936_2.png) [@todd](https://discourse.sensu.io/u/todd)\
**Post date:** [May 26, 2020, 9:30pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/4 "2020-05-26T21:30:25Z")

</div>

@paulp actually the latest version of the Influxdb handler has a command line option `--check-status-metric` that should do that for you.

However, along the lines of what Jef had mentioned, I’ve created a mutator that does similar and should work with any TSDB. It’s on Bonsai [here](https://bonsai.sensu.io/assets/nixwiz/sensu-check-status-metric-mutator).

---

<div class="post-metadata">

**Author:** ![paulp](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@paulp](https://discourse.sensu.io/u/paulp)\
**Post date:** [May 27, 2020, 7:58pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/5 "2020-05-27T19:58:35Z")

</div>

Thanks so much @todd! I will look into these solutions…

---

<div class="post-metadata">

**Author:** ![paulp](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@paulp](https://discourse.sensu.io/u/paulp)\
**Post date:** [May 27, 2020, 9:50pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/6 "2020-05-27T21:50:02Z")

</div>

@todd @jspaleta thank you both for your help. I have confirmed the latest version of InfluxDB handler 3.2.0 (which for some reason hasn’t been pushed to Bonsai) does indeed help me push check status into influxdb by utilizing the newly added parameter “–check-status-metric”.

---

<div class="post-metadata">

**Author:** ![todd](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/todd/32/936_2.png) [@todd](https://discourse.sensu.io/u/todd)\
**Post date:** [May 27, 2020, 10:03pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/7 "2020-05-27T22:03:41Z")

</div>

Thanks for letting us know it wasn’t updated on Bonsai. That has been fixed now as well.

---

<div class="post-metadata">

**Author:** ![raulgs](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/raulgs/32/323_2.png) [@raulgs](https://discourse.sensu.io/u/raulgs)\
**Post date:** [May 29, 2020, 6:57am UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/8 "2020-05-29T06:57:15Z")

</div>

Awesome I just enabled `--check-status-metric` and added the handler parameters to the related checks. Works like a charm 👍

---

<div class="post-metadata">

**Author:** ![raulgs](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/raulgs/32/323_2.png) [@raulgs](https://discourse.sensu.io/u/raulgs)\
**Post date:** [June 8, 2020, 9:33am UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/9 "2020-06-08T09:33:30Z")

</div>

For the next update of the influxdb handler I would like to request the following feature:

Send the check result message next to the check result status. This would make the reason of a failed check more transparent.

---

<div class="post-metadata">

**Author:** ![todd](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/todd/32/936_2.png) [@todd](https://discourse.sensu.io/u/todd)\
**Post date:** [June 8, 2020, 2:30pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/10 "2020-06-08T14:30:29Z")

</div>

The next release will include support for annotation events, a 1.x feature parity. Is this similar to what you are requesting? If not, I would encourage you to submit this is an [issue](https://github.com/sensu/sensu-influxdb-handler/issues).

---

<div class="post-metadata">

**Author:** ![raulgs](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/raulgs/32/323_2.png) [@raulgs](https://discourse.sensu.io/u/raulgs)\
**Post date:** [June 8, 2020, 2:44pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/11 "2020-06-08T14:44:52Z")

</div>

By annotation you dont mean the check response message or?

```auto
AllNodesAreReady OK: All nodes are reporting as ready

```

 ![image](https://us1.discourse-cdn.com/flex016/uploads/sensu/original/1X/2d7aa6b74f95508f93051363dad70b0932aedd65.png)

---

<div class="post-metadata">

**Author:** ![todd](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/todd/32/936_2.png) [@todd](https://discourse.sensu.io/u/todd)\
**Post date:** [June 8, 2020, 2:49pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/12 "2020-06-08T14:49:16Z")

</div>

It’s a [Grafana thing](https://grafana.com/docs/grafana/latest/reference/annotations/). It allows you to align events to your graph’s timeline.

Example of annotation with this Grafana Annotation definition: `select description from sensu_event where $timeFilter ORDER BY time ASC`

 ![image](https://us1.discourse-cdn.com/flex016/uploads/sensu/original/1X/c882623a4c91185b0a7a352334854b18d1e0b70b.png)

---

<div class="post-metadata">

**Author:** ![raulgs](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/raulgs/32/323_2.png) [@raulgs](https://discourse.sensu.io/u/raulgs)\
**Post date:** [June 10, 2020, 9:46am UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/13 "2020-06-10T09:46:18Z")

</div>

This looks definitely promising.  
Is there already an estimated release date available?

---

<div class="post-metadata">

**Author:** ![todd](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/todd/32/936_2.png) [@todd](https://discourse.sensu.io/u/todd)\
**Post date:** [June 10, 2020, 2:12pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/14 "2020-06-10T14:12:33Z")

</div>

Just awaiting [PR](https://github.com/sensu/sensu-influxdb-handler/pull/37) approval/merge. We will cut a release after that. Hopefully done by the end of this week.

---

<div class="post-metadata">

**Author:** ![raulgs](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/raulgs/32/323_2.png) [@raulgs](https://discourse.sensu.io/u/raulgs)\
**Post date:** [June 12, 2020, 1:26pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/15 "2020-06-12T13:26:43Z")

</div>

hi @todd I have seen that the new version has been released.  
Any hint about what I have to do to get the annotation within grafana now?

Thanks

---

<div class="post-metadata">

**Author:** ![todd](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/todd/32/936_2.png) [@todd](https://discourse.sensu.io/u/todd)\
**Post date:** [June 12, 2020, 2:17pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/16 "2020-06-12T14:17:36Z")

</div>

It’s a per-dashboard configuration, so go to the dashboard you wish to add annotations to and click on the gear icon. In the left navigation column you should see `Annotations`. It’s directly under `General` in my instance. And then click on `New`. Here’s what the definition for mine looks like.

 ![Screen Shot 2020-06-12 at 7.15.57 AM](https://us1.discourse-cdn.com/flex016/uploads/sensu/original/1X/9f6e1c3613b88137a6119117d594a195b304dd23.png)

---

<div class="post-metadata">

**Author:** ![raulgs](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/raulgs/32/323_2.png) [@raulgs](https://discourse.sensu.io/u/raulgs)\
**Post date:** [June 12, 2020, 4:19pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/17 "2020-06-12T16:19:04Z")

</div>

sorry for asking again - but I am still struggling with that.  
Where is the `sensu_event` table coming from to which you are referring in your query?

---

<div class="post-metadata">

**Author:** ![todd](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/todd/32/936_2.png) [@todd](https://discourse.sensu.io/u/todd)\
**Post date:** [June 12, 2020, 4:40pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/18 "2020-06-12T16:40:05Z")

</div>

It’s a table that gets populated by the handler whenever an event it receives includes a check that is failing and when it resolves.

---

<div class="post-metadata">

**Author:** ![raulgs](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/raulgs/32/323_2.png) [@raulgs](https://discourse.sensu.io/u/raulgs)\
**Post date:** [June 12, 2020, 4:45pm UTC](https://discourse.sensu.io/t/pushing-check-results-to-influxdb/1793/19 "2020-06-12T16:45:36Z")

</div>

ahhh I see - works like a charm  
many thanks 🙂
