The Prometheus monitoring system and time series database. https://prometheus.io/
  • Go 88%
  • TypeScript 9.9%
  • Python 0.8%
  • Yacc 0.4%
  • Shell 0.3%
  • Other 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Walther Lee ccdfcea899
Merge pull request #20406 from waltherlee/make-sharded-and-sorted-postings-ctx-aware
tsdb: Make SortedPostings and ShardedPostings context aware
2026-11-27 11:24:57 +01:00
.agents/skills chore: fix pr-triage-board wording for reviews from non-maintainers 2026-11-10 23:37:52 +03:00
.github Update pnpm/action-setup action to v6.1.1 (#20378) 2026-11-25 11:24:53 +01:00
cmd cmd/prometheus: pass --scrape.discovery-reload-interval=100ms in scrape tests 2026-11-20 16:56:48 +01:00
compliance chore(deps): update Go dependencies for 3.17 (#20587) 2026-11-26 15:34:51 +00:00
config feat(storage/remote): add remote_write mode for stateless and stateless-st (#20098) 2026-10-30 09:40:35 +00:00
discovery discovery/kubernetes: add __meta_kubernetes_service_loadbalancer_ips (#20411) 2026-11-19 10:31:54 +00:00
docs storage/remote: coalesce exemplars onto matching v2 TimeSeries in batch (#20070) 2026-11-26 12:14:51 +00:00
documentation chore(deps): update Go dependencies for 3.17 (#20587) 2026-11-26 15:34:51 +00:00
internal/tools chore(deps): update Go dependencies for 3.17 (#20587) 2026-11-26 15:34:51 +00:00
model textparse: unescape exemplar label values in OpenMetrics parser (#20302) 2026-11-19 09:10:59 +00:00
notifier Release 3.15.1 2026-10-21 14:32:31 +02:00
plugins build(plugins): add OCI SD plugin 2026-06-13 14:50:55 +05:00
prompb prompb/write/v2[PERF]: speed up SymbolsTable empty lookup and Reset (#20310) 2026-11-19 09:10:07 +00:00
promql promql [PERF]: evaluate simple unary float functions and selector timestamps on matrices (#20355) 2026-11-23 15:20:35 +00:00
rules rules: deduce metric metadata for recording rules (#20274) 2026-11-13 15:47:48 +00:00
schema relabel,scrape: support metric metadata manipulation via relabeling (PROM-104) (#20101) 2026-11-10 05:17:53 +00:00
scrape scrape [PERF]: reuse storage labels on cold scrape cache (#20318) 2026-11-17 19:40:13 +00:00
scripts chore: fix the 3.16.0 changelog and harden the release version bump (#20356) 2026-11-06 18:19:24 +01:00
storage api: honor search cancellation and report timeouts (#19991) 2026-11-27 09:50:34 +01:00
template template: dont truncate IPv6 zone identifiers in stripDomain 2026-10-04 12:25:47 +05:30
tracing fix(deps): update module github.com/grpc-ecosystem/grpc-gateway/v2 to v2.30.0 (#19496) 2026-08-27 06:01:55 +00:00
tsdb Merge pull request #20406 from waltherlee/make-sharded-and-sorted-postings-ctx-aware 2026-11-27 11:24:57 +01:00
util api: honor search cancellation and report timeouts (#19991) 2026-11-27 09:50:34 +01:00
web api: honor search cancellation and report timeouts (#19991) 2026-11-27 09:50:34 +01:00
.dockerignore Fix dockerignore sync (#18488) 2026-04-10 07:19:58 +02:00
.gitattributes model/textparse: implement OM2 scrape format (#18606) 2026-08-27 10:10:19 +02:00
.gitignore chore(UI): Move to pnpm 2026-06-11 14:13:28 +02:00
.golangci.yml replace deprecated gofumpt extra-rules setting (#19758) 2026-09-21 08:59:51 +02:00
.promu.yml chore: Update go to 1.27 2026-08-24 11:02:36 +02:00
.yamllint Add note in synced files (#19186) 2026-07-14 11:54:26 +00:00
AGENTS.md docs: require raw benchstat output and commit links in AGENTS.md (#20332) 2026-11-05 10:57:02 +00:00
CHANGELOG.md chore: fix the 3.16.0 changelog and harden the release version bump (#20356) 2026-11-06 18:19:24 +01:00
CLAUDE.md Tell Claude to read it too 2026-03-12 11:11:31 +00:00
CODE_OF_CONDUCT.md Update link for referenced CNCF code of conduct (#10664) 2022-05-03 18:32:23 +02:00
CODEOWNERS chore: remove Julian Tölle from Hetzner maintainers 2026-10-19 17:28:57 +02:00
CONTRIBUTING.md docs: document review rules for AI bot pull requests in CONTRIBUTING.md (#20357) 2026-11-07 22:51:34 +00:00
Dockerfile build: embed bundled web UI licenses instead of shipping a tarball 2026-06-22 12:31:27 +02:00
Dockerfile.distroless build: embed bundled web UI licenses instead of shipping a tarball 2026-06-22 12:31:27 +02:00
go.mod chore(deps): update Go dependencies for 3.17 (#20587) 2026-11-26 15:34:51 +00:00
go.sum chore(deps): update Go dependencies for 3.17 (#20587) 2026-11-26 15:34:51 +00:00
go.work security: bump go to 1.26.10 (#20156) 2026-10-23 08:09:33 +00:00
LICENSE Clean up license issues. 2015-01-21 20:07:45 +01:00
MAINTAINERS.md Merge pull request #20077 from hetznercloud/remove-julian-from-maintainers 2026-10-26 07:00:26 +01:00
Makefile chore: fix the 3.16.0 changelog and harden the release version bump (#20356) 2026-11-06 18:19:24 +01:00
Makefile.common build: create manifests with buildx imagetools (#20229) 2026-11-02 14:20:19 -05:00
NOTICE build: embed bundled web UI licenses instead of shipping a tarball 2026-06-22 12:31:27 +02:00
README.md docs: fix broken link to prometheus/client_golang in README 2026-10-20 22:05:16 -03:00
RELEASE.md chore: fix the 3.16.0 changelog and harden the release version bump (#20356) 2026-11-06 18:19:24 +01:00
renovate.json ci: tidy dependent Go modules in Renovate PRs (#20566) 2026-11-25 10:03:05 +01:00
SECURITY-INSIGHTS.yml chore: provide OSSF security insight 2024-07-31 06:36:02 +00:00
SECURITY.md Fix markdown format (#18505) 2026-04-10 10:23:24 +02:00
VERSION Release 3.16.0 2026-11-04 13:38:40 -05:00

Prometheus
Prometheus

Visit prometheus.io for the full documentation, examples and guides.

CI Docker Repository on Quay Docker Pulls CII Best Practices govulncheck OpenSSF Scorecard CLOMonitor Fuzzing Status

Prometheus, a Cloud Native Computing Foundation project, is a systems and service monitoring system. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts when specified conditions are observed.

The features that distinguish Prometheus from other metrics and monitoring systems are:

  • A multi-dimensional data model (time series defined by metric name and set of key/value dimensions)
  • PromQL, a powerful and flexible query language to leverage this dimensionality
  • No dependency on distributed storage; single server nodes are autonomous
  • An HTTP pull model for time series collection
  • Pushing time series is supported via an intermediary gateway for batch jobs
  • Targets are discovered via service discovery or static configuration
  • Multiple modes of graphing and dashboarding support
  • Support for hierarchical and horizontal federation

Architecture overview

Architecture overview

Install

There are various ways to install Prometheus.

Precompiled binaries

Precompiled binaries for released versions are available in the download section on prometheus.io. Using the latest production release binary is the recommended way to install Prometheus. See the Installing chapter in the documentation for all the details.

Docker images

Docker images are available on Quay.io or Docker Hub.

You can launch a Prometheus container for trying it out with

docker run --name prometheus -d -p 127.0.0.1:9090:9090 prom/prometheus

Prometheus will now be reachable at http://localhost:9090/.

Building from source

To build Prometheus from source code, you need:

  • Go: Version specified in go.mod or greater.
  • NodeJS: Version specified in .nvmrc or greater.
  • npm: Version 10 or greater (check with npm --version and here).

Start by cloning the repository:

git clone https://github.com/prometheus/prometheus.git
cd prometheus

You can use the go tool to build and install the prometheus and promtool binaries into your GOPATH:

go install github.com/prometheus/prometheus/cmd/...
prometheus --config.file=your_config.yml

However, when using go install to build Prometheus, Prometheus will expect to be able to read its web assets from local filesystem directories under web/ui/static. In order for these assets to be found, you will have to run Prometheus from the root of the cloned repository. Note also that this directory does not include the React UI unless it has been built explicitly using make assets or make build.

An example of the above configuration file can be found here.

You can also build using make build, which will compile in the web assets so that Prometheus can be run from anywhere:

make build
./prometheus --config.file=your_config.yml

The Makefile provides several targets:

  • build: build the prometheus and promtool binaries (includes building and compiling in web assets)
  • test: run the tests
  • test-short: run the short tests
  • format: format the source code
  • vet: check the source code for common errors
  • assets: build the React UI

Service discovery plugins

Prometheus is bundled with many service discovery plugins. You can customize which service discoveries are included in your build using Go build tags.

To exclude service discoveries when building with make build, add the desired tags to the .promu.yml file under build.tags.all:

build:
    tags:
        all:
            - netgo
            - builtinassets
            - remove_all_sd           # Exclude all optional SDs
            - enable_kubernetes_sd    # Re-enable only kubernetes

Then run make build as usual. Alternatively, when using go build directly:

go build -tags "remove_all_sd,enable_kubernetes_sd" ./cmd/prometheus

Available build tags:

  • remove_all_sd - Exclude all optional service discoveries (keeps file_sd, static_sd, and http_sd)
  • enable_<name>_sd - Re-enable a specific SD when using remove_all_sd

If you add out-of-tree plugins, which we do not endorse at the moment, additional steps might be needed to adjust the go.mod and go.sum files. As always, be extra careful when loading third party code.

Building the Docker image

You can build a docker image locally with the following commands:

make promu
promu crossbuild -p linux/$(go env GOHOSTARCH)
make common-docker-current-arch

To build for a different architecture, replace $(go env GOHOSTARCH) with one of the architectures in DOCKER_ARCHS from Makefile.common, such as amd64, and run the corresponding make common-docker-<architecture> target.

The make docker target is intended only for use in our CI system and will not produce a fully working image when run locally.

Using Prometheus as a Go Library

Within the Prometheus project, repositories such as prometheus/common and prometheus/client_golang are designed as reusable libraries.

The prometheus/prometheus repository builds a stand-alone program and is not designed for use as a library. We are aware that people do use parts as such, and we do not put any deliberate inconvenience in the way, but we want you to be aware that no care has been taken to make it work well as a library. For instance, you may encounter errors that only surface when used as a library.

Remote Write

We are publishing our Remote Write protobuf independently at buf.build.

You can use that as a library:

go get buf.build/gen/go/prometheus/prometheus/protocolbuffers/go@latest

This is experimental.

Prometheus code base

In order to comply with go mod rules, Prometheus release number do not exactly match Go module releases.

For the Prometheus v3.y.z releases, we are publishing equivalent v0.3y.z tags. The y in v0.3y.z is always padded to two digits, with a leading zero if needed.

Therefore, a user that would want to use Prometheus v3.0.0 as a library could do:

go get github.com/prometheus/prometheus@v0.300.0

For the Prometheus v2.y.z releases, we published the equivalent v0.y.z tags.

Therefore, a user that would want to use Prometheus v2.35.0 as a library could do:

go get github.com/prometheus/prometheus@v0.35.0

This solution makes it clear that we might break our internal Go APIs between minor user-facing releases, as breaking changes are allowed in major version zero.

React UI Development

For more information on building, running, and developing on the React-based UI, see the React app's README.md.

More information

  • Godoc documentation is available via pkg.go.dev. Due to peculiarities of Go Modules, v3.y.z will be displayed as v0.3y.z (the y in v0.3y.z is always padded to two digits, with a leading zero if needed), while v2.y.z will be displayed as v0.y.z.
  • See the Community page for how to reach the Prometheus developers and users on various communication channels.

Contributing

Refer to CONTRIBUTING.md

License

Apache License 2.0, see LICENSE.