OpenTelemetry.Exporter.Prometheus.HttpListener
1.16.0-beta.1
Prefix Reserved
dotnet add package OpenTelemetry.Exporter.Prometheus.HttpListener --version 1.16.0-beta.1
NuGet\Install-Package OpenTelemetry.Exporter.Prometheus.HttpListener -Version 1.16.0-beta.1
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.HttpListener" Version="1.16.0-beta.1" />
<PackageVersion Include="OpenTelemetry.Exporter.Prometheus.HttpListener" Version="1.16.0-beta.1" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.HttpListener" />
paket add OpenTelemetry.Exporter.Prometheus.HttpListener --version 1.16.0-beta.1
#r "nuget: OpenTelemetry.Exporter.Prometheus.HttpListener, 1.16.0-beta.1"
#:package OpenTelemetry.Exporter.Prometheus.HttpListener@1.16.0-beta.1
#addin nuget:?package=OpenTelemetry.Exporter.Prometheus.HttpListener&version=1.16.0-beta.1&prerelease
#tool nuget:?package=OpenTelemetry.Exporter.Prometheus.HttpListener&version=1.16.0-beta.1&prerelease
Prometheus Exporter HttpListener for OpenTelemetry .NET
An OpenTelemetry Prometheus exporter that configures an HttpListener instance for Prometheus to scrape.
This component is intended for dev inner-loop, there is no plan to make it production ready. 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 the HttpListener class 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
Installation
Step 1: Install Package
dotnet add package --prerelease OpenTelemetry.Exporter.Prometheus.HttpListener
Step 2: Add PrometheusHttpListener
var meterProvider = Sdk.CreateMeterProviderBuilder()
.AddMeter(MyMeter.Name)
.AddPrometheusHttpListener()
.Build();
Configuration
You can configure the PrometheusHttpListener through
PrometheusHttpListenerOptions and environment variables. The
PrometheusHttpListenerOptions setters take precedence over the environment
variables.
Configuration using Properties
Host: The host used by the Prometheus exporter (defaultlocalhost).Port: The port used by the Prometheus exporter (default9464).ScrapeEndpointPath: Defines the Prometheus scrape endpoint path. (default"/metrics").DisableTotalNameSuffixForCounters: Whether to disable the_totalsuffix for counter metrics (defaultfalse).DisableTimestamp: Whether to disable the timestamp for metrics (defaultfalse).
Configuration using Dependency Injection
This exporter allows easy configuration of PrometheusHttpListenerOptions from
the dependency injection container, when used in conjunction with
OpenTelemetry.Extensions.Hosting.
For example:
var meterProvider = Sdk.CreateMeterProviderBuilder()
.AddMeter(MyMeter.Name)
.AddPrometheusHttpListener(options =>
{
options.Host = "localhost";
options.Port = 9464;
})
.Build();
Configuration using Environment Variables
The following environment variables can be used to override the default
values of the PrometheusHttpListenerOptions.
| Environment variable | PrometheusHttpListenerOptions property |
|---|---|
OTEL_EXPORTER_PROMETHEUS_HOST |
Host |
OTEL_EXPORTER_PROMETHEUS_PORT |
Port |
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 | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- OpenTelemetry (>= 1.16.0 && < 2.0.0)
-
.NETStandard 2.0
- OpenTelemetry (>= 1.16.0 && < 2.0.0)
-
net10.0
- OpenTelemetry (>= 1.16.0 && < 2.0.0)
-
net8.0
- OpenTelemetry (>= 1.16.0 && < 2.0.0)
-
net9.0
- OpenTelemetry (>= 1.16.0 && < 2.0.0)
NuGet packages (17)
Showing the top 5 NuGet packages that depend on OpenTelemetry.Exporter.Prometheus.HttpListener:
| Package | Downloads |
|---|---|
|
OpenTelemetry.AutoInstrumentation.Runtime.Managed
Managed components used by the OpenTelemetry.AutoInstrumentation project. |
|
|
Elvia.Telemetry
Common logging/telemetry functionality to used by all services within the Elvia ecosystem. |
|
|
Bones.Monitoring
Package Description |
|
|
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. |
|
|
SharpAbp.Abp.OpenTelemetry.Exporter.Prometheus.HttpListener
SharpAbp OpenTelemetry Module |
GitHub repositories (8)
Showing the top 8 popular GitHub repositories that depend on OpenTelemetry.Exporter.Prometheus.HttpListener:
| Repository | Stars |
|---|---|
|
prometheus-net/prometheus-net
.NET library to instrument your code with Prometheus metrics
|
|
|
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
|
|
|
open-telemetry/opentelemetry-dotnet-contrib
This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
|
|
|
axzxs2001/Asp.NetCoreExperiment
原来所有项目都移动到**OleVersion**目录下进行保留。新的案例装以.net 5.0为主,一部分对以前案例进行升级,一部分将以前的工作经验总结出来,以供大家参考!
|
|
|
cocosip/sharp-abp
Abp-vNext extension modules
|
|
|
RedpointGames/uet
UET (Unreal Engine Tool) makes building and testing Unreal Engine projects and plugins easy. It can distribute builds with BuildGraph, remotely execute automation tests on device and across multiple machines, handles fault tolerance and automatic retries and generally makes the whole experience of automating Unreal Engine a lot more pleasant.
|
|
|
osstotalsoft/nbb
.Net Building Blocks
|
|
|
Particular/docs.particular.net
All content for ParticularDocs
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.16.0-beta.1 | 0 | 6/10/2026 |
| 1.15.3-beta.1 | 381,597 | 4/21/2026 |
| 1.15.2-beta.1 | 32,494 | 4/8/2026 |
| 1.15.1-beta.1 | 17,151 | 3/27/2026 |
| 1.15.0-beta.1 | 366,283 | 1/21/2026 |
| 1.14.0-beta.1 | 748,962 | 11/12/2025 |
| 1.13.1-beta.1 | 90,176 | 10/10/2025 |
| 1.13.0-beta.1 | 9,228 | 10/1/2025 |
| 1.12.0-beta.1 | 1,471,690 | 5/6/2025 |
| 1.11.2-beta.1 | 925,598 | 3/5/2025 |
| 1.11.0-beta.1 | 188,201 | 1/16/2025 |
| 1.10.0-beta.1 | 179,555 | 11/12/2024 |
| 1.9.0-beta.2 | 1,483,031 | 6/24/2024 |
| 1.9.0-beta.1 | 775,483 | 6/14/2024 |
| 1.9.0-alpha.2 | 83,359 | 5/29/2024 |
| 1.9.0-alpha.1 | 8,988 | 5/20/2024 |
| 1.8.0-rc.1 | 1,022,884 | 3/27/2024 |
| 1.8.0-beta.1 | 16,153 | 3/14/2024 |
| 1.7.0-rc.1 | 790,027 | 11/30/2023 |
| 1.7.0-alpha.1 | 16,605 | 10/17/2023 |
For highlights and announcements see: https://github.com/open-telemetry/opentelemetry-dotnet/blob/coreunstable-1.16.0-beta.1/RELEASENOTES.md.
For detailed changes see: https://github.com/open-telemetry/opentelemetry-dotnet/blob/coreunstable-1.16.0-beta.1/src/OpenTelemetry.Exporter.Prometheus.HttpListener/CHANGELOG.md.