Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the need to switch to io.micrometer:micrometer-registry-prometheus-simpleclient to use the Prometheus push gateway #40993

Closed
pvdlageweg opened this issue Jun 5, 2024 · 1 comment
Assignees
Labels
type: documentation A documentation update
Milestone

Comments

@pvdlageweg
Copy link

When I try to use the Prometheus push gateway in Spring Boot version 3.3.0 as described in the documentation I get the error

Parameter 0 of constructor in com.example.demo.Service required a bean of type 'org.springframework.boot.actuate.metrics.export.prometheus.PrometheusPushGatewayManager' that could not be found.

When changing the micrometer.version to 1.21.1 everything works as expected. I've created an example project to demonstrate the issue: https://github.com/pvdlageweg/spring-boot-push-gateway-not-working/tree/main

Simple run with mvn spring-boot:run to see the error. Uncomment line 18 in the pom.xml and run again and the error is gone.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 5, 2024
@wilkinsona
Copy link
Member

This is covered in the release notes:

Spring Boot 3.3 includes support for the Prometheus Client 1.x. This release of the client contains some breaking changes, e.g. changes to the exported metric names. Use of the Prometheus Push Gateway is not supported with the 1.x client, until this support has been added from the Prometheus maintainers.

If you want to continue to use the 0.x version of the Prometheus client, remove io.micrometer:micrometer-registry-prometheus from your dependencies and add io.micrometer:micrometer-registry-prometheus-simpleclient instead. Spring Boot contains auto-configuration for simpleclient in a deprecated form which will be removed in Spring Boot 3.5.0.

We should update the reference documentation to note the need to downgrade to 0.x if you want to use the push gateway.

@wilkinsona wilkinsona changed the title Prometheus push gateway not working Document the need to switch to io.micrometer:micrometer-registry-prometheus-simpleclient to use the Prometheus push gateway Jun 5, 2024
@wilkinsona wilkinsona added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 5, 2024
@wilkinsona wilkinsona added this to the 3.3.x milestone Jun 5, 2024
@mhalbritter mhalbritter self-assigned this Jun 7, 2024
@mhalbritter mhalbritter modified the milestones: 3.3.x, 3.3.1 Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

4 participants