Comments (15)
I'll try it on my own tomorrow
from grafanajsondatasource.
@cmoroexpedia can you try upgrading ur grafana?
I've only discovered that selecting All
doesn't pass all values. I didn't notice that as I use it in a bit non-standard way so I have never manually selected variable before :) I have created an issue for that #31
from grafanajsondatasource.
This has been fixed recently based on #26 (comment) with #28 Try to put quotes around.
Have to update documentation, thanks!
from grafanajsondatasource.
Thanks for the quick response!
Enclosing my variable name in quotes worked, but I also had to change the variable configs to return all values between quotes:
Also, the All
option doesn't work because that's not between quotes.
from grafanajsondatasource.
@cmoroexpedia I meant something like this:
{ "additional": "optional json", "testvar": "$testvar" }
Try it and let me know
from grafanajsondatasource.
Correct, that's what I did but I still got an error saying Unexpected token t in JSON
. I found strange that it was complaining about token t
that is the first char of the value of my variable, so I also enclosed the variable value in quotes and it worked. Basically double quoting.
I think I'll go a different route and get my variable content from scopedVars
field instead. Thanks for your help!
from grafanajsondatasource.
All
value handling is implemented in #33
from grafanajsondatasource.
@simPod I have the same problem in grafana v5.3.4, but it works well in grafana v6.0.2.
the additional json data is
{"nodename": "$node"}
and the erros in chrome is :
metrics_panel_ctrl.ts:177 Panel data error: SyntaxError: Unexpected token h in JSON at position 15
at JSON.parse (<anonymous>)
at eval (datasource.ts:156)
at Array.map (<anonymous>)
at t.buildQueryTargets (datasource.ts:136)
at t.query (datasource.ts:35)
at t.issueQueries (metrics_panel_ctrl.ts:287)
at t.issueQueries (module.ts:254)
at angular.js:17051
at angular.js:17095
at c.$digest (angular.js:18232)
the $node should be "hz".
Correct, that's what I did but I still got an error saying
Unexpected token t in JSON
. I found strange that it was complaining about tokent
that is the first char of the value of my variable, so I also enclosed the variable value in quotes and it worked. Basically double quoting.I think I'll go a different route and get my variable content from
scopedVars
field instead. Thanks for your help!
from grafanajsondatasource.
I still have not updated the docs :/
You can try this: {"nodename": $node}
If that doesn't work, you can try to check what value comes to JSON.parse in datasource.ts.
But there have been some variable processing changes in Grafana till v5 so I'll maybe just bump the version requirement to v6.
from grafanajsondatasource.
Documentation issue resolved via 0c2b628
from grafanajsondatasource.
when I try : {"nodename": $node}, it doesn't work in grafana v6 and v5. And I don't know how to print the value comes to JSON.parse. I tried with {"nodename": $node}, and I just saw the value or $node in grafana v5 is "hz" (in quotes)。
from grafanajsondatasource.
@skyever what version of this DS do you have?
To print the value you have to clone the repo and then add console.log
, then build it, see https://github.com/simPod/grafana-json-datasource#development-setup
from grafanajsondatasource.
@simPod the version is v0.1.3. And I will try this, thanks.
from grafanajsondatasource.
I decide to update all of my grafana to v6.
from grafanajsondatasource.
Ayright, I'll just bump it. Tagging 0.1.4.
from grafanajsondatasource.
Related Issues (20)
- playload wrong with multi-values HOT 2
- Browser sending requests when Access is set to Server HOT 3
- openapi.yaml needs updating HOT 5
- Who uses the datasource? HOT 5
- Getting error 404 from grafana HOT 1
- Randomly grafana show strange series name in legend HOT 4
- I cant get the desired version number of simpod-json-datasource HOT 1
- Query Variable: if Multi-Value enabled, if in targets payload the query variable is referenced, the whole payload gets deleted HOT 7
- Unknown Payload only shows values of strings HOT 2
- Builder mode add quotes around Query Variable HOT 3
- Requests with params containing ":" character HOT 3
- Using global variables in Payload HOT 6
- Health endpoint not working in Grafana 9.5 HOT 3
- Please migrate to grafana create-plugin
- Grafana 9.5.2 - simpod-json-datasource request targets.data option is a string value instead of array of object HOT 6
- Datasource provisioning - unable to set Forward OAuth Identity and timeout HOT 5
- "Disable query" ignored HOT 2
- Does not work.. ¯\_ (ツ)_/¯ HOT 3
- Builder mode: After selecting a payload option the value is shown instead of the label HOT 4
- How to name graphs / metrics? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grafanajsondatasource.