Skip to content

Commit

Permalink
Add Prometheus Exporter - HttpListener version (#846)
Browse files Browse the repository at this point in the history
* AddPrometheusExporter

* Update changelog

* Update changelog
  • Loading branch information
rajkumar-rangaraj authored Jun 17, 2022
1 parent 8d03958 commit 74b0ecf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This release is built on top of [OpenTelemetry .NET](https://github.com/open-tel
- Support for .NET Runtime metrics collection using
the `OpenTelemetry.Instrumentation.Runtime` package.
- Support for ASP.NET and HttpClient metrics instrumentations.
- Support for Prometheus Exporter HttpListener version.

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ private static MeterProviderBuilder SetExporter(this MeterProviderBuilder builde
switch (settings.MetricExporter)
{
case MetricsExporter.Prometheus:
throw new NotSupportedException("Prometheus is not supported yet.");
builder.AddPrometheusExporter(options => { options.StartHttpListener = true; });
break;
case MetricsExporter.Otlp:
#if NETCOREAPP3_1
if (settings.Http2UnencryptedSupportEnabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.3.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.3.0" />
<PackageReference Include="OpenTelemetry.Shims.OpenTracing" Version="1.0.0-rc9.4" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus" Version="1.3.0-rc.2" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
Expand Down

0 comments on commit 74b0ecf

Please sign in to comment.