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

Provide MapOpenTelemetryPrometheusScrapingEndpoint() extension method for IEndpointRouteBuilder #2869

Closed
msschl opened this issue Feb 7, 2022 · 1 comment
Labels
enhancement New feature or request pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package

Comments

@msschl
Copy link

msschl commented Feb 7, 2022

Feature Request

Is your feature request related to a problem?

In internal clusters, the /metrics endpoint sometimes should not be exposed to the public. Therefore, in ASP.Net Core you can map an endpoint to a specific port and expose that port only to cluster internal traffic.

Describe the solution you'd like:

Provide an MapOpenTelemetryPrometheusScrapingEndpoint extension returning an IEndpointConventionBuilder to allow further configuration of the enpoint like required hosts.

namespace Microsoft.AspNetCore.Builder
{
    public static class PrometheusExporterEndpointRouteBuilderExtensions
    {
        public static IEndpointConventionBuilder MapOpenTelemetryPrometheusScrapingEndpoint(this IEndpointRouteBuilder endpoints, string pattern, MeterProvider meterProvider = null);
    }
}
@msschl msschl added the enhancement New feature or request label Feb 7, 2022
@cijothomas cijothomas added the pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package label Mar 8, 2022
@msschl
Copy link
Author

msschl commented Jun 8, 2022

Fixed by #3295

@msschl msschl closed this as completed Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package
Projects
None yet
Development

No branches or pull requests

2 participants