Project: Grafana (Observability and Analysis / Observability)
File: set-up-grafana-monitoring.md

aliases: ../admin/metrics/ ../administration/jaeger-instrumentation/ ../administration/view-server/internal-metrics/ description: Jaeger traces emitted and propagation by Grafana keywords: grafana jaeger tracing labels: products: enterprise oss title: Set up Grafana monitoring weight: 800 Grafana supports tracing. Grafana can emit Jaeger or OpenTelemetry Protocol (OTLP) traces for its HTTP API endpoints and propagate Jaeger and trace information to compatible data sources. 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/\*'. Refer to for a reference of tracing options available in Grafana. Grafana collects some metrics about itself internally. Grafana supports pushing metrics to Graphite or exposing them to be scraped by Prometheus. For more information about configuration options related to Grafana metrics, refer to and in . When enabled, Grafana exposes a number of metrics, including: Active Grafana instances Number of dashboards, users, and playlists HTTP status codes Requests by routing group Grafana active alerts Grafana performance These instructions assume you have already added Prometheus as a data source in Grafana. 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: ``` [metrics] enabled = true disabletotalstats = false ``` (optional) If you want to require authorization to view the metrics endpoints, then uncomment and set the following options: ``` basicauthusername = basicauthpassword = ``` Restart Grafana. Grafana now exposes metrics at http://localhost:3000/metrics. Add the job to your prometheus.yml file. Example: ``` jobname: 'grafanametrics' scrape_interval: 15s scrape_timeout: 5s static_configs: targets: ['localhost:3000'] ``` Restart Prometheus. Your new job should appear on the Targets tab. In Grafana, hover your mouse over the Configuration (gear) icon on the left sidebar and then click Data Sources. Select the Prometheus data source. On the Dashboards tab, Import the Grafana metrics dashboard. All scraped Grafana metrics are available in the dashboard. These instructions assume you have already added Graphite as a data source in Grafana. 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: ``` [metrics] enabled = true disabletotalstats = false ``` Enable [metrics.graphite] options: ``` [metrics.graphite] address = <hostname or ip>:<port#> prefix = prod.grafana.%(instance_name)s. ``` Restart Grafana. Grafana now exposes metrics at http://localhost:3000/metrics and sends them to the Graphite location you specified. Any installed exposes a metrics endpoint through Grafana that you can configure Prometheus to scrape. These instructions assume you have already added Prometheus as a data source in Grafana. 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] enabled = true disabletotalstats = false ``` (optional) If you want to require authorization to view the metrics endpoints, then uncomment and set the following options: ``` basicauthusername = basicauthpassword = ``` 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 installed. Add the job to your prometheus.yml file. Example: ``` jobname: 'grafanagithub_datasource' scrape_interval: 15s scrape_timeout: 5s metrics_path: /metrics/plugins/grafana-test-datasource static_configs: targets: ['localhost:3000'] ``` Restart Prometheus. Your new job should appear on the Targets tab. In Grafana, hover your mouse over the Configuration (gear) icon on the left sidebar and then click Data Sources. Select the Prometheus data source. Import a Golang application metrics dashboard - for example .