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

OpenTracing Shim: Handle unsupported types when setting Attributes. #4939

Merged

Conversation

carlosalberto
Copy link
Contributor

Fixes #4908

This happens via:

  • SpanBuilder.withTag()
  • Span.setTag()

This happens through:
* SpanBuilder.withTag()
* Span.setTag()
@carlosalberto carlosalberto requested a review from a team as a code owner November 11, 2022 14:38
@codecov
Copy link

codecov bot commented Nov 11, 2022

Codecov Report

Base: 90.96% // Head: 91.01% // Increases project coverage by +0.04% 🎉

Coverage data is based on head (95dc444) compared to base (362bc0a).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4939      +/-   ##
============================================
+ Coverage     90.96%   91.01%   +0.04%     
- Complexity     4838     4841       +3     
============================================
  Files           546      546              
  Lines         14439    14442       +3     
  Branches       1395     1395              
============================================
+ Hits          13135    13144       +9     
+ Misses          901      893       -8     
- Partials        403      405       +2     
Impacted Files Coverage Δ
...opentelemetry/opentracingshim/SpanBuilderShim.java 89.14% <100.00%> (+0.86%) ⬆️
...ava/io/opentelemetry/opentracingshim/SpanShim.java 88.49% <100.00%> (+0.88%) ⬆️
...y/exporter/internal/marshal/CodedOutputStream.java 69.82% <0.00%> (-1.19%) ⬇️
...emconv/resource/attributes/ResourceAttributes.java 100.00% <0.00%> (ø)
...try/exporter/zipkin/ZipkinSpanExporterBuilder.java 97.72% <0.00%> (ø)
...exporter/jaeger/JaegerGrpcSpanExporterBuilder.java 80.64% <0.00%> (ø)
.../io/opentelemetry/api/internal/PercentEscaper.java 84.21% <0.00%> (+4.51%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

SpanData spanData = ((ReadableSpan) span.getSpan()).toSpanData();
assertThat(spanData.getAttributes().size()).isEqualTo(1);
assertThat(spanData.getAttributes().get(AttributeKey.stringKey("foo")))
.isEqualTo(BigInteger.TEN.toString());
Copy link
Member

Choose a reason for hiding this comment

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

Do you think there's any value in being explicit about the expected string? I.e. .isEqualTo("10")?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Assertions now compare against literals directly ;)

@jack-berg jack-berg merged commit ef4150c into open-telemetry:main Nov 14, 2022
dmarkwat pushed a commit to dmarkwat/opentelemetry-java that referenced this pull request Dec 30, 2022
…pen-telemetry#4939)

* OpenTracing Shim: Handle unsupported types when setting Attributes.

This happens through:
* SpanBuilder.withTag()
* Span.setTag()

* Simplify BigInteger conversion assertions.
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.

OpenTracing Shim: Support setting ALL tag/attribute types
3 participants