depado / ginprom

Gin Prometheus metrics exporter
MIT License
150 stars 38 forks source link

support custom promhttp.HandlerOpts #48

Closed jmank88 closed 1 year ago

jmank88 commented 1 year ago

The func prometheusHandler helper called from New and Use is currently limited to zero value promhttp.HandlerOpts: https://github.com/Depado/ginprom/blob/master/prom.go#L330-L332

The PR proposes introducing a HandlerOpts field and PrometheusOption for customizing the promhttp.HandlerOpts used by func prometheusHandler.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (ed5782f) 100.00% compared to head (35dd6a7) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #48 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 3 3 Lines 245 247 +2 ========================================= + Hits 245 247 +2 ``` | [Impacted Files](https://app.codecov.io/gh/Depado/ginprom/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [options.go](https://app.codecov.io/gh/Depado/ginprom/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-b3B0aW9ucy5nbw==) | `100.00% <100.00%> (ø)` | | | [prom.go](https://app.codecov.io/gh/Depado/ginprom/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cHJvbS5nbw==) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

depado commented 1 year ago

LGTM :+1: Thanks!