Prometheus uses GitHub to manage reviews of pull requests.
-
If you have a trivial fix or improvement, go ahead and create a pull request, addressing (with
@...) the maintainer of this repository (see MAINTAINERS.md) in the description of the pull request. -
If you plan to do something more involved, first discuss your ideas on our mailing list. This will avoid unnecessary work and surely give you and us a good deal of inspiration.
This repository uses Google Java Format to format the code.
Run ./mvnw spotless:apply to format the code (only changed files) before committing.
Or run all the linters:
mise run lint
To autofix linting issues:
mise run fix
If you're getting errors when running tests:
- Make sure that the IDE uses only the "Maven Shade" dependency of " prometheus-metrics-exposition-formats" and the "prometheus-metrics-tracer*" dependencies.
mise --cd .mise/envs/native run native-test- Use
-Dspotless.check.skip=trueto skip the formatting check during development. - Use
-Dcoverage.skip=trueto skip the coverage check during development. - Use
-Dcheckstyle.skip=trueto skip the checkstyle check during development. - Use
-Dwarnings=-nowarnto skip the warnings during development.
Combine all with
./mvnw install -DskipTests -Dspotless.check.skip=true -Dcoverage.skip=true \
-Dcheckstyle.skip=true -Dwarnings=-nowarnor simply
mise run compileExample pom.xml files (under examples/) should reference the latest
released version, not a SNAPSHOT. After each release, Renovate
updates these versions automatically.
Only use a SNAPSHOT version in an example when it demonstrates a new feature that has not been released yet.
The generated protobuf Metrics.java lives in a versioned package
(e.g., ...generated.com_google_protobuf_4_33_5) that changes with each
protobuf release. A stable extending class at
...generated/Metrics.java reexports all types so that consumer code
only imports from the version-free package. On protobuf upgrades only
the extends clause in the stable class changes.
In the failing PR from renovate, run:
mise run generateThe script will:
- Re-generate the protobuf sources with the new version.
- Update the versioned package name in all Java files
(including the stable
Metrics.javaextends clause).
Add the updated files to Git and commit them.