Topics Discussed:
- What is Prometheus
- Advantages
- Architecture
- Data Model
- Querying
- Operational Simplicity
- Efficiency
- Decoupled Remote Storage
- Service Discovery
What is Prometheus?
Prometheus is a metrics based monitoring and alert stack. It is used for Instrumentation, metric collection and storage,Querying,alerting and dashboarding. It can be implemented for all levels of stack. It is made for dynamic cloud environments.
Advantages
1.Dimentional data model
2.Powerful query language
3.Simple and efficient server
4.Service discovery integration
5.Many client libraries and integration
6.Many client libraries & Integrations.
Architecture
A typical monitoring platform with Prometheus is composed of multiple tools:
Prometheus server : the main Prometheus server which scrapes and stores time series data
Client libraries : client libraries for instrumenting application code
Push gateway : a push gateway for supporting short-lived jobs
Exporters : special-purpose exporters for services like HAProxy, StatsD, Graphite, etc.
Alertmanager : an alertmanager to handle alerts
Data Model
<identifier> -> [(t0,v0),(t1,v1),..]
Timestamp : int64(milliseconds UNIX timestamp)
Value : float64
Querying
Prometheus provides a functional language called PromQL(Prometheus Query Language).It is a new query language which is great for time series computations. It is not SQL style.
Operational Simplicity
Prometheus stores data locally on disk, which helps for fast data storage and fast querying but the ability to store metrics is in remote storage.
Efficiency
1)Local storage is scalable enough for many organizations
2)Good for keeping a few months of data.
Decoupled Remote Storage
External storage is also an option. There are many choices, such as Thanos, Cortex, and InfluxDB that provide a variety of benefits. One of the primary benefits is the centralization of the gathered metrics and long term storage. Tools such as Grafana can query these third-party storage solutions directly.
Service Discovery
Use service discovery to know what should be there, decide where to pull from, and add dimensional metadata to series.