Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

If you have contributed before, consider leaving this one for someone new, and looking through our general ideal-for-contribution issues. Thanks!

Problem

Prometheus's PushGateway support can be enabled if an additional library is present and if the management.metrics.export.prometheus.pushgateway.enabled property is set to true. Unfortunately, that last condition is not documented in the reference guide.

Solution

The "Prometheus" section of the reference guide currently contains:

When the Prometheus Pushgateway dependency is present on the classpath, Spring Boot auto-configures a PrometheusPushGatewayManager bean.

It should rather be:

When the Prometheus Pushgateway dependency is present on the classpath and the configprop:management.metrics.export.prometheus.pushgateway.enabled[] property is set to true, a PrometheusPushGatewayManager bean is auto-configured.

The documentation should be updated in src/docs/asciidoc/production-ready-features.adoc from the spring-boot-docs module.

Also, to make sure the documentation matches the expectation, an additional test should be added in PrometheusMetricsExportAutoConfigurationTests:

@Test
void pushGatewayIsNotConfiguredWhenEnabledFlagIsNotSet() {
  this.contextRunner.withUserConfiguration(BaseConfiguration.class)
      .run((context) -> assertThat(context).doesNotHaveBean(PrometheusPushGatewayManager.class));
}

Steps to Fix

  • [x] Claim this issue with a comment below and ask any clarifying questions you need
  • [x] Set up a repository locally following the Contributing Guidelines
  • [x] Try to fix the issue following the steps above
  • [x] Commit your changes and start a pull request.

Comment From: ravening

@snicoll I'm interested in working on this

Comment From: snicoll

@ravening thank you for the interest but your profile indicates that you've already contributed quite a lot and we prefer to keep this one for someone who's new to contributing and OSS in general. Feel free to look at other issues in our tracker and I am happy to assist if you need help.

Comment From: smlc

Hi @snicoll, I may could help on this I have experience working in java and springboot but never in OSS.

Comment From: snicoll

Thanks for the interest @smlc, the issue is all yours!

Comment From: smlc

Hope is good, I had some difficulty running format tests, but unit tests is good :)

Comment From: snicoll

Closing in favour of PR #22919