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

[Exporter.Prometheus] - enable analysis #6171

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

Kielek
Copy link
Contributor

@Kielek Kielek commented Mar 5, 2025

Towards #3958

Changes

[Exporter.Prometheus] - enable analysis

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • [ ] Unit tests added/updated
  • [ ] Appropriate CHANGELOG.md files updated for non-trivial changes
  • [ ] Changes in public API reviewed (if applicable)

@github-actions github-actions bot added pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package pkg:OpenTelemetry.Exporter.Prometheus.HttpListener Issues related to OpenTelemetry.Exporter.Prometheus.HttpListener NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package labels Mar 5, 2025
@Kielek Kielek force-pushed the analysis-OpenTelemetry.Exporter.Prometheus branch 3 times, most recently from 8015a4c to 50187dc Compare March 7, 2025 10:43
@@ -160,6 +160,9 @@ dotnet_diagnostic.RS0041.severity = suggestion
# CA1515: Disable making types internal for Tests classes. It is required by xunit
dotnet_diagnostic.CA1515.severity = none

# CA2007: Disable Consider calling ConfigureAwait on the awaited task. It is not working with xunit
dotnet_diagnostic.CA2007.severity = none
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you intend to disable this for the entire repo or scope it to just the test projects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests only. It is done automatically by xunit, but CI executes dotnet format without restoring packages so it cannot be injected by xunit package.

{
#pragma warning disable CA2000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: please include a comment here describing what is being disabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -62,9 +62,11 @@ public static MeterProviderBuilder AddPrometheusExporter(
});
}

private static MetricReader BuildPrometheusExporterMetricReader(PrometheusAspNetCoreOptions options)
private static BaseExportingMetricReader BuildPrometheusExporterMetricReader(PrometheusAspNetCoreOptions options)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI

CA1859 Change return type of method 'BuildPrometheusExporterMetricReader' from 'OpenTelemetry.Metrics.MetricReader' to 'OpenTelemetry.Metrics.BaseExportingMetricReader' for improved performance

@Kielek Kielek force-pushed the analysis-OpenTelemetry.Exporter.Prometheus branch 3 times, most recently from db4d444 to cbde98e Compare March 11, 2025 14:16
@Kielek
Copy link
Contributor Author

Kielek commented Mar 11, 2025

@TimothyMothra, I need to rebase, only new changes are in 3038ff0 (there is a instability after switching to the async) and e3e501b

EDIT: Comment updates after nexr rebase

@Kielek Kielek force-pushed the analysis-OpenTelemetry.Exporter.Prometheus branch from dd19d54 to 3038ff0 Compare March 12, 2025 09:26
@Kielek Kielek marked this pull request as ready for review March 12, 2025 11:07
@Kielek Kielek requested a review from a team as a code owner March 12, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package pkg:OpenTelemetry.Exporter.Prometheus.HttpListener Issues related to OpenTelemetry.Exporter.Prometheus.HttpListener NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants