manjrekarom / grafana-json-datasource

A data source plugin for loading JSON APIs into Grafana.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSON API data source for Grafana

Build Release Marketplace Downloads License Twitter

A data source plugin for loading JSON APIs into Grafana.

Screenshot

Extract one or more values from a JSON API using JSON Path. Each path results in a field in the query result. All fields need to be of the same length.

Configuration

This section lists the available configuration options for the JSON API data source.

Query editor

Configuration Description
Path Appends a URL path to the URL configured by the data source.
Query string Overrides the custom query parameters configured by the data source.
Cache Time Determines the time in seconds to save the API response.
Query Defines the JSON Path used to extract the field.
Type Defines the type of the values returned by the JSON Path query.

Variables

Variables are supported for all text configuration options.

Macros

Use macros in your query string and JSON Path queries to add dashboard context to your queries. Macros are available for the Query string and (JSON Path) Query options.

Macro Description
$__unixEpochFrom() Start of the dashboard time interval as a Unix timestamp, i.e. 1494410783
$__unixEpochTo() End of the dashboard time interval as a Unix timestamp, i.e. 1494410783

Public data sets

Here are a few publicly available JSON data sets that you can try out.

Reddit

Get information about any subreddit by adding .json at the end of the URL.

Configuration

  • URL: https://www.reddit.com/r/grafana.json

Sample queries

  • $.data.children[*].data.title
  • $.data.children[*].data.created_utc
  • $.data.children[*].data.ups

TVmaze

List episodes from your favorite TV series.

Configuration

  • URL: http://api.tvmaze.com/singlesearch/shows
  • Query string: q=archer&embed=episodes

Sample queries

  • $._embedded.episodes[*].name
  • $._embedded.episodes[*].airstamp
  • $._embedded.episodes[*].season
  • $._embedded.episodes[*].number

About

A data source plugin for loading JSON APIs into Grafana.

License:Apache License 2.0


Languages

Language:TypeScript 98.1%Language:JavaScript 1.9%