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

Exporting tags consistently #3281

Merged
merged 36 commits into from
May 27, 2022

Conversation

alanwest
Copy link
Member

@alanwest alanwest commented May 13, 2022

#3262 standardized how we handle tags in the OTLP exporter for traces, metrics, and logs.

I have generalized that work in a way to get code reuse across for the Zipkin and Jaeger exporters. I suspect this could be used for Prometheus too, but haven't touched Prometheus in this PR.

This PR will also address a number of bugs:

@reyang
Copy link
Member

reyang commented May 13, 2022

+1 like the idea!

@codecov
Copy link

codecov bot commented May 24, 2022

Codecov Report

Merging #3281 (5fa4281) into main (b9839f6) will increase coverage by 0.00%.
The diff coverage is 92.98%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3281   +/-   ##
=======================================
  Coverage   85.38%   85.39%           
=======================================
  Files         265      269    +4     
  Lines        9541     9552   +11     
=======================================
+ Hits         8147     8157   +10     
- Misses       1394     1395    +1     
Impacted Files Coverage Δ
...elemetry.Exporter.Jaeger/Implementation/Process.cs 80.48% <ø> (+10.27%) ⬆️
...tation/OpenTelemetryProtocolExporterEventSource.cs 85.00% <ø> (-1.37%) ⬇️
...etryProtocol/Implementation/LogRecordExtensions.cs 87.95% <50.00%> (ø)
...metry.Exporter.Zipkin/Implementation/ZipkinSpan.cs 95.00% <50.00%> (-1.63%) ⬇️
....Jaeger/Implementation/JaegerActivityExtensions.cs 95.62% <85.71%> (-0.79%) ⬇️
...Protocol/Implementation/OtlpKeyValueTransformer.cs 85.71% <85.71%> (ø)
...rter.Jaeger/Implementation/JaegerTagTransformer.cs 100.00% <100.00%> (ø)
...rc/OpenTelemetry.Exporter.Jaeger/JaegerExporter.cs 87.17% <100.00%> (+0.11%) ⬆️
...metryProtocol/Implementation/ActivityExtensions.cs 94.50% <100.00%> (-0.04%) ⬇️
...tryProtocol/Implementation/MetricItemExtensions.cs 93.83% <100.00%> (+0.04%) ⬆️
... and 10 more

@alanwest alanwest marked this pull request as ready for review May 24, 2022 19:56
@alanwest alanwest requested a review from a team May 24, 2022 19:56
@@ -19,6 +19,7 @@
<ItemGroup>
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutablePkgVer)" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="$(SystemReflectionEmitLightweightPkgVer)" />
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonPkgVer)" />
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: Gotta figure out a better place to put the shared TagTransformer.cs file.

I think this causes an unnecessary new dependency on the SDK project. Technically this is only required for the shared TagTransformer class which is only used by exporters.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

@alanwest alanwest May 25, 2022

Choose a reason for hiding this comment

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

I ended up just excluding TagTransformer.cs from compilation. See: 673ade0

I tried the separate project idea and ended up needing to pull in the OpenTelemetrySdkEventSource for logging. Also, a new project may have resulted in a gratuitous nuget package. Both of these concerns could be overcome, so if folks think a separate project is better, I'm happy to go that route.

Nevermind, that caused other problems. I solved this more simply by just moving the code that required System.Text.Json to the projects that actually needed it. 74df0df

Copy link
Member

@CodeBlanch CodeBlanch left a comment

Choose a reason for hiding this comment

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

Some nits and suggestions but LGTM.

@cijothomas cijothomas merged commit 4e6d073 into open-telemetry:main May 27, 2022
@alanwest alanwest deleted the alanwest/tag-transformer branch September 30, 2022 22:03
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.

process.command_args serializes as System.String[]
4 participants