Skip to content
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

OtlpExporter peer.service resolution #1392

Merged
merged 9 commits into from
Oct 27, 2020

Conversation

CodeBlanch
Copy link
Member

@CodeBlanch CodeBlanch commented Oct 23, 2020

Relates to #1294

Changes

Refactored the peer.service resolution logic from Jaeger & Zipkin into a shared location so OtlpExporter could also use it. The goal is to achieve feature parity amongst the supported exporters.

  • CHANGELOG.md updated for non-trivial changes
  • Changes in public API reviewed

@CodeBlanch CodeBlanch requested a review from a team October 23, 2020 23:05
@codecov
Copy link

codecov bot commented Oct 23, 2020

Codecov Report

Merging #1392 into master will decrease coverage by 0.02%.
The diff coverage is 97.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1392      +/-   ##
==========================================
- Coverage   81.30%   81.28%   -0.03%     
==========================================
  Files         226      227       +1     
  Lines        6088     6097       +9     
==========================================
+ Hits         4950     4956       +6     
- Misses       1138     1141       +3     
Impacted Files Coverage Δ
...rc/OpenTelemetry.Api/Internal/EnumerationHelper.cs 87.09% <ø> (ø)
...etry.Api/Context/Propagation/TraceStateUtilsNew.cs 83.00% <75.00%> (-0.97%) ⬇️
...metryProtocol/Implementation/ActivityExtensions.cs 73.91% <96.42%> (+1.32%) ⬆️
....Jaeger/Implementation/JaegerActivityExtensions.cs 96.03% <100.00%> (-0.57%) ⬇️
...plementation/ZipkinActivityConversionExtensions.cs 98.68% <100.00%> (-0.21%) ⬇️
src/OpenTelemetry/Exporter/PeerServiceResolver.cs 100.00% <100.00%> (ø)
...emetry.Api/Internal/OpenTelemetryApiEventSource.cs 73.52% <0.00%> (-8.83%) ⬇️
...us/Implementation/PrometheusExporterEventSource.cs 72.72% <0.00%> (+9.09%) ⬆️

@@ -16,6 +16,7 @@

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("OpenTelemetry" + AssemblyInfo.PublicKey)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which particular class/api is triggering this change? can we keep using shared file approach instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PeerServiceResolver I refactored into SDK needs SemanticConventions, which is in API. So I included that file in SDK. Problem is, OpenTelemetry.Tests won't build with that. Because OpenTelemetry.Tests can see the internals of API & SDK, it was getting an error like "SemanticConventions type exists in both API & SDK" 🤯 I couldn't figure out a more elegant way to fix it. Open to ideas!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI - I've seen this workaround. Not sure if I would call it "elegant" though 🧙‍♀️

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay got it. I am okay to keep it like this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reyang I think I actually removed that when I made this change 🤣 But I could put that back and just make sure API & SDK SemanticConventions each get a different namespace, that would fix it. Not sure which approach is better. Why I went with this one: This is letting SDK see everything in API. SDK is kind of a superset of API so it really should see everything? 🤷

PS: One other change that is easy to miss on the diff: In the projects I touched, I move all the includes to /Includes/ folder. It was a little inconsistent before, some in root, some in /Internal/, some in /Implementation/.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CodeBlanch sorry I didn't walk through this PR.
I would vote for making the API internals visible to the SDK since the namespace hack is hard to maintain/debug/test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing we might need to consider is the API/SDK version compat.
E.g. do we expect version 1.1 of the SDK to work with 1.0 API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants