Export OpenMetrics format for prometheus exporters#5107
Conversation
…b.com/robertcoltheart/opentelemetry-dotnet into feature/export-prometheus-openmetrics
reyang
left a comment
There was a problem hiding this comment.
LGTM with one suggestion https://github.com/open-telemetry/opentelemetry-dotnet/pull/5107/files#r1414630802.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5107 +/- ##
==========================================
+ Coverage 83.06% 83.13% +0.06%
==========================================
Files 296 297 +1
Lines 12320 12369 +49
==========================================
+ Hits 10234 10283 +49
Misses 2086 2086
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…orterMiddleware.cs Co-authored-by: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com>
…orterMiddleware.cs Co-authored-by: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com>
…ttpListener.cs Co-authored-by: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com>
| .AddMeter(meter.Name) | ||
| .AddPrometheusHttpListener(options => options.UriPrefixes = new string[] { address }) | ||
| .Build(); | ||
| try |
There was a problem hiding this comment.
nit: It's simpler to not have the try/catch block here. This is a test so it's okay for it to fail with the original exception. Anyone troubleshooting the test failure would realize what the issue was anyway.
There was a problem hiding this comment.
In this case, I'm guessing its because there might be a potential conflict with an already open port? I can remove in the next PR in any case.
There was a problem hiding this comment.
In this case, I'm guessing its because there might be a potential conflict with an already open port?
The tests within a project are not run in parallel so it shouldn't be the case unless the listener instances are not getting disposed correctly.
|
Thanks very much! Will crack on with the next PR. |
@robertcoltheart Thanks for your contribution! |
Fixes #
First part to addressing #3972
Changes
Export OpenMetrics format for Prometheus. See here.
Acceptparser and set correctContent-TypeMerge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes