VOOZH about

URL: https://www.nuget.org/packages/OpenTelemetry.Exporter.Prometheus.AspNetCore/

⇱ NuGet Gallery | OpenTelemetry.Exporter.Prometheus.AspNetCore 1.16.0-beta.1




👁 Image
OpenTelemetry.Exporter.Prometheus.AspNetCore 1.16.0-beta.1

Prefix Reserved
This is a prerelease version of OpenTelemetry.Exporter.Prometheus.AspNetCore.
dotnet add package OpenTelemetry.Exporter.Prometheus.AspNetCore --version 1.16.0-beta.1
 
 
NuGet\Install-Package OpenTelemetry.Exporter.Prometheus.AspNetCore -Version 1.16.0-beta.1
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.16.0-beta.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.16.0-beta.1" />
 
Directory.Packages.props
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpenTelemetry.Exporter.Prometheus.AspNetCore --version 1.16.0-beta.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OpenTelemetry.Exporter.Prometheus.AspNetCore, 1.16.0-beta.1"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OpenTelemetry.Exporter.Prometheus.AspNetCore@1.16.0-beta.1
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpenTelemetry.Exporter.Prometheus.AspNetCore&version=1.16.0-beta.1&prerelease
 
Install as a Cake Addin
#tool nuget:?package=OpenTelemetry.Exporter.Prometheus.AspNetCore&version=1.16.0-beta.1&prerelease
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Prometheus Exporter AspNetCore for OpenTelemetry .NET

👁 NuGet
👁 NuGet

An OpenTelemetry Prometheus exporter for configuring an ASP.NET Core application with an endpoint for Prometheus to scrape.

This component is still under development due to a dependency on the experimental Prometheus and OpenMetrics Compatibility specification and can undergo breaking changes before stable release. Production environments should consider using OpenTelemetry.Exporter.OpenTelemetryProtocol. Refer to the Getting Started with Prometheus and Grafana tutorial for more information.

The Prometheus scraping endpoint is not secured by default, so it is important to consider the security implications of exposing this endpoint in your application.

Refer to the Prometheus Security model and ASP.NET Core security documentation for more information and guidance on securing the Prometheus scraping endpoint to ensure only authorized users can access the information exposed by it.

Prerequisite

Steps to enable OpenTelemetry.Exporter.Prometheus.AspNetCore

Step 1: Install Package

dotnet add package --prerelease OpenTelemetry.Exporter.Prometheus.AspNetCore

Step 2: Configure OpenTelemetry MeterProvider

  • When using OpenTelemetry.Extensions.Hosting package on .NET 6.0+:

    services.AddOpenTelemetry()
     .WithMetrics(builder => builder.AddPrometheusExporter());
    
  • Or configure directly:

    Call the MeterProviderBuilder.AddPrometheusExporter extension to register the Prometheus exporter.

    var meterProvider = Sdk.CreateMeterProviderBuilder()
     .AddPrometheusExporter()
     .Build();
    
    builder.Services.AddSingleton(meterProvider);
    

Step 3: Configure Prometheus Scraping Endpoint

You can use register the Prometheus scraping middleware using the MapPrometheusScrapingEndpoint extension method on IEndpointRouteBuilder interface with Minimal APIs. For example:

var builder = WebApplication.CreateBuilder(args);

var app = builder.Build();

app.MapPrometheusScrapingEndpoint();

You can use the IEndpointConventionBuilder returned by the extension method to compose with other functionality, such as to exclude HTTP metrics from the scraping endpoint itself. For example:

app.MapPrometheusScrapingEndpoint()
 .DisableHttpMetrics();

If you are using the older Generic Host API you can register the Prometheus scraping middleware with the UseOpenTelemetryPrometheusScrapingEndpoint extension method on IApplicationBuilder instead:

var builder = WebApplication.CreateBuilder(args);

var app = builder.Build();

app.UseOpenTelemetryPrometheusScrapingEndpoint();

Overloads of the UseOpenTelemetryPrometheusScrapingEndpoint extension are provided to change the path or for more advanced configuration a predicate function can be used:

app.UseOpenTelemetryPrometheusScrapingEndpoint(
 context => context.Request.Path == "/internal/metrics" &&
 context.Connection.LocalPort == 5067);

This can be used in combination with configuring multiple ports on the ASP.NET application to expose the scraping endpoint on a different port.

Configuration

The PrometheusExporter can be configured using the PrometheusAspNetCoreOptions properties.

ScrapeEndpointPath

Defines the path for the Prometheus scrape endpoint for the middleware registered by MapPrometheusScrapingEndpoint and UseOpenTelemetryPrometheusScrapingEndpoint. Default value: "/metrics".

ScrapeResponseCacheDurationMilliseconds

Configures scrape endpoint response caching. Multiple scrape requests within the cache duration time period will receive the same previously generated response. The default value is 300. Set to 0 to disable response caching.

Troubleshooting

This component uses an EventSource with the name "OpenTelemetry-Exporter-Prometheus" for its internal logging. Please refer to SDK troubleshooting for instructions on seeing these internal logs.

References

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (155)

Showing the top 5 NuGet packages that depend on OpenTelemetry.Exporter.Prometheus.AspNetCore:

Package Downloads
SharpAbp.Abp.OpenTelemetry.Exporter.Prometheus.AspNetCore

SharpAbp OpenTelemetry Module

Elvia.Telemetry.AspNetCore

Common logging/telemetry functionality to used by all AspNetCore services within the Elvia ecosystem.

KubeOps.Operator.Web

This is an operator sdk written in c#. It enables a developer to create a custom controller for CRDs (CustomResourceDefinitions) that runs on kubernetes. This operator uses ASP.net to support webhooks and external access to the operator.

ShtrihM.Wattle3.OpenTelemetry

Framework for creating high-performance servers with domain object models.

Redpoint.CloudFramework

A framework for building ASP.NET Core applications on top of Google Cloud Firestore in Datastore mode. Not only does this framework provide a model-based API for interacting with Google Cloud Firestore, it contains useful implementations of things like database migrations, distributed locks, geographic indexes and sharded counters.

GitHub repositories (37)

Showing the top 20 popular GitHub repositories that depend on OpenTelemetry.Exporter.Prometheus.AspNetCore:

Repository Stars
JustArchiNET/ArchiSteamFarm
C# application with primary purpose of farming Steam cards from multiple accounts simultaneously.
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
kurrent-io/KurrentDB
KurrentDB is a database that's engineered for modern software applications and event-driven architectures. Its event-native design simplifies data modeling and preserves data integrity while the integrated streaming engine solves distributed messaging challenges and ensures data consistency.
dotnet/samples
Sample code referenced by the .NET documentation
JasperFx/marten
.NET Transactional Document DB and Event Store on PostgreSQL
microsoft/dotnet-podcasts
.NET reference application shown at .NET Conf featuring ASP.NET Core, Blazor, .NET MAUI, Microservices, Orleans, Playwright, and more!
BrighterCommand/Brighter
A framework for building messaging apps with .NET and C#.
GZTimeWalker/GZCTF
The GZ::CTF project, an open source CTF platform.
meysamhadeli/booking-microservices
A practical microservices with the latest technologies and architectures like Vertical Slice Architecture, Event Sourcing, CQRS, DDD, gRpc, MongoDB, RabbitMq, Masstransit, and Aspire in .Net 10.
SteeltoeOSS/Steeltoe
.NET Components for Externalized Configuration, Database Connectors, Service Discovery, Logging and Distributed Tracing, Application Management, Security, and more.
mehdihadeli/food-delivery-microservices
🍔 A practical and cloud-native food delivery microservices, built with .Net Aspire, .Net 9, MassTransit, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
simpleidserver/SimpleIdServer
OpenID, OAuth 2.0, SCIM2.0, UMA2.0, FAPI, CIBA & OPENBANKING Framework for ASP.NET Core
streetwriters/notesnook-sync-server
Sync server for Notesnook (self-hosting in alpha)
Aguafrommars/TheIdServer
OpenID/Connect, OAuth2, WS-Federation and SAML 2.0 server based on Duende IdentityServer and ITFoxtec Identity SAML 2.0 with its admin UI
NimblePros/eShopOnWeb
Sample ASP.NET Core 10.0 reference application, powered by Microsoft, demonstrating a domain-centric application architecture with monolithic deployment model.
Azure/Industrial-IoT
Azure Industrial IoT Platform
meysamhadeli/booking-modular-monolith
A practical Modular Monolith architecture with the latest technologies and architecture like Vertical Slice Architecture, Event Driven Architecture, CQRS, DDD, gRpc, Masstransit, and Aspire in .Net 10.
Eventuous/eventuous
Event Sourcing library for .NET
SlimPlanet/SlimFaas
SlimFaas : The slimmest and simplest Function As A Service
Version Downloads Last Updated
1.16.0-beta.1 25,985 6/10/2026
1.15.3-beta.1 1,193,613 4/21/2026
1.15.2-beta.1 144,825 4/8/2026
1.15.1-beta.1 206,622 3/27/2026
1.15.0-beta.1 1,594,593 1/21/2026
1.14.0-beta.1 1,726,215 11/12/2025
1.13.1-beta.1 903,693 10/10/2025
1.13.0-beta.1 257,652 10/1/2025
1.12.0-beta.1 4,158,620 5/6/2025
1.11.2-beta.1 3,665,285 3/5/2025
1.11.0-beta.1 2,046,037 1/16/2025
1.10.0-beta.1 1,864,391 11/12/2024
1.9.0-beta.2 10,124,439 6/24/2024
1.9.0-beta.1 645,460 6/14/2024
1.9.0-alpha.2 437,014 5/29/2024
1.9.0-alpha.1 116,510 5/20/2024
1.8.0-rc.1 5,084,131 3/27/2024
1.8.0-beta.1 335,943 3/14/2024
1.7.0-rc.1 5,584,317 11/30/2023
1.7.0-alpha.1 387,692 10/17/2023
Loading failed