2022-05-26 10:06:25 -05:00
---
aliases:
2022-12-09 10:36:04 -06:00
- ../admin/metrics/
- ../administration/jaeger-instrumentation/
- ../administration/view-server/internal-metrics/
2022-06-02 11:57:22 -05:00
description: Jaeger traces emitted and propagation by Grafana
2022-05-26 10:06:25 -05:00
keywords:
- grafana
2022-06-02 11:57:22 -05:00
- jaeger
- tracing
Explicitly set all front matter labels in the source files (#71548)
* Set every page to have defaults of 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration pages to have of 'Cloud', 'Enterprise', and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/enterprise-licensing pages to have 'Enterprise' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/organization-management pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/provisioning pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/recorded-queries pages to have labels cloud,enterprise
* Set administration/roles-and-permissions/access-control pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/stats-and-license pages to have labels cloud,enterprise
* Set alerting pages to have labels cloud,enterprise,oss
* Set breaking-changes pages to have labels cloud,enterprise,oss
* Set dashboards pages to have labels cloud,enterprise,oss
* Set datasources pages to have labels cloud,enterprise,oss
* Set explore pages to have labels cloud,enterprise,oss
* Set fundamentals pages to have labels cloud,enterprise,oss
* Set introduction/grafana-cloud pages to have labels cloud
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix introduction pages products
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set panels-visualizations pages to have labels cloud,enterprise,oss
* Set release-notes pages to have labels cloud,enterprise,oss
* Set search pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/audit-grafana pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-authentication pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/configure-authentication/enhanced-ldap pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-authentication/saml pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-request-security pages to have labels cloud,enterprise,oss
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-team-sync pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/export-logs pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set troubleshooting pages to have labels cloud,enterprise,oss
* Set whatsnew pages to have labels cloud,enterprise,oss
* Apply updated labels from review
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-07-18 03:10:12 -05:00
labels:
products:
- enterprise
- oss
2022-06-02 11:57:22 -05:00
title: Set up Grafana monitoring
weight: 800
2022-05-26 10:06:25 -05:00
---
2017-09-07 10:37:01 -05:00
2022-06-02 11:57:22 -05:00
# Set up Grafana monitoring
2023-03-07 09:13:59 -06:00
Grafana supports tracing.
2022-06-02 11:57:22 -05:00
2023-03-07 09:13:59 -06:00
Grafana can emit Jaeger or OpenTelemetry Protocol (OTLP) traces for its HTTP API endpoints and propagate Jaeger and [w3c Trace Context ](https://www.w3.org/TR/trace-context/ ) trace information to compatible data sources.
2022-06-02 11:57:22 -05:00
All HTTP endpoints are logged evenly (annotations, dashboard, tags, and so on).
When a trace ID is propagated, it is reported with operation 'HTTP /datasources/proxy/:id/\*'.
2023-05-18 09:50:20 -05:00
Refer to [Configuration's OpenTelemetry section ]({{< relref "./configure-grafana#tracingopentelemetry" >}} ) for a reference of tracing options available in Grafana.
2022-06-02 11:57:22 -05:00
## View Grafana internal metrics
2017-09-07 10:37:01 -05:00
2020-04-17 09:37:09 -05:00
Grafana collects some metrics about itself internally. Grafana supports pushing metrics to Graphite or exposing them to be scraped by Prometheus.
2017-09-07 10:37:01 -05:00
2023-05-18 09:50:20 -05:00
For more information about configuration options related to Grafana metrics, refer to [metrics ]({{< relref "./configure-grafana#metrics" >}} ) and [metrics.graphite ]({{< relref "./configure-grafana#metricsgraphite" >}} ) in [Configuration ]({{< relref "./configure-grafana" >}} ).
2020-04-17 09:37:09 -05:00
2022-06-02 11:57:22 -05:00
### Available metrics
2020-04-17 09:37:09 -05:00
When enabled, Grafana exposes a number of metrics, including:
2020-10-02 13:02:11 -05:00
- Active Grafana instances
- Number of dashboards, users, and playlists
- HTTP status codes
- Requests by routing group
- Grafana active alerts
- Grafana performance
2020-04-17 09:37:09 -05:00
2022-06-02 11:57:22 -05:00
### Pull metrics from Grafana into Prometheus
2020-04-17 09:37:09 -05:00
These instructions assume you have already added Prometheus as a data source in Grafana.
2020-11-09 14:26:49 -06:00
1. Enable Prometheus to scrape metrics from Grafana. In your configuration file (`grafana.ini` or `custom.ini` depending on your operating system) remove the semicolon to enable the following configuration options:
2020-04-17 09:37:09 -05:00
```
2022-03-29 04:18:26 -05:00
# Metrics available at HTTP URL /metrics and /metrics/plugins/:pluginId
2020-04-17 09:37:09 -05:00
[metrics]
# Disable / Enable internal metrics
enabled = true
# Disable total stats (stat_totals_*) metrics to be generated
disable_total_stats = false
```
2022-03-29 04:18:26 -05:00
1. (optional) If you want to require authorization to view the metrics endpoints, then uncomment and set the following options:
2020-04-17 09:37:09 -05:00
```
basic_auth_username =
basic_auth_password =
```
1. Restart Grafana. Grafana now exposes metrics at http://localhost:3000/metrics.
1. Add the job to your prometheus.yml file.
Example:
```
- job_name: 'grafana_metrics'
scrape_interval: 15s
scrape_timeout: 5s
2020-11-09 14:26:49 -06:00
2020-04-17 09:37:09 -05:00
static_configs:
- targets: ['localhost:3000']
```
2021-08-06 08:52:36 -05:00
2020-04-17 09:37:09 -05:00
1. Restart Prometheus. Your new job should appear on the Targets tab.
1. In Grafana, hover your mouse over the **Configuration** (gear) icon on the left sidebar and then click **Data Sources** .
1. Select the **Prometheus** data source.
1. On the Dashboards tab, **Import** the Grafana metrics dashboard. All scraped Grafana metrics are available in the dashboard.
2022-06-02 11:57:22 -05:00
### View Grafana metrics in Graphite
2020-04-17 09:37:09 -05:00
These instructions assume you have already added Graphite as a data source in Grafana.
2020-11-09 14:26:49 -06:00
1. Enable sending metrics to Graphite. In your configuration file (`grafana.ini` or `custom.ini` depending on your operating system) remove the semicolon to enable the following configuration options:
2020-04-17 09:37:09 -05:00
```
# Metrics available at HTTP API Url /metrics
[metrics]
# Disable / Enable internal metrics
enabled = true
# Disable total stats (stat_totals_*) metrics to be generated
disable_total_stats = false
```
1. Enable [metrics.graphite] options:
2021-08-06 08:52:36 -05:00
2020-04-17 09:37:09 -05:00
```
# Send internal metrics to Graphite
[metrics.graphite]
# Enable by setting the address setting (ex localhost:2003)
address = < hostname or ip > :< port # >
prefix = prod.grafana.%(instance_name)s.
```
1. Restart Grafana. Grafana now exposes metrics at http://localhost:3000/metrics and sends them to the Graphite location you specified.
2022-03-29 04:18:26 -05:00
2022-06-02 11:57:22 -05:00
### Pull metrics from Grafana backend plugin into Prometheus
2022-03-29 04:18:26 -05:00
2023-09-29 01:43:48 -05:00
Any installed [backend plugin ](/developers/plugin-tools/introduction/backend-plugins ) exposes a metrics endpoint through Grafana that you can configure Prometheus to scrape.
2022-03-29 04:18:26 -05:00
These instructions assume you have already added Prometheus as a data source in Grafana.
1. Enable Prometheus to scrape backend plugin metrics from Grafana. In your configuration file (`grafana.ini` or `custom.ini` depending on your operating system) remove the semicolon to enable the following configuration options:
```
# Metrics available at HTTP URL /metrics and /metrics/plugins/:pluginId
[metrics]
# Disable / Enable internal metrics
enabled = true
# Disable total stats (stat_totals_*) metrics to be generated
disable_total_stats = false
```
1. (optional) If you want to require authorization to view the metrics endpoints, then uncomment and set the following options:
```
basic_auth_username =
basic_auth_password =
```
2023-05-18 09:50:20 -05:00
1. Restart Grafana. Grafana now exposes metrics at `http://localhost:3000/metrics/plugins/<plugin id>` , e.g. http://localhost:3000/metrics/plugins/grafana-github-datasource if you have the [Grafana GitHub datasource ](/grafana/plugins/grafana-github-datasource/ ) installed.
2022-03-29 04:18:26 -05:00
1. Add the job to your prometheus.yml file.
Example:
```
- job_name: 'grafana_github_datasource'
scrape_interval: 15s
scrape_timeout: 5s
metrics_path: /metrics/plugins/grafana-test-datasource
static_configs:
- targets: ['localhost:3000']
```
1. Restart Prometheus. Your new job should appear on the Targets tab.
1. In Grafana, hover your mouse over the **Configuration** (gear) icon on the left sidebar and then click **Data Sources** .
1. Select the **Prometheus** data source.
2023-05-18 09:50:20 -05:00
1. Import a Golang application metrics dashboard - for example [Go Processes ](/grafana/dashboards/6671 ).