Monitor server and service metrics and receive immediate alerts for anomalies
You can receive alerts before servers become overloaded or services stop. Prometheus is a tool that collects metrics from targets at set intervals, calculates results based on configured rules, and displays them on a screen or triggers warnings. As a Cloud Native Computing Foundation (CNCF) project, it is designed to operate independently on a single server without relying on a distributed store.
Data structure and collection methods
Prometheus uses a multidimensional data model that defines time-series data by metric names and dimensions consisting of key/value pairs. To utilize this structure, it provides the PromQL query language, allowing you to query data by combining complex conditions. It collects metrics at time intervals via an HTTP pull model and supports push through an intermediate gateway for cases requiring push, such as batch jobs. You can automatically find or directly specify collection targets through service discovery or static configuration.
Installation and build methods
The most recommended installation method is to use the latest production release binary from the download section of prometheus.io. To use the Docker image, run the docker run --name prometheus -d -p 127.0.0.1:9090:9090 prom/prometheus command to make it accessible locally. To build from source, Go, NodeJS, and npm are required, and running the make build command generates a binary with compiled web assets. You can include or exclude specific service discovery plugins using build tags.
Considerations when using as a library
The Prometheus repository is designed as a standalone program and has not been optimized for use as a Go library. Care is needed when using some code as a library, as it may cause unintended errors. The Remote Write protocol is published independently on buf.build and is in an experimental stage. Go module versions do not exactly match Prometheus release numbers; v3.y.z releases are published with v0.3y.z tags, and v2.y.z releases are published with v0.y.z tags.
Suitable environments and verification items
It is suitable for environments where system and service monitoring is needed and you want to manage data autonomously on a single node. It is useful if building distributed storage infrastructure is burdensome or if you prefer an HTTP pull-based collection model. It follows the Apache License 2.0, and building from source requires meeting specific version requirements for Go and NodeJS. When customizing service discovery plugins, you must ensure that Go build tags are set correctly.