[Prometheus] Split up projects based on hosting mechanism.#3430
[Prometheus] Split up projects based on hosting mechanism.#3430cijothomas merged 65 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3430 +/- ##
==========================================
+ Coverage 86.25% 86.50% +0.25%
==========================================
Files 272 275 +3
Lines 9939 9977 +38
==========================================
+ Hits 8573 8631 +58
+ Misses 1366 1346 -20
|
…/Yun-Ting/opentelemetry-dotnet into yunl/RefactorPrometheusExporter2
...metry.Exporter.Prometheus.HttpListener/OpenTelemetry.Exporter.Prometheus.HttpListener.csproj
Outdated
Show resolved
Hide resolved
...metry.Exporter.Prometheus.HttpListener/OpenTelemetry.Exporter.Prometheus.HttpListener.csproj
Outdated
Show resolved
Hide resolved
...metry.Exporter.Prometheus.HttpListener/OpenTelemetry.Exporter.Prometheus.HttpListener.csproj
Show resolved
Hide resolved
...Telemetry.Exporter.Prometheus.AspNetCore/OpenTelemetry.Exporter.Prometheus.AspNetCore.csproj
Outdated
Show resolved
Hide resolved
...Telemetry.Exporter.Prometheus.AspNetCore/OpenTelemetry.Exporter.Prometheus.AspNetCore.csproj
Show resolved
Hide resolved
...rter.Prometheus.HttpListener/PrometheusExporterHttpListenerMeterProviderBuilderExtensions.cs
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.HttpListener/PrometheusHttpListener.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.HttpListener/PrometheusHttpListener.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.HttpListener/PrometheusHttpListener.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.Shared/OpenTelemetry.Exporter.Prometheus.Shared.csproj
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.Shared/PrometheusExporter.cs
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,6 @@ | |||
| OpenTelemetry.Exporter.Prometheus.Shared.PrometheusExporterOptions | |||
There was a problem hiding this comment.
We don't need to run publicApi analyzer for the shared project. This might require adding some new condition in Common.prod.props. Currently, publicApi analyzer is run for every project under src/.
src/OpenTelemetry.Exporter.Prometheus.Shared/PrometheusExporterOptions.cs
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.Shared/PrometheusExporterEventSource.cs
Outdated
Show resolved
Hide resolved
...Telemetry.Exporter.Prometheus.AspNetCore/OpenTelemetry.Exporter.Prometheus.AspNetCore.csproj
Outdated
Show resolved
Hide resolved
...Telemetry.Exporter.Prometheus.AspNetCore/OpenTelemetry.Exporter.Prometheus.AspNetCore.csproj
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.Shared/OpenTelemetry.Exporter.Prometheus.Shared.csproj
Outdated
Show resolved
Hide resolved
...metry.Exporter.Prometheus.HttpListener/OpenTelemetry.Exporter.Prometheus.HttpListener.csproj
Outdated
Show resolved
Hide resolved
| /// <summary> | ||
| /// EventSource events emitted from the project. | ||
| /// </summary> | ||
| [EventSource(Name = "OpenTelemetry-Exporter-Prometheus")] |
There was a problem hiding this comment.
may need to be changed to more specific
| [assembly: InternalsVisibleTo("OpenTelemetry.Extensions.EventSource" + AssemblyInfo.PublicKey)] | ||
| [assembly: InternalsVisibleTo("OpenTelemetry.Exporter.Prometheus.Shared" + AssemblyInfo.PublicKey)] | ||
| [assembly: InternalsVisibleTo("OpenTelemetry.Exporter.Prometheus.AspNetCore" + AssemblyInfo.PublicKey)] | ||
| [assembly: InternalsVisibleTo("OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests" + AssemblyInfo.PublicKey)] |
There was a problem hiding this comment.
questionable why aspnetcore.tests need special access.
There was a problem hiding this comment.
| using OpenTelemetry.Metrics; | ||
|
|
||
| namespace OpenTelemetry.Exporter | ||
| namespace OpenTelemetry.Exporter.Prometheus |
There was a problem hiding this comment.
not sure ns need a change here? The class name already have Prometheus in it..
2f75b66 to
6dfc90c
Compare
| { | ||
| /// <summary> | ||
| /// <see cref="PrometheusExporter"/> options. | ||
| /// Prometheus exporter options. |
There was a problem hiding this comment.
the ns already has prometheus in it, so class name again having prometheus is bit looong.
|
Merging to make progress. Rest of the comments can be addressed as follow ups. |
Fixes #3057.
Changes
Addressing some comments in #3375.
There are some big commits got merged over the course of the development of PR3375 and I figured starting from the more current main line is easier than resolving merge conflicts.
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 the 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.OpenTelemetry.Exporter.Prometheus.AspNetCorecontains the middleware and its extensions for registering. This is for users trying to run PrometheusExporter in production environment.For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes