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

Upgrade prometheus-net to v3.x #528

Merged
merged 1 commit into from
May 18, 2020
Merged

Conversation

Daniel15
Copy link
Contributor

@Daniel15 Daniel15 commented May 18, 2020

What this PR does / why we need it:
Upgrades the Prometheus integration to use v3 of the prometheus-net library.

This is the smallest amount of code needed to change in order to upgrade prometheus-net and keep everything in its current state.

To test it, I enabled the Prometheus metric endpoint in the HealthChecks.Sample project.

There's a bit of weirdness in this project's integration into Prometheus - Instead of having its own separate endpoint that updates the metrics and returns them in Prometheus format, it should instead rely on the standard /metrics Prometheus endpoint exposed by endpoints.MapMetrics() from prometheus-net.AspNetCore, and integrate into Prometheus by using Registry.AddBeforeCollectCallback (so that Prometheus calls this library to update the metrics, rather than going the other way around). However, that can be done in a separate PR.

Please reference the issue this PR will close:
Fixes #419

Special notes for your reviewer:
N/A

Does this PR introduce a user-facing change?:
This is a breaking change as v3 of prometheus-net is not API-compatible with v2. People just using AspNetCore.Diagnostics.HealthChecks without any customisations to Prometheus (eg. adding their own metrics) will be fine, but people that have deeper integrations into Prometheus will need to upgrade their own code to use the v3 API.

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Unit tests passing
  • End-to-end tests passing
  • Extended the documentation
  • Provided sample for the feature

@unaizorrilla
Copy link
Collaborator

Looks good, I try to review/merge this week!

@unaizorrilla unaizorrilla self-requested a review May 18, 2020 07:08
@unaizorrilla unaizorrilla self-assigned this May 18, 2020
@unaizorrilla unaizorrilla added the enhancement New feature or request label May 18, 2020
@unaizorrilla unaizorrilla merged commit 5ae387d into Xabaril:master May 18, 2020
@unaizorrilla
Copy link
Collaborator

Hi @Daniel15

Thanks for this contribution, a new release build is on appveyor, when finished a new packages 3.1.3 will be on NuGet with these changes!

@sungam3r sungam3r mentioned this pull request Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prometheus-Net 3.x is not supported
2 participants