# Grafana plugin support through api?

**URL:** <https://community.influxdata.com/t/grafana-plugin-support-through-api/9322>\
**Category:** InfluxDB 2\
**Tags:** grafana\
**Created:** [April 5, 2019, 4:22am UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322 "2019-04-05T04:22:48Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodri](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rodri](https://community.influxdata.com/u/rodri)\
**Post date:** [April 5, 2019, 4:22am UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322/1 "2019-04-05T04:22:49Z")

</div>

I used a little of influx 1.7 and made it work in a TIG+Mosquitto stack with docker-compose. Now I am interested in futerproofing since this project is in its early stages. But I really need the ability to make queries with an interval minimum of half a second, I can do this with Grafana editing a json file.

I don’t know anything of the influx api but that there it is one. Would it be a bad idea for me to start creating a beta integration with Grafana? or a better path should be to aim to change the dashboard of InfluxDB like I had with Grafana’s dashboard.

Any help? please.

---

<div class="post-metadata">

**Author:** ![sebito91](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sebito91/32/42_2.png) [@sebito91](https://community.influxdata.com/u/sebito91)\
**Post date:** [April 5, 2019, 8:51pm UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322/2 "2019-04-05T20:51:14Z")

</div>

I’m not really sure what you’re asking, are you looking for a grafana influxdb integration? Or are you asking if you can render an influxdb query with `group by time(something_less_than_1_s)`?

If the latter you should be able to do this now by specifying the time duration (e.g. 500ms for 0.5s):

> **[Data exploration using InfluxQL | InfluxDB OSS 1.7 Documentation](https://docs.influxdata.com/influxdb/v1.7/query_language/data_exploration/#group-by-time-intervals)**
>
> Explore time series data using InfluxData’s SQL-like query language. Understand how to use the SELECT statement to query data from measurements, tags, and fields.

---

<div class="post-metadata">

**Author:** ![rodri](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rodri](https://community.influxdata.com/u/rodri)\
**Post date:** [April 5, 2019, 9:42pm UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322/3 "2019-04-05T21:42:31Z")

</div>

I mean the refresh time of the query, I am trying to see live the “stream” of data, which is a couple of hz, sent by a sensor. I am seeing that the max refresh rate of the graph is of about 5s.  
 ![image](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex023/uploads/influxdata/original/2X/f/fc1a9cb6ab234b19b578f6d1d75a92ec276c6ed1.png)  
I want to change this to 0.5s  
On Grafana I can do this but I can find no integration yet. Actually it is the reason of why I use Grafana instead of Chronograf, and I am assuming that the dashboard provided on influx 2.0 is actually a seamless integration with it right?

Anyways, hope I cleared it and hope I could help somehow. And also great work! makes my projects look like I actually know what I am doing haha.

---

<div class="post-metadata">

**Author:** ![sebito91](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sebito91/32/42_2.png) [@sebito91](https://community.influxdata.com/u/sebito91)\
**Post date:** [April 6, 2019, 2:40pm UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322/4 "2019-04-06T14:40:44Z")

</div>

Ah now I see what you’re referring to! AFAIK you cannot change these options from a setting and would have to amend the frontend code in the same way you’ve done with grafana.

[https://github.com/influxdata/influxdb/blob/master/ui/src/shared/data/autoRefreshes.ts](https://github.com/influxdata/influxdb/blob/master/ui/src/shared/data/autoRefreshes.ts)

We can submit this as a feature request for v2.0 and see where it takes us!

---

<div class="post-metadata">

**Author:** ![rodri](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rodri](https://community.influxdata.com/u/rodri)\
**Post date:** [April 6, 2019, 3:49pm UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322/5 "2019-04-06T15:49:57Z")

</div>

YES! that is what I was looking for. Could be a good feature request as you said. I would be glad to try this out “hard coding it” and compiling to see the performance. Can you help me? haven’t work with go yet, so it would be a first for me trying to compile it (probably building it as a docker image). How do I compile the project?

---

<div class="post-metadata">

**Author:** ![sebito91](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sebito91/32/42_2.png) [@sebito91](https://community.influxdata.com/u/sebito91)\
**Post date:** [April 6, 2019, 3:55pm UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322/6 "2019-04-06T15:55:02Z")

</div>

So these are the frontend assets and they don’t need the go backend. Would need to review the Makefiles to see how to build each component independently, similar to how you can do with grafana.

---

<div class="post-metadata">

**Author:** ![rodri](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rodri](https://community.influxdata.com/u/rodri)\
**Post date:** [April 6, 2019, 6:10pm UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322/7 "2019-04-06T18:10:58Z")

</div>

hmm, bit lost here. But found on the readme (sorry, did not read it fully early) a build from source guide with make. Will fork this, modify that file, and test luck.

Did you meant that? or what do you mean by each component.

---

<div class="post-metadata">

**Author:** ![sebito91](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sebito91/32/42_2.png) [@sebito91](https://community.influxdata.com/u/sebito91)\
**Post date:** [April 6, 2019, 7:00pm UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322/8 "2019-04-06T19:00:20Z")

</div>

Yep, that’s what I mean!

With grafana (at least a while back) you were able to build the frontend or backend independently of one another (or both together obviously). This meant you could make changes to the frontend all day long and rebuild without having to touch any of the backend bits.

I haven’t personally customized chronograf yet but if they tell you how to do that in the README then you should be set! Keep us posted on how it goes!

---

<div class="post-metadata">

**Author:** ![rodri](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rodri](https://community.influxdata.com/u/rodri)\
**Post date:** [April 8, 2019, 12:13am UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322/9 "2019-04-08T00:13:29Z")

</div>

First, I did it! it’s working marvelously.

 ![screen%20recording](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/9/93c21707ef016716f7930a368908f6574f92bca5.gif)

---

<div class="post-metadata">

**Author:** ![rodri](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rodri](https://community.influxdata.com/u/rodri)\
**Post date:** [April 8, 2019, 12:14am UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322/10 "2019-04-08T00:14:20Z")

</div>

Second, Actually I found this on the InfluxDB git README

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/3/3ae46514e567eab123ab0fb1aa944d56681a49ea.png)

---

<div class="post-metadata">

**Author:** ![rodri](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rodri](https://community.influxdata.com/u/rodri)\
**Post date:** [April 8, 2019, 12:15am UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322/11 "2019-04-08T00:15:19Z")

</div>

which led me to believe I had to build the hole thing, but after the first build, if I modify a file like that, it just compiles that module automatically:

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/c/c06d544bfddf97a112cff11dadc6f748c8f12708.png)

---

<div class="post-metadata">

**Author:** ![rodri](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rodri](https://community.influxdata.com/u/rodri)\
**Post date:** [April 8, 2019, 12:16am UTC](https://community.influxdata.com/t/grafana-plugin-support-through-api/9322/12 "2019-04-08T00:16:01Z")

</div>

but anyway, it is working and it is good enough for me; probably will make this mod in to a docker image for my use. If this is going to be a feature request I have to add: that the way of modifying this in Grafana is by changing a json file directly on the web interface, like you said… just messing with the frontend. But Grafana is just a step further because it does not has to compile anything, just adds the value then a page and maybe cache refresh.

Inspecting the js file of the web page found a variable with the data of autoRefreshes.ts. I saw somewhere it was loading from ‘src/share/constants’ (maybe it was other thing)

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/1/16b93c306c28e0b5c9dc6690ed269b90de73f1bb.png)

I believe adding an option to change and save these values are the way to go.

Anyways, thanks for the help so far.

PS: sorry for the multiple replies, the page wouldn’t let me post multiple pictures because I’m a new user
