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

fix: allow recording links only at Span creation time #449

Merged
merged 2 commits into from
Oct 23, 2019

Conversation

mayurkale22
Copy link
Member

Which problem is this PR solving?

Short description of the changes

  • Links will be recorded only during the start Span operation, because:

    • Link's SampledFlag can be used in the sampling decision.
    • OpenTracing supports adding references only during the Span creation.
    • OpenCensus supports adding links at any moment, but this was mostly used to record child Links which are not supported in OpenTelemetry.
    • Allowing links to be recorded after the sampling decision is made will cause samplers to not work correctly and unexpected behaviors for sampling.

@@ -41,7 +41,10 @@ function translateSpanOptions(
startTime: options.startTime,
};

// because there's no `Links` in SpanOptions, we set them in `TracerShim.startSpan()`
Copy link
Member Author

Choose a reason for hiding this comment

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

@bg451 this change will make you (and everyone) very happy :)

@codecov-io
Copy link

codecov-io commented Oct 21, 2019

Codecov Report

Merging #449 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #449      +/-   ##
==========================================
- Coverage   95.32%   95.31%   -0.02%     
==========================================
  Files         124      124              
  Lines        6166     6064     -102     
  Branches      505      509       +4     
==========================================
- Hits         5878     5780      -98     
+ Misses        288      284       -4
Impacted Files Coverage Δ
packages/opentelemetry-tracing/test/Span.test.ts 100% <100%> (ø) ⬆️
packages/opentelemetry-tracing/src/Span.ts 100% <100%> (ø) ⬆️
packages/opentelemetry-tracing/src/BasicTracer.ts 100% <100%> (ø) ⬆️
...ackages/opentelemetry-shim-opentracing/src/shim.ts 83.65% <100%> (-0.31%) ⬇️
...telemetry-plugin-grpc/test/utils/assertionUtils.ts 100% <0%> (ø) ⬆️
...entelemetry-exporter-jaeger/test/transform.test.ts 100% <0%> (ø) ⬆️
.../opentelemetry-exporter-jaeger/test/jaeger.test.ts 100% <0%> (ø) ⬆️
...in-dns/test/integrations/dnspromise-lookup.test.ts 90.82% <0%> (+0.91%) ⬆️
packages/opentelemetry-plugin-dns/src/utils.ts 70% <0%> (+1%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9855636...0331c3e. Read the comment docs.

@OlivierAlbertini OlivierAlbertini added the enhancement New feature or request label Oct 22, 2019
Copy link
Member

@OlivierAlbertini OlivierAlbertini left a comment

Choose a reason for hiding this comment

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

LGTM

@mayurkale22 mayurkale22 merged commit f33dc7c into open-telemetry:master Oct 23, 2019
@mayurkale22 mayurkale22 deleted the remove-add_link branch October 23, 2019 18:16
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request Dec 15, 2023
martinkuba pushed a commit to martinkuba/opentelemetry-js that referenced this pull request Mar 13, 2024
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.

Allow recording links only at Span creation time
4 participants