Grafana
Topic
What is grafana? what makes it different from a tool like sentry and how can I use it as effectively as possible?
Conjecture
Ok, so as I understand it, Grafana is an open source tool and UI for parsing data. In general, this data is a live feed coming from an application or server. The most common uses for it are to allow users to query log data coming from an application or visualize metrics that are being generated from an application. Essentially, though, Grafana is a data store that allows data from the feeds to be parsed, visualized, and queried.
Grafana is the overall piece of software, and then inside of it, there are sub-modules: Prometheus for data visualization and recording metrics, and then Loki for parsing log data.
Research
So basically, my conjecture was correct. The purpose of grafana is to “Collect, correlate, and visualize data.”
It allows you to query, visualize, and alert on, and explore: metrics, logs and traces from a data source that your can configure.
So I was kind of wrong about the submodules. Technically, Prometheus and Loki are data source plugins. Prometheus is a time series database and loki is a logging tool. So they are data sources that grafana can use. However, grafana isn’t limited to this it also has plugins for NoSQL/SQL, CI/CD tooling and more.
At its core Grafana is an open source project, but the company that develops it offers a cloud hosted version of the app called Grafana Cloud.
The main connector between this cloud-deployed version and your deployment/data source is called Grafana Alloy.
The most important data plugin for Grafana is arguably prometheus.
Prometheus is a core technology for monitoring and observability of systems. It is essentially a data model and a query language and was first implement at Soundcloud, so technically it is independent of Grafana.
Observability of a system is mostly about understand the state of a system at a specific instance. Thus prometheus is essentially a technology for storing time series data. The core data model for prometheus is composed of:
- Metrics - Essentially a timestamp and a metric or sample
- Label sets - There are called dimensions for example job or device.
Thus, you can associate your metrics with specific labels in a set. You can technically store time series data in any DB, but Prometheus is optimized specifically for time series data. It also has its own query language, PromQL for efficiently querying.