prometheus/prometheus
Tooling
The build, lint, and CI tooling specific to this repository.
The Makefile
Makefile (project-specific) and Makefile.common (shared with all prometheus/* repos via scripts/sync_repo_files.sh) drive almost everything. Useful targets:
| Target | What it does |
|---|---|
make build |
UI assets + Go binaries (default for releases). |
make test |
Go tests + UI tests + parser/UI generator checks + lint + node version check. |
make test GO_ONLY=1 |
Skip everything UI-related. |
make lint |
golangci-lint + UI lint. |
make format |
gofmt -s over the tree. |
make assets / make ui-build |
Build the React UI into web/ui/static/. |
make assets-tarball |
Produce the distributable prometheus-web-ui-<version>.tar.gz. |
make parser |
Regenerate promql/parser/generated_parser.y.go from the goyacc grammar. |
make proto |
Regenerate prompb/*.pb.go and prompb/io/.... Requires protoc (make protoc). |
make cli-documentation |
Refresh docs/command-line/{prometheus,promtool}.md. |
make generate-promql-functions |
Regenerate the UI's PromQL function helpers. |
make bench_tsdb |
Run the TSDB write benchmark and produce SVG profiles. |
make bump-go-version |
Bump the Go minor version across the repo (driven by scripts/bump_go_version.sh). |
make update-all-go-deps |
Update Go deps in the main module + four sub-modules. |
make docker |
CI-only docker build (won't fully work locally). |
promu
promu (the Prometheus build helper) is configured in .promu.yml. It produces reproducible cross-compiled tarballs and is invoked by the release pipeline. Local use:
make promu
./promu build
./promu crossbuild -p linux/amd64The build tags listed in .promu.yml (netgo, builtinassets, osusergo) are the default release tags. Edit them when you need a custom build set, e.g. to exclude service discoveries:
build:
tags:
all:
- netgo
- builtinassets
- remove_all_sd
- enable_kubernetes_sdgolangci-lint
Configuration: .golangci.yml (~250 lines). Highlights:
- Linters:
gocritic,errcheck,revive,staticcheck,whitespace,unconvert,usestdlibvars,loggercheck,perfsprint,gocheckcompilerdirectives,testifylint,goimports,nolintlint,depguard. depguardblocks several stdlib packages in favour of project-internal alternatives (e.g.regexp->grafana/regexp).reviverules enforce doc comments, exported naming, andearly-returnstyle.
CI runs golangci-lint with --timeout 4m (set in the Makefile). Local invocation:
make lintThe shared lint config in scripts/golangci-lint.yml is what other Prometheus repos pull via sync_repo_files.sh. The project-specific overrides live in .golangci.yml.
goyacc and the PromQL grammar
The PromQL parser is generated from promql/parser/generated_parser.y (a yacc grammar) using goyacc from golang.org/x/tools/cmd/goyacc@v0.6.0.
make install-goyacc # one-time
make parser # regenerate
make check-generated-parserDon't edit generated_parser.y.go by hand — regenerate.
CI workflows
Files under .github/workflows/ (14 total):
| Workflow | Trigger | What it does |
|---|---|---|
ci.yml |
PR + push to main | Tests, lint, fuzzing build, multi-arch test matrix. |
prombench.yml |
label prombench |
Performance benchmarks in a Kubernetes cluster. |
fuzzing.yml |
scheduled | Push fuzzing corpus to OSS-Fuzz. |
govulncheck.yml |
scheduled | govulncheck over the codebase. |
codeql-analysis.yml |
scheduled | GitHub CodeQL security scanning. |
scorecards.yml |
scheduled | OpenSSF Scorecard. |
repo_sync.yml |
scheduled | Sync shared files via scripts/sync_repo_files.sh. |
check_release_notes.yml |
PR | Verify the release-notes block exists. |
automerge-dependabot.yml |
dependabot | Auto-merge dependency-bump PRs after CI. |
container_description.yml |
scheduled | Sync Docker Hub / Quay descriptions. |
lock.yml |
scheduled | Lock old issues/PRs. |
stale.yml |
scheduled | Mark stale issues/PRs. |
buf-lint.yml / buf.yml |
PR | Protobuf linting via buf. |
Workflow files explicitly declare permissions: blocks. Missing permissions cause silent 403s — AGENTS.md flags this as a recurring source of bugs.
Renovate
renovate.json configures dependency-bump PRs. Both Go and npm dependencies are managed through Renovate; Dependabot is enabled only for gomod security advisories (see .github/dependabot.yml if present). The auto-merge workflow handles the resulting PRs.
Scripts
| Script | Purpose |
|---|---|
scripts/bump_go_version.sh |
Update Go versions in go.mod, CI, and Dockerfile. |
scripts/check-go-mod-version.sh |
Verify go.mod version matches the file pin. |
scripts/check-node-version.sh |
Same for Node. |
scripts/check_release_notes.sh |
Used by the release-notes workflow to validate the PR body. |
scripts/compress_assets.sh |
Gzip UI assets prior to embedding. |
scripts/generate_release_notes.sh |
Produce CHANGELOG entries from merged PRs at release time. |
scripts/genproto.sh |
Run protoc + buf-build for prompb/. |
scripts/get_module_version.sh |
Read the Go module version from the latest tag. |
scripts/npm-deps.sh |
Update npm deps to minor or latest in the workspace. |
scripts/package_assets.sh |
Package built UI assets into a tarball. |
scripts/sync_repo_files.sh |
Sync the shared boilerplate from prometheus/prometheus. |
scripts/ui_release.sh |
Bump the npm package versions used by prometheus/client_golang consumers. |
Internal tooling module
internal/tools/ is a separate Go module that pins the versions of internal tools (promu, goyacc, etc.). The Makefile uses these versions when running make install-goyacc and similar.
Related external repos
prometheus/promu— the build helper.prometheus/promci-setup— the GitHub Action used by CI to set up Go and npm.prometheus/promci-artifacts— companion action for artifact storage.prometheus/prombench— the performance benchmarking framework triggered by theprombenchlabel.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.