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

refactor: default to prometheus.DefaultRegisterer #722

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lidel
Copy link
Member

@lidel lidel commented Nov 18, 2024

This PR contains changes on top of #718

It replaces prometheus.NewRegistry() calls with prometheus.DefaultRegisterer to ensure that by default boxo users who do not specify an explicit registry are not missing some of the metrics.

This convention is what go-libp2p does already, and I feel boxo should follow, to remove confusion why some metrics are present, and some are missing.

TODO

@lidel lidel requested a review from 2color November 18, 2024 22:05
@lidel lidel changed the title refactor: remove prometheus.NewRegistry() refactor: defult to prometheus.DefaultRegisterer Nov 18, 2024
@lidel lidel force-pushed the use-default-metrics-registry branch 3 times, most recently from 119816e to fb39749 Compare November 18, 2024 22:40
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Project coverage is 60.37%. Comparing base (1bf1488) to head (edd18aa).

Files with missing lines Patch % Lines
gateway/blockstore.go 0.00% 1 Missing ⚠️
routing/http/server/server.go 0.00% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #722      +/-   ##
==========================================
+ Coverage   60.34%   60.37%   +0.03%     
==========================================
  Files         243      243              
  Lines       31039    31044       +5     
==========================================
+ Hits        18730    18744      +14     
+ Misses      10644    10633      -11     
- Partials     1665     1667       +2     
Files with missing lines Coverage Δ
examples/car-file-fetcher/main.go 42.85% <100.00%> (+3.96%) ⬆️
gateway/backend_car.go 50.92% <100.00%> (+0.46%) ⬆️
gateway/blockstore.go 0.00% <0.00%> (ø)
routing/http/server/server.go 74.44% <0.00%> (+0.22%) ⬆️

... and 9 files with indirect coverage changes


🚨 Try these New Features:

@lidel lidel changed the title refactor: defult to prometheus.DefaultRegisterer refactor: default to prometheus.DefaultRegisterer Nov 18, 2024
@lidel lidel changed the base branch from add-instrumentation to main November 19, 2024 00:07
replace it with prometheus.DefaultRegisterer
so by default boxo users who do not specify registry
are not missing metrics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant