Grafana
- Pronunciation
- gruh-FAH-nuh
In short
Grafana is an open-source tool for building dashboards that turn metrics, logs and traces from many data sources into live charts and alerts in one place.
What is Grafana?
Grafana was first released in 2014 and is developed by Grafana Labs. It doesn't collect or store data itself; it connects to data sources such as Prometheus, Loki, Elasticsearch, PostgreSQL, MySQL, InfluxDB or cloud monitoring services, runs queries against them and shows the results.
A dashboard is a page of panels: line graphs of request rates, gauges for disk space, tables of slow queries, heat maps of response times or maps of traffic. Variables at the top let one dashboard switch between environments or services, and panels from different sources can sit side by side, for example metrics from Prometheus next to logs from Loki for the same minute.
Grafana also handles alerting: rules check the data and notify people through email, Slack, PagerDuty and other channels. Teams share dashboards as JSON, keep them in Git, and import thousands of community-made dashboards for common systems such as Kubernetes or Nginx.
A common misconception is that Grafana is a monitoring system on its own. It is the visualization layer; without a data source behind it, there is nothing to show. Together with Prometheus for metrics, Loki for logs and Tempo for traces, it forms a popular open-source observability stack.
Key takeaways
- Grafana builds dashboards and alerts from existing data sources.
- It connects to Prometheus, Loki, Elasticsearch, SQL databases and more.
- Panels from different sources can be combined on one dashboard.
- Dashboards are stored as JSON and can be shared or kept in Git.
- It visualizes data but doesn't collect it.
Example
# grafana/provisioning/datasources/prometheus.yml
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090
isDefault: true
# A panel can then plot, for example:
# sum(rate(http_requests_total[5m])) by (status)Readers ask
Does Grafana store data?
Mostly no. Grafana stores dashboards, users and settings, but the metrics, logs and traces it shows stay in the data sources it queries, such as Prometheus or Loki.
Is Grafana free?
Yes. Grafana is open source under the AGPLv3 license and can be self-hosted for free. Grafana Labs also offers a hosted Grafana Cloud with a free tier and an enterprise edition.
What is Grafana Loki?
A log storage system from Grafana Labs that indexes only labels rather than full text, which keeps it cheap to run. Grafana queries it to show logs next to metrics.
See also
- ObservabilityDevOps & Cloud, p. 38Observability is the ability to understand what is happening inside a running software system by collecting and analyzing its logs, metrics, and traces.
- MetricsDevOps & Cloud, p. 36Metrics are numeric measurements of a system collected over time, such as request rate, error rate and CPU usage, used for dashboards, alerts and planning.
- PrometheusDevOps & Cloud, p. 43Prometheus is an open-source monitoring system that collects metrics from apps and servers, stores them as time series and alerts when values cross a limit.
- LoggingDevOps & Cloud, p. 35Logging is the practice of recording timestamped messages about events in a running program, such as errors and requests, so people can investigate them later.
- Distributed TracingDevOps & Cloud, p. 15Distributed tracing is a technique that follows a single request as it travels through many services, recording how long each step took and where it failed.
- Time-Series DatabaseDatabases, p. 46A time-series database is a database optimized for storing and querying timestamped measurements, such as sensor readings or server metrics, in time order.
Spotted a mistake or something missing on this page?Suggest an edit