-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Prometheus] Split up projects based on hosting mechanism. #3430
[Prometheus] Split up projects based on hosting mechanism. #3430
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/OpenTelemetry.Exporter.Prometheus.Shared/PrometheusExporterOptions.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Left some minor suggestions.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits but LGTM
/// <summary> | ||
/// EventSource events emitted from the project. | ||
/// </summary> | ||
[EventSource(Name = "OpenTelemetry-Exporter-Prometheus")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may need to be changed to more specific
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.Prometheus.Tests" + AssemblyInfo.PublicKey)] | ||
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
questionable why aspnetcore.tests need special access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using OpenTelemetry.Metrics; | ||
|
||
namespace OpenTelemetry.Exporter | ||
namespace OpenTelemetry.Exporter.Prometheus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.Shared
contains 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.Prometheus
project, and moved out the shared files which was previously in the folder to be the immediate children of the project.OpenTelemetry.Exporter.Prometheus.HttpListener
contains 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.AspNetCore
contains 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.md
updated for non-trivial changes