chore: improve naming of span related context APIs#1749
chore: improve naming of span related context APIs#1749dyladan merged 5 commits intoopen-telemetry:masterfrom
Conversation
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 Report
@@ 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
|
vmarchaud
left a comment
There was a problem hiding this comment.
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
dyladan
left a comment
There was a problem hiding this comment.
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.
|
@obecny i see you 👍 the comment but no approval yet |
I thought I approved |
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()tosetSpanContext()because anySpanContextmay 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.