GithubHelp home page GithubHelp logo

Comments (10)

speakyourcode avatar speakyourcode commented on June 27, 2024

Hi, here an example with postgres:
#1 (comment)
Which datasource are you using?

from grafana-button-panel.

corndog2000 avatar corndog2000 commented on June 27, 2024

I am using InfluxDB. I don't understand how the other person in that closed issue was able to get grafana to run scripts with this plugin.

from grafana-button-panel.

speakyourcode avatar speakyourcode commented on June 27, 2024

Here is an example to create a database with InfluxDB:

{
  "query": "create database \"foo\"",
  "rawQuery": true,
  "resultFormat": "time_series"
}

And to delete it:

{
  "query": "drop database \"foo\"",
  "rawQuery": true,
  "resultFormat": "time_series"
}

from grafana-button-panel.

CocoJumbA avatar CocoJumbA commented on June 27, 2024

Good afternoon,
Could you be so kind and make an example of a query with inserting some value to an InfluxDB measurement?
Regards

from grafana-button-panel.

speakyourcode avatar speakyourcode commented on June 27, 2024

Hi,
InfluxDB has three endpoints: /api/v2/query, /api/v2/write and /health, and Grafana always uses query. AFAIK the only way to use the write endpoint is with a custom datasource.

from grafana-button-panel.

angellee99 avatar angellee99 commented on June 27, 2024

Hi,
InfluxDB has three endpoints: /api/v2/query, /api/v2/write and /health, and Grafana always uses query. AFAIK the only way to use the write endpoint is with a custom datasource.

Hi, how should we add queries to insert values into the influxdb database?

from grafana-button-panel.

speakyourcode avatar speakyourcode commented on June 27, 2024

Hi, you can only insert values with the endpoint /api/v2/write. Grafana's InfluxDB Datasource only supports /api/v2/query, so you can't unless you use a custom datasource implementing the write endpoint (see https://grafana.com/tutorials/build-a-data-source-plugin/).

from grafana-button-panel.

AmmarAhmed avatar AmmarAhmed commented on June 27, 2024

Hello, I am on grafana version 6.7.3, I am trying to add speakyourcode-button-panel but I have an error "Error loading panel plugin: speakyourcode-button-panel TypeError: v.setPanelOptions is not a function"
Do you have an idea ?

from grafana-button-panel.

speakyourcode avatar speakyourcode commented on June 27, 2024

The plugin requires Grafana 7 or higher, can you upgrade and try again?

from grafana-button-panel.

PapaRoach25 avatar PapaRoach25 commented on June 27, 2024

Hello, @speakyourcode
Is it possible to delete series of data from InfluxDB using your plugin?
My query is:

{
  "query": "drop series from \"jmeter\" where \"application\" = \"$test_name\"",
  "rawQuery": true,
  "resultFormat": "time_series"
}

$test_name - grafana variable

After clicking on the button I received:
Button: 500 (Internal Server Error) An error occurred within the plugin

Using your example I was able to create a database.

Updates: my bad I've missed space after where clause: where"application". (already edited in this comment)
After that 500 error disappeared, but the query itself couldn't drop the series from DB. (in the dev tools I'm observing 200 OK)
Do you have any suggestions on how it can be done using your plugin?
Thanks.

from grafana-button-panel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.