-
Notifications
You must be signed in to change notification settings - Fork 773
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
Option to not add _total suffix to counter metrics in Prometheus exporter #5305
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #5305 +/- ##
==========================================
- Coverage 83.38% 83.10% -0.28%
==========================================
Files 297 276 -21
Lines 12531 12011 -520
==========================================
- Hits 10449 9982 -467
+ Misses 2082 2029 -53
Flags with carried forward coverage won't be shown. Click here to find out more.
|
src/OpenTelemetry.Exporter.Prometheus.AspNetCore/PrometheusAspNetCoreOptions.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusExporterOptions.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Mikel Blanchard <[email protected]>
I don't understand what happens with tests, locally it's all passes. I need help with it |
@Bassardes Could you address this #5305 (comment) |
@vishweshbankwar Seems that I can't, because this merge c0eb638 wasn't done by me. I will try force push and merge master by myself |
/// <summary> | ||
/// Gets or sets a value indicating whether addition of _total suffix for counter metric names is disabled. Default value: <see langword="false"/>. | ||
/// </summary> | ||
public bool DisableTotalNameSuffixForCounters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public bool EnableCounterTotalSuffix = true
- alternate suggestion.
The default should be true as per https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#sums
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporters SHOULD provide a configuration option to disable..
So I think DisableTotalNameSuffixForCounters will be better
src/OpenTelemetry.Exporter.Prometheus.AspNetCore/PrometheusAspNetCoreOptions.cs
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusMetric.cs
Outdated
Show resolved
Hide resolved
test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusMetricTests.cs
Show resolved
Hide resolved
Co-authored-by: Utkarsh Umesan Pillai <[email protected]>
@@ -2,6 +2,10 @@ | |||
|
|||
## Unreleased | |||
|
|||
* Added option to disable _total suffix addition to counter metrics in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to mention "in Prometheus exporter". This CHANGELOG file is specific to Prometheus exporter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -2,6 +2,10 @@ | |||
|
|||
## Unreleased | |||
|
|||
* Added option to disable _total suffix addition to counter metrics in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #
Design discussion issue #
Changes
According to this doc
This PR adds option to disable addition of _total suffix for counter metrics in Prometheus exporter
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes