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

chore: improve naming of span related context APIs #1749

Merged
merged 5 commits into from
Dec 21, 2020

Conversation

Flarna
Copy link
Member

@Flarna Flarna commented Dec 14, 2020

Which problem is this PR solving?

Short description of the changes

Rename [gs]etActiveSpan() to [gs]etSpan() as the span is not active anywhere, it's just referenced by the context.

Rename setExtractedSpanContext() to setSpanContext() because any SpanContext may be set not only extracted ones.

Rename getParentSpanContext() to getSpanContext()` because it retrieves the context of the span which can be any span not only a parent.

[sg]etSpanContext() are quite simple wrappers and could be removed to reduce API surface if preferred. But I see not that much maintenance pain of keeping them so I left them in for now.

Rename [gs]etActiveSpan() to [gs]etSpan() as the span is not active anywhere,
it's just referenced by the context.

Rename setExtractedSpanContext() to setSpanContext() because any SpanContext
may be set not only extracted ones.

Rename getParentSpanContext() to getSpanContext() because it retrieves the
context of the span which can be any span not only a parent.
@codecov
Copy link

codecov bot commented Dec 14, 2020

Codecov Report

Merging #1749 (6956e54) into master (7e5da41) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1749      +/-   ##
==========================================
+ Coverage   92.07%   92.11%   +0.03%     
==========================================
  Files         166      166              
  Lines        5593     5591       -2     
  Branches     1199     1198       -1     
==========================================
  Hits         5150     5150              
+ Misses        443      441       -2     
Impacted Files Coverage Δ
...ges/opentelemetry-instrumentation-http/src/http.ts 95.49% <ø> (ø)
packages/opentelemetry-plugin-fetch/src/fetch.ts 96.52% <ø> (ø)
packages/opentelemetry-plugin-http/src/http.ts 97.28% <ø> (ø)
packages/opentelemetry-api/src/context/context.ts 91.66% <100.00%> (-0.34%) ⬇️
packages/opentelemetry-api/src/trace/NoopTracer.ts 96.55% <100.00%> (ø)
...y-core/src/context/propagation/HttpTraceContext.ts 100.00% <100.00%> (ø)
...metry-core/src/trace/sampler/ParentBasedSampler.ts 83.87% <100.00%> (ø)
...entelemetry-propagator-b3/src/B3MultiPropagator.ts 100.00% <100.00%> (ø)
...ntelemetry-propagator-b3/src/B3SinglePropagator.ts 100.00% <100.00%> (ø)
...ackages/opentelemetry-shim-opentracing/src/shim.ts 87.70% <100.00%> (ø)
... and 2 more

@Flarna Flarna mentioned this pull request Dec 15, 2020
2 tasks
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.

I think they are heavy debate on the PR about the namespacing which belong to its issue. I'm fine with renaming the helpers and decide later where to export them

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.

I think they are heavy debate on the PR about the namespacing which belong to its issue. I'm fine with renaming the helpers and decide later where to export them

I agree with @vmarchaud the debate has not much to do with the substance of this PR and the name change is in general good.

@dyladan
Copy link
Member

dyladan commented Dec 17, 2020

@obecny i see you 👍 the comment but no approval yet

@obecny
Copy link
Member

obecny commented Dec 17, 2020

@obecny i see you 👍 the comment but no approval yet

I thought I approved

@vmarchaud vmarchaud mentioned this pull request Dec 19, 2020
30 tasks
@dyladan dyladan merged commit c1d4264 into open-telemetry:master Dec 21, 2020
@Flarna Flarna deleted the context-naming branch December 21, 2020 15:23
dyladan pushed a commit to dyladan/opentelemetry-js that referenced this pull request Sep 9, 2022
dyladan pushed a commit to dyladan/opentelemetry-js that referenced this pull request Sep 9, 2022
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.

Naming of span related APIs on context (setExtractedSpanContext(), getParentSpanContext(),...)
5 participants