diff --git a/README.md b/README.md index 664d7b984..a0dbef637 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,37 @@ You can build a docker image locally with the following commands: *NB* if you are on a Mac, you will need [gnu-tar](https://formulae.brew.sh/formula/gnu-tar). +## Using Prometheus as a Go Library + +### Remote Write + +We are publishing our Remote Write protobuf independently at +[buf.build](https://buf.build/prometheus/prometheus/assets). + +You can use that as a library: + +```shell +$ go get go.buf.build/protocolbuffers/go/prometheus/prometheus +``` + +This is experimental. + +### Prometheus code base + +In order to comply with [go mod](https://go.dev/ref/mod#versions) rules, +Prometheus release number do not exactly match Go module releases. For the +Prometheus v2.y.z releases, we are publishing 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](https://semver.org/#spec-item-4). + ## React UI Development For more information on building, running, and developing on the new React-based UI, see the React app's [README.md](web/ui/README.md).