This is documentation for the next version of Grafana. For the latest stable release, go to the latest version.

Data sourcesGraphite data source

Graphite data source

Grafana includes built-in support for Graphite. This topic explains options, variables, querying, and other features specific to the Graphite data source, which include its feature-rich query editor.

For instructions on how to add a data source to Grafana, refer to the administration documentation. Only users with the organization administrator role can add data sources.

Once you’ve added the Graphite data source, you can configure it so that your Grafana instance’s users can create queries in its query editor when they build dashboards and use Explore.

Configure the data source

To access the data source configuration page:

  1. Hover the cursor over the Configuration (gear) icon.
  2. Select Data Sources.
  3. Select the Graphite data source.

Set the data source’s basic configuration options carefully:

NameDescription
NameSets the name you use to refer to the data source in panels and queries.
DefaultSets whether the data source is pre-selected for new panels. You can set only one default data source per organization.
URLSets the HTTP protocol, IP, and port of your graphite-web or graphite-api installation.
AuthFor details, refer to Configure Authentication.
Basic AuthEnables basic authentication to the data source.
UserSets the user name for basic authentication.
PasswordSets the password for basic authentication.
Custom HTTP HeadersClick Add header to add a custom HTTP header.
HeaderDefines the custom header name.
ValueDefines the custom header value.

You can also configure settings specific to the Graphite data source:

NameDescription
VersionSelect your version of Graphite.
TypeSelect your type of Graphite.

Integrate with Loki

When you change the data source selection in Explore, Graphite queries are converted to Loki queries. Grafana extracts Loki label names and values from the Graphite queries according to mappings provided in the Graphite data source configuration. Queries using tags with seriesByTags() are also transformed without any additional setup.

Provision the data source

You can define and configure the data source in YAML files as part of Grafana’s provisioning system. For more information about provisioning, and for lists of common configuration options and JSON data options, refer to Provisioning data sources.

Provisioning example

apiVersion: 1

datasources:
  - name: Graphite
    type: graphite
    access: proxy
    url: http://localhost:8080
    jsonData:
      graphiteVersion: '1.1'

Query the data source

Grafana includes a Graphite-specific query editor to help you build queries. The query editor helps you quickly navigate the metric space, add functions, and change function parameters. It can handle all types of Graphite queries, including complex nested queries through the use of query references.

For details, refer to the query editor documentation.

Use template variables

Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables. Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard. Grafana refers to such variables as template variables.

For details, see the template variables documentation.

Get Grafana metrics into Graphite

Grafana exposes metrics for Graphite on the /metrics endpoint. For detailed instructions, refer to Internal Grafana metrics.