Code Monkey home page Code Monkey logo

Comments (11)

tomglazer89 avatar tomglazer89 commented on August 18, 2024 1

Hey Marcus,
sorry ill try to explain better.

I'm not sure if its something possible to implement on grafana. :)

this is my scenario, I have 4 servers with JSON api, exposed on the following addresses:
http://server1/api
http://server2/api
http://server3/api
http://server4/api

then i have a Grafana variable with these4 servers as drop down list.

when you select one of these servers, each one is bounded to its own data source. i had to put their data source as a variable, and create 4 different data sources.

its not so much a big issue, but if you have 10 servers, then you need to add 10 data sources...

my question is, is it possible to create 1 generic JSON data source, and then (as same as you passed the custom URL parameters from the query) pass the URL as a variable to the generic data source?
so this way I have only 1 data source, with a dynamic URL.

for now, my workaround was to create a php file as router, and redirect to the selected server.
something like:
http://mainserver?server=server1

then inside the php i redirect the request to:
http://server1/api
this way I only have 1 data source.

Thanks!!

from grafana-json-datasource.

mbarradas avatar mbarradas commented on August 18, 2024

I have the same issue I would like to send a Variable to the JSON call but it seems we are not capable of interacting with the call withing the dashboard.

from grafana-json-datasource.

marcusolsson avatar marcusolsson commented on August 18, 2024

Thanks both of you for the feature request! I think makes perfect sense to add something like this to the query editor. Would be pretty easy to implement as well.

from grafana-json-datasource.

enavarro222 avatar enavarro222 commented on August 18, 2024

This feature may be very useful !

from grafana-json-datasource.

marcusolsson avatar marcusolsson commented on August 18, 2024

I've published v0.6.0 with this feature. Let me know if it works for you!

from grafana-json-datasource.

Tugduall avatar Tugduall commented on August 18, 2024

Hey !

Thank you for the plugin. Can we use dashboard global variable in "Custom query parameters" ?

Thanks

from grafana-json-datasource.

tomglazer89 avatar tomglazer89 commented on August 18, 2024

Thanks Marcus! will check it up!
do you also plan to add passing the URL from the query to the data source?

from grafana-json-datasource.

mbarradas avatar mbarradas commented on August 18, 2024

from grafana-json-datasource.

enavarro222 avatar enavarro222 commented on August 18, 2024

No issue with last versions to use variable in custom query !
image

from grafana-json-datasource.

marcusolsson avatar marcusolsson commented on August 18, 2024

Thanks Marcus! will check it up!
do you also plan to add passing the URL from the query to the data source?

I'm afraid I don't understand what you mean by this. Could you give an example?

from grafana-json-datasource.

marcusolsson avatar marcusolsson commented on August 18, 2024

I don't think I've seen this pattern before, but there's nothing stopping us from adding a variable to the URL in the data source configuration and interpolating it for each query. Could you open a new issue for this maybe?

from grafana-json-datasource.

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.