-
Notifications
You must be signed in to change notification settings - Fork 232
Conversation
@simPod I couldn't find out immediately- where can I find the additional json option? Per Panel?? |
Yup, that one is for entering your json you want to add to the request. Not sure how tags/values are related here. Can you be more specific please? I made this column to pass additional data to the request. For example, my use case is that I control Grafana via API, that means I specify all dashboards and panels via objects and then just run the sync command to synchronize the schema. The panels definition is therefore shared through dashboards but for different dashboards, I want the panels to make slightly different requests and that is achieved by configuring this field per dashboard if needed. |
I've meanwhile tested and its working like a charm. The thing I don't like so much is the UI- a very small, non-obvious text field. I had two ideas:
I can understand if that doesn't sound attractive given zero feedback :( |
Yup, the UI sucks but I didn't want to pimp it without any feedback from repo maintainers. I can't imagine the tags/values, can you share the screenshot? Larger field was something I rather had on my mind. |
Sorry for the delay. Here are the tags- manual definition (if not supplied by the json data source)- UI. Selection UI on dashboard level: That UI might be something that could be done per panel in the settings to override dashboard-wide tags or define additional ones? Here's how the json looks, it becomes part of the target:
|
Personally, I didn't want to lock it to dashboard-defined variables only, I wanted the full flexibility so for me the second option is viable
But since no one still cares I'll wait ;) |
Yeah :( I've been wondering if you might consider a "hard" fork and publish Btw., I have another use case for a JSON plugin: extract definable parts from arbitrary JSON sources. That is- instead of talking to a grafana-conforming json source- talk to any JSON endpoint and define patterns for extracting metrics, annotations and data. The forecast.io API might be a good candicate for that. WDYT? |
And I forgot to mention that tags/values (=dashboard variables) are retrievable using the JSON datasource through the |
@andig maybe having both options would work as well 🤔 @daniellee @DanCech @bergquist Hi, trying a one more ping so we know the repository is abandonded by Grafana Labs or not. Thanks! |
@simPod found a small issue with your current implementation. If additional data is defined and the cleared again, its still being sent to the datasource, apparently as empty string instead of being omitted. Would be nicer to drop entirely instead when trimmed json is empty string. |
@simPod I finally discovered a JSON/SQL editor control but couldn't get it working immediately- maybe you'd want to take another look: https://github.com/grafana/grafana/blob/master/public/app/partials/edit_json.html#L14 |
I'll try to take a look @ it asap |
Here are the component's docs. I still think it would be nice if we could also expose tags and values as dropdown options per panal for transfer in |
This PR has been migrated to https://github.com/simPod/grafana-json-datasource and can be closed. |
@andig @simPod I am also not really sure if we want this PR in SimpleJson so maybe it is best if you focus on your datasource. Once you get to the stage where you need an extra json field then it usually gets specific to what you are building and in my experience is time to fork this into a new plugin. I will double check with my team on what they think about this. We can publish https://github.com/simPod/grafana-json-datasource on Grafana.com if you want. |
I think thats fine as we've made good progress with the new JSON datasource I've linked.
Sort of. The ability to pass additional JSON does actually prevent me from needing to develop a specific plugin. The use case looks like:
The effort of adding a little payload is very minor compared to writing a whole new plugin that needs to be maintained. |
Yup, for me as well. I control Grafana via it's API, I define dashboard and panel models in PHP and don't even use any Edit interface within Grafana. Additional JSON field allows me to parametrize Panels data per dashboard, sometimes it comes very handy. |
This looks like a useful addition but it's built ontop of a breaking change (#103) which makes it tricky to merge |
This can be closed, we have forked now. |
Hello. I´m in need to pass addidition json data using variables. Is that possible? Something like this: {"fieldName":$variable} |
Forked version https://grafana.com/plugins/simpod-json-datasource has this feature |
I'm already using this version. How can I achieve that? This code i shown gives json format error |
Oh I see. "using variables" We're not parsing variables there yet unfortunately. There's an issue already opened for that simPod/GrafanaJsonDatasource#11 |
Ok, thanks for the information. |
@simPod Hello. Is there any update about issue with parsing variables? It's very necessary feature. |
Hi @mankoffs, I intend to have such feature here. However, I'm currently busy with my work and finishing other OSS. I'll be able to look into it when I have a task concerning Grafana in my work. You can send PR, I will do review ASAP. |
@mankoffs resolved in simPod/GrafanaJsonDatasource#26 |
Built on top of #103
Adds another field to targets setup, that allows to pass additional json data with target