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

feat(shim-opentracing): update setTag based on new spec #2194

Merged
merged 6 commits into from
Jun 2, 2021

Conversation

vreynolds
Copy link
Contributor

@vreynolds vreynolds commented May 9, 2021

Which problem is this PR solving?

Short description of the changes

  • Update setTag to match spec
    • Note: any error tag that's not true/false will default to Unset status code
  • Update addTags to match setTag spec

Questions

  • Should addTags map error tags to status code as well? (Not defined in the OTEL spec, since it's not in the OpenTracing spec) I updated addTags as well, since that seems like the spirit of the spec.

@codecov
Copy link

codecov bot commented May 9, 2021

Codecov Report

Merging #2194 (3c0ff22) into main (8bb9752) will increase coverage by 0.51%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2194      +/-   ##
==========================================
+ Coverage   92.28%   92.79%   +0.51%     
==========================================
  Files         127      144      +17     
  Lines        4186     5178     +992     
  Branches      852     1062     +210     
==========================================
+ Hits         3863     4805     +942     
- Misses        323      373      +50     
Impacted Files Coverage Δ
...ackages/opentelemetry-shim-opentracing/src/shim.ts 93.00% <100.00%> (+3.40%) ⬆️
...-instrumentation-fetch/src/enums/AttributeNames.ts 100.00% <0.00%> (ø)
...es/opentelemetry-context-zone-peer-dep/src/util.ts 100.00% <0.00%> (ø)
...mentation-xml-http-request/src/enums/EventNames.ts 100.00% <0.00%> (ø)
.../opentelemetry-exporter-collector/src/transform.ts 88.69% <0.00%> (ø)
...kages/opentelemetry-exporter-collector/src/util.ts 100.00% <0.00%> (ø)
...s/opentelemetry-instrumentation-fetch/src/fetch.ts 96.98% <0.00%> (ø)
...ry-exporter-collector/src/CollectorExporterBase.ts 92.15% <0.00%> (ø)
packages/opentelemetry-web/src/utils.ts 94.80% <0.00%> (ø)
...lemetry-exporter-collector/src/transformMetrics.ts 95.71% <0.00%> (ø)
... and 8 more

Copy link
Member

@vmarchaud vmarchaud left a comment

Choose a reason for hiding this comment

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

Should addTags map error tags to status code as well? (Not defined in the OTEL spec, since it's not in the OpenTracing spec)

Not sure what you meant here ?

packages/opentelemetry-shim-opentracing/src/shim.ts Outdated Show resolved Hide resolved
@vreynolds
Copy link
Contributor Author

Should addTags map error tags to status code as well? (Not defined in the OTEL spec, since it's not in the OpenTracing spec)

Not sure what you meant here ?

There is an addTags method in the opentracing-js API, which sets multiple tags at once. I was unsure if the shim should look at each tag in the args, and map any error tags to status, like setTag does. It's not explicitly in the spec, because I think it might be an opentracing-js thing.

@vmarchaud
Copy link
Member

There is an addTags method in the opentracing-js API, which sets multiple tags at once. I was unsure if the shim should look at each tag in the args, and map any error tags to status, like setTag does. It's not explicitly in the spec, because I think it might be an opentracing-js thing.

As my other comment, i would suggest to do what you think is best given the time you have !

Copy link
Member

@vmarchaud vmarchaud left a comment

Choose a reason for hiding this comment

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

lgtm, thanks for taking the time to fix this !

Copy link
Member

@obecny obecny left a comment

Choose a reason for hiding this comment

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

lgtm

@vmarchaud
Copy link
Member

@vreynolds Could you rebase the PR ? There is one conflict :/

@vmarchaud
Copy link
Member

@vreynolds Sorry but it seems there is still conflict

Copy link
Member

@dyladan dyladan left a comment

Choose a reason for hiding this comment

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

Looks great to me but there is still a conflict

@dyladan dyladan added the enhancement New feature or request label Jun 1, 2021
@vreynolds
Copy link
Contributor Author

Thanks for merging upstream @dyladan ! Looks like conflicts have been resolved, but LMK if there's anything more I can do.

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

Successfully merging this pull request may close these issues.

4 participants