Welcome to our docs on Graphite + Grafana! Hosted Graphite is a fully-hosted version of Graphite + Grafana, supercharged with team accounts, long-term data storage, highly technical support, and more.
Not yet a user? Sign up for our free trial, where you can use Grafana dashboards right in the platform, with no installation or setup.
___
Hosted Graphite supports a HTTP API for Grafana which allows you to fetch, create and update your dashboards.
The majority of our users are using a customized version of Grafana where interaction via the API will only work with the endpoints specified below.
For users to whom we are providing a stock Grafana instance, all endpoints specified in Grafana’s documentation are compatible as well as those detailed below.
POST /api/v2/grafana/dashboards/ - Creates a new dashboard
Curl example:
curl -X POST https://YOUR-API-KEY@api.hostedgraphite.com/api/v2/grafana/dashboards/ \
-d @dashboard.json
Example dashboard:
{
"title": "Production Overview",
"tags": [ "templated" ],
"timezone": "browser",
"panels": [
{
}
],
"schemaVersion": 6,
"version": 0
}
This example creates a dashboard with the name “Production Overview” in accordance with the title field above.
Example response:
HTTP/1.1 200
Content-Type: application/json
{
"slug": "production-overview",
"status": "success",
"version": 1
}
Status Codes:
PUT /api/v2/grafana/dashboards/ - Updates existing dashboard
Curl example:
curl -X PUT https://YOUR-API-KEY@api.hostedgraphite.com/api/v2/grafana/dashboards/ \
-d @dashboard.json
Example dashboard:
{
"id": 1
"title": "Production Overview",
"tags": [ "templated", "prod" ],
"timezone": "browser",
"panels": [
{
}
],
"schemaVersion": 6,
"message": "version control message" // this is optional
}
Note: Grafana 4.4 introduced dashboard version control. You can optionally include messages with your dashboard updates via the API by including a message key and value, demonstrated in the above example. The message for dashboard creation will always be Initial Save.
Example response:
HTTP/1.1 200
Content-Type: application/json
{
"slug": "production-overview",
"status": "success",
"version": 2
}
Status Codes:
GET /api/v2/grafana/dashboards/:slug - Returns a dashboard given the dashboard slug, a url friendly version of the dashboard title.
Curl example:
curl -X GET https://YOUR-API-KEY@api.hostedgraphite.com/api/v2/grafana/dashboards/production-overview
Example response:
HTTP/1.1 200
Content-Type: application/json
{
"meta": {
"isStarred": false,
"slug": "production-overview"
},
"model": {
"id": null,
"title": "Production Overview",
"tags": [ "templated" ],
"timezone": "browser",
"panels": [
{
}
]
"schemaVersion": 6,
"version": 0
},
}
Status Codes:
DELETE /api/v2/grafana/dashboards/:slug - Deletes a dashboard given the dashboard slug.
Curl example:
curl -X DELETE https://YOUR-API-KEY@api.hostedgraphite.com/api/v2/grafana/dashboards/production-overview
Example response:
HTTP/1.1 200
Content-Type: application/json
{"title": "Production Overview"}
Status Codes:
GET /api/v2/grafana/tags - Get all tags of dashboards.
Curl example:
curl -X GET https://YOUR-API-KEY@api.hostedgraphite.com/api/v2/grafana/tags
Example response:
HTTP/1.1 200
Content-Type: application/json
[
{
"term":"templated",
"count":1
},
{
"term":"production",
"count":4
}
]
Status Codes:
GET /api/v2/grafana/search - Returns a list of dashboards given a search query.
Curl example:
curl -i -X GET https://YOUR-API-KEY@api.hostedgraphite.com/api/v2/grafana/search?query=prod
Example response:
HTTP/1.1 200
Content-Type: application/json
[
{
"id":1,
"title":"Production Overview",
"uri":"db/production-overview",
"type":"dash-db",
"tags":[ templated, production ],
"isStarred":true
},
{
"id":4,
"title":"Production Webservers",
"uri":"db/production-webservers",
"type":"dash-db",
"tags":[ production ],
"isStarred":true
}
]
Status Codes:
GET /api/v2/grafana/render/?target=foo.bar - Returns a link to a publicly accessible .PNG image of a Grafana graph
Curl Example:
curl -i -X GET "https://<api-key>@api.hostedgraphite.com/api/v2/grafana/render/?target=foo.bar"
Example response:
HTTP/1.1 200
Content-Type: application/json
http://i.mfhg.io/render-api/<user-id>/<filename>.png
Status Codes:
To display any data on the graph you must include a ‘target’, you can append multiple targets to the request as follows:
?target=foo.bar.A&target=foo.bar.B
Available Parameters (default values in brackets):
Time Queries: