Menu
Grafana Cloud Enterprise Open source

Configure the Graphite data source

This document provides instructions for configuring the Graphite data source and explains available configuration options. For general information on managing data sources, refer to Data source management.

Before you begin

  • You must have the Organization administrator role to configure the Graphite data source. Organization administrators can also configure the data source via YAML with the Grafana provisioning system.

  • Grafana comes with a built-in Graphite data source plugin, eliminating the need to install a plugin.

  • Familiarize yourself with your Graphite security configuration and gather any necessary security certificates and client keys.

Add the Graphite data source

To configure basic settings for the data source, complete the following steps:

  1. Click Connections in the left-side menu.
  2. Click Add new connection
  3. Type Graphite in the search bar.
  4. Select the Graphite data source.
  5. Click Add new data source in the upper right.

Grafana takes you to the Settings tab, where you will set up your Graphite configuration.

Configuration options in the UI

Following is a list of configuration options for Graphite.

SettingDescription
NameThe display name for the data source. This is how you’ll reference it in panels and queries.
Examples: graphite-1, graphite-metrics.
DefaultWhen enabled, sets this data source as the default for dashboard panels. It will be automatically selected when creating new panels.

HTTP:

SettingDescription
URLSets the HTTP protocol, IP, and port of your graphite-web or graphite-api installation.
Since the access method is set to Server, the URL must be accessible from the Grafana backend.
Allowed cookiesBy default, Grafana removes forwarded cookies. Specify cookie names here to allow them to be forwarded to the data source.
TimeoutSets the HTTP request timeout in seconds.

Auth:

SettingDescription
Basic AuthToggle on to enable basic authentication to the data source.
  UserSets the username used for basic authentication.
  PasswordEnter the password used for basic authentication.
With CredentialsToggle on to include cookies and authentication headers in cross-origin requests.
TLS Client AuthToggle on to enable TLS client authentication (both server and client are verified).
  ServerNameThe server name used to verify the hostname on the certificate returned by the server.
  Client CertClient certificate generated by a Certificate Authority (CA) or self-signed.
  Client KeyPrivate key used to encrypt communication between the client and server. Also generated by a CA or self-signed.
With CA CertToggle on to authenticate with a CA certificate.
  CA CertCA certificate used to validate the server certificate.
Skip TLS VerifyToggle on to bypass TLS certificate validation. Not recommended unless necessary or for testing purposes.
Forward OAuth IdentityToggle on to forward the user’s upstream OAuth identity to the data source. Grafana includes the access token in the request.

Custom HTTP Headers:

Pass along additional information and metadata about the request or response.

SettingDescription
HeaderAdd a custom header. This allows custom headers to be passed based on the needs of your Graphite instance.
ValueThe value of the header.

Graphite details:

SettingDescription
VersionSelect your Graphite version from the drop-down. This controls which functions are available in the Graphite query editor. Use 1.1.x for Grafana Cloud Graphite.
Graphite backend typeSelect the Graphite backend type. Choosing Metrictank enables additional features like query processing metadata. (Metrictank is a multi-tenant time series engine compatible with Graphite.) Use Default for Grafana Cloud Graphite.
Rollup indicatorToggle on to display an info icon in panel headers when data aggregation (rollup) occurs. Only available when Metrictank is selected.

Label mappings:

Label mappings are the rules you define to tell Grafana how to pull pieces of the Graphite metric path into Loki labels when switching data sources. They are currently only supported between Graphite and Loki queries.

When you change your data source from Graphite to Loki, your queries are automatically mapped based on the rules you define. To create a mapping, specify the full path of the metric and replace the nodes you want to map with label names, using parentheses. The corresponding label values are extracted from your Graphite query during the data source switch.

Grafana automatically maps all Graphite tags to labels, even if you haven’t defined explicit mappings. When using matching patterns with {}(e.g., metric.{a,b}.value), Grafana converts them to Loki’s regular expression matching syntax. If your queries include functions, Graphite extracts the relevant metrics and tags, then matches them against your mappings.

Graphite QueryMapped to Loki Query
alias(servers.west.001.cpu,1,2){cluster="west", server="001"}
alias(servers.*.{001,002}.*,1,2){server=~"(001,002)"}
interpolate(seriesByTag('foo=bar', 'server=002'), inf){foo="bar", server="002"}
SettingDescription
Private data source connectOnly for Grafana Cloud users. Establishes a private, secured connection between a Grafana Cloud stack and data sources within a private network. Use the drop-down to locate the PDC URL. For setup instructions, refer to Private data source connect (PDC) and Configure PDC. Click Manage private data source connect to open your PDC connection page and view your configuration details.

|

After configuring your Graphite data source options, click Save & test at the bottom to test the connection. You should see a confirmation dialog box that says:

Data source is working

Provision the data source

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

Example Graphite YAML provisioning file:

yaml
apiVersion: 1

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