[Prometheus] Split up projects based on hosting mechanism.#3375
[Prometheus] Split up projects based on hosting mechanism.#3375Yun-Ting wants to merge 31 commits intoopen-telemetry:mainfrom
Conversation
…Yun-Ting/opentelemetry-dotnet into yunl/RefactorPrometheusExporter
Codecov Report
@@ Coverage Diff @@
## main #3375 +/- ##
==========================================
- Coverage 86.25% 86.20% -0.05%
==========================================
Files 258 272 +14
Lines 9269 9519 +250
==========================================
+ Hits 7995 8206 +211
- Misses 1274 1313 +39
|
|
@Yun-Ting Could you update the description with the final list of packages and their connections? It is not clear what would happend to the package OpenTelemetry.Exporter.Prometheus... Do we continue to publish it? Who is it meant for? Can one use it directly or its not meant for end user consumption? |
...Telemetry.Exporter.Prometheus.AspNetCore/OpenTelemetry.Exporter.Prometheus.AspNetCore.csproj
Outdated
Show resolved
Hide resolved
...metry.Exporter.Prometheus.HttpListener/OpenTelemetry.Exporter.Prometheus.HttpListener.csproj
Outdated
Show resolved
Hide resolved
cijothomas
left a comment
There was a problem hiding this comment.
Need to see description of the overall package architecture and dependencies, and the expected/proposed end user experience.
It depends on whether we think there will be use cases for extending directly on OpenTelemetry.Exporter.Prometheus project (not using the middleware or the listener.) |
test/OpenTelemetry.Exporter.Prometheus.Tests/OpenTelemetry.Exporter.Prometheus.Tests.csproj
Outdated
Show resolved
Hide resolved
#3057 - the proposal from the issue is good. |
...metry.Exporter.Prometheus.HttpListener/OpenTelemetry.Exporter.Prometheus.HttpListener.csproj
Outdated
Show resolved
Hide resolved
| { | ||
| private readonly PrometheusExporter exporter; | ||
| private readonly HttpListener httpListener = new(); | ||
| private readonly System.Net.HttpListener httpListener = new(); |
There was a problem hiding this comment.
| private readonly System.Net.HttpListener httpListener = new(); | |
| private readonly HttpListener httpListener = new(); |
@cijothomas , I've updated the PR description to answer these questions. I don't think we'll need to publish |
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
docs/metrics/getting-started-prometheus-grafana/getting-started-prometheus-grafana.csproj
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.HttpListener/PrometheusHttpListenerOptions.cs
Show resolved
Hide resolved
| { | ||
| public static MeterProviderBuilder AddPrometheusHttpListener( | ||
| this MeterProviderBuilder builder, | ||
| Action<PrometheusExporterOptions> configureExporterOptions = null, |
There was a problem hiding this comment.
Where is PrometheusExporterOptions class defined? Why we need two separate options class?
There was a problem hiding this comment.
PrometheusExporterOptions class in the OpenTelemetry.Exporter.Prometheus.Shared project and is meant to contain the fields that were shared by Listener and AspNetCore.
|
|
||
| The `PrometheusExporter` can be configured using the `PrometheusExporterOptions` | ||
| properties. Refer to | ||
| [`TestPrometheusExporter.cs`](../../examples/Console/TestPrometheusExporter.cs) |
There was a problem hiding this comment.
this'd be incorrect, as the link takes you to a console example, where this readme.md is specifically targetting asp.net core apps
cijothomas
left a comment
There was a problem hiding this comment.
See comments. Very close, but some refinements needed in the shared class usage, and public API
|
Closing this PR - please review the new #3430 instead. Thanks! |

Fixes #3057.
Changes
The updated project setup is as follows:
OpenTelemetry.Exporter.Prometheus.Sharedcontains the PrometheusExporter, PrometheusExporterOptions and serialization methods for all the shared classes to both AspNetCore and HttpListener projects. This project is not expected to be consumed directly by the end users. It serves as a clean way to group shared code for the below 2 projects for semantic reasons. As a result, I've deleted the Implementation folder that was inOpenTelemetry.Exporter.Prometheusproject, and moved out the shared files which was previously in the folder to be immediate children of the project.OpenTelemetry.Exporter.Prometheus.HttpListenercontains the PrometheusHttpListener and its options class. It aims to provide end users a quick setup experience for using OTel metrics with Prometheus Exporter locally. Please refer to readme for more details.OpenTelemetry.Exporter.Prometheus.AspNetCorecontains the middleware and its extensions for registering. This is for users trying to run PrometheusExporter in production environment. Refer to readme for details.TODO:
Currently, OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests, OpenTelemetry.Exporter.Prometheus.HttpListener.Tests, and OpenTelemetry.Exporter.Prometheus.Shared.Tests are green. I'll be working on fixing the CIs (not sure if I broke other tests with bad merge.)
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes