Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Latest commit

 

History

History
83 lines (49 loc) · 6.62 KB

MIGRATION.md

File metadata and controls

83 lines (49 loc) · 6.62 KB

Migration Guide

This plugin is now deprecated and no longer maintained by the Grafana team. This deprecation means that this plugin won't receive any feature updates or bug fixes. After 6 months (End of June 2024), the plugin will reach EOL and the repository will be archived. You can use Grafana Infinity data source plugin as an alternative for connecting to JSON/CSV/XML/GraphQL endpoints. Refer the migration guide here, if you still prefer connecting to existing grafana simple JSON backend server implementation. Alternatively, you can also build your own plugin.

Building your own plugin

If you are looking for building your own plugin, consider the examples here and documentation here.

Migrating to Infinity data source 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.

Before After
image image

Provisioning

Provisioning of simple json and infinity is almost similar only the plugin id differs. Refer the infinity plugin provisioning documentation for more examples.

Before After
image image

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.

Before After
image imageimage
Select the target in the query editor. Example upper_25 Select 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.

Before After
image imageimage
Select the target in the query editor. Example upper_25 Query Type: 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
image
Using Infinity
image

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

image