Migration from simple json data source plugin #740
Replies: 3 comments 6 replies
-
Thanks a lot for this guide for migration. Unfortunately, images cannot be opened or saved to file, so it is really difficult to have a look at them. If you could give access to the images, it would be great. Thanks! |
Beta Was this translation helpful? Give feedback.
-
There really needs to be a way to extract the "Columns" in the "Parsing options & Result fields" section from the same Json format that simple-json-datasource supported. Without that feature, Infinity isn't really usable as a replacement. Suppose a simple-json target had 20 columns defined. All of those showed up with grafana datatypes in the "columns" section of the response. Now it is necessary to manually type in those 20 column definitions for every single panel that uses the target :( |
Beta Was this translation helpful? Give feedback.
-
Hi to all The scenario is: I have several plesk server, they have internal garafana to collect data. I used this doc to monitoring several plask server As stated in the doc, I use an url like In the grafana-simple-json-datasource I put this url without any auth and then in the queries for panels I was able to see all the fields returned from the plesk server. But this doesn't work with Infinity. The error say is a 400 Bad request. Someone have any clue on how to configure this scenario? Thanks in advance and sorry if that's no the place for posting this question. |
Beta Was this translation helpful? Give feedback.
-
=>
Grafana's simple JSON datasource plugin is a legacy way of connecting JSON endpoints from Grafana. This requires you to run your own http server that implements certain HTTP endpoints such as
/
,/search
,/query
and/annotations
endpoint and require to return data in certain format. This plugin was build for older versions of Grafana and no longer maintained. Also this plugin was built using legacy AngularJS technology which is now deprecated in recent versions of Grafana. This makes this plugin unusable anymore.Migrating to infinity plugin
Important
Infinity is not a drop-in replacement for simple JSON datasource plugin. This require manual migration efforts. But migrating to infinity is strongly recommended approach if you are using simple JSON API datasource plugin.
Approach 1 : Direct API connection / Simple approach / Recommended approach
This is much easier and recommended approach to connect JSON api endpoints directly. Infinity allows you to connect directly to your JSON endpoints instead of requiring you to write your server implementation comparing to grafana simple json server approach. Refer Infinity plugin website for more details about connecting your APIs directly.
With this approach, you can get rid of your custom json server and directly connect your API endpoints via Infinity plugin. If this approach is not possible for any reason, use the below alternate migration approach.
Approach 2 : Migrating using Grafana simple json server approach
With this approach, Instead of connecting your API endpoints directly, you will be connecting via grafana simple JSON server (legacy server). Also in grafana, instead of using simple json datasource plugin, you will be using Infinity plugin.
Migrating the configuration
In terms of configuration editor, there is no much change. The URL used in simple json datasource goes into infinity config misc/url section. Other options such as proxy, tls/ca certificates, headers goes into network and headers section.
Provisioning
Provisioning of simple json and infinity is almost similar only the plugin id differs. Refer the infinity plugin provisioning documentation for more examples.
Migrating the queries ( quick migration / frontend parser )
If you are using one or more queries using Simple JSON as shown below, you can migrate to infinity using the steps provided below. This approach is simple but less powerful. Doesn't support grafana backend features such as alerting.
upper_25
JSON
as query type.Select
Default
/Frontend
as your parser.Source:
URL
.Format:
As IS
/Legacy
.HTTP Method:
POST
.URL :
/query
HTTP Body: In your http body you need to specify the targets:
{ "targets": [{ "target":"upper_25" }] }
Migrating the queries ( recommended migration / backend parser )
Use this approach to migrate to get support for features such as alerting, public dashboards, query caching etc.
upper_25
URL
Parser:
Backend
Source:
URL
Format:
Time series
HTTP method:
POST
URL:
/query
BODY:
{ "targets": [{ "target":"upper_25" }]}
Parsing options/Root:
datapoints
Column 1:
0
as selector.upper_25
as alias.Number
as format.Column 2:
1
as selector.Time
as alias.Unix (ms)
as format.Migrating the annotations
Migrating the annotations is similar to query. For example, below screenoshots show different annotation creations
Using Simple JSON
Using Infinity
Troubleshooting
Note
Infinity doesn't support direct browser connection to your API endpoints. All the requests will be proxied from grafana server.
Sample migration dashboard
Beta Was this translation helpful? Give feedback.
All reactions