-
Notifications
You must be signed in to change notification settings - Fork 384
feat(span): internal API split for Span #7881
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
base: master
Are you sure you want to change the base?
Changes from 26 commits
753e471
29c0c6b
e608c73
e486dfe
80a0c74
60973e0
db7026a
075344b
8bf7c64
7d394da
7aa71b0
65178a2
baa045c
790cbe5
ccd34ec
42345a5
95fff2a
b088cb8
fe92453
6e52e67
5eba124
8267e3a
c290b61
8a6477a
3a3991a
2023f86
dfc4688
187727b
742d492
1d75fbd
0ecd858
d8be3e0
5b097d9
c9c1463
941e32f
4583583
149f328
8f05472
efbae5d
1d2dad3
45ec521
967dcc1
8fd6a7d
ab8abc1
dea3c69
687ada7
3d05617
f4d7ed5
24c8510
8875d75
3a46cc7
17d36d3
3b65eec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,8 @@ class ContextManager { | |
| active () { | ||
| const store = this._store.getStore() | ||
| const baseContext = store || ROOT_CONTEXT | ||
| const activeSpan = tracer.scope().active() | ||
| const publicSpan = tracer.scope().active() | ||
| const activeSpan = publicSpan?._span || publicSpan | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does OTel need to know about the internal span? Not that it's necessarily a problem, just wondering. Also, in what cases would
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's needed for this comparison: storedSpan._ddSpan === activeSpan |
||
|
|
||
| const storedSpan = store ? trace.getSpan(store) : null | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| 'use strict' | ||
|
|
||
| const PublicSpan = require('./span') | ||
|
|
||
| class Scope { | ||
|
pabloerhard marked this conversation as resolved.
Outdated
|
||
| constructor (scope) { | ||
| this._scope = scope | ||
| } | ||
|
|
||
| active () { | ||
| const span = this._scope.active() | ||
| return span ? new PublicSpan(span) : null | ||
| } | ||
|
|
||
| activate (span, fn) { | ||
| return this._scope.activate(span?._span || span, fn) | ||
| } | ||
|
|
||
| bind (fn, span) { | ||
| return this._scope.bind(fn, span?._span || span) | ||
| } | ||
| } | ||
|
|
||
| module.exports = Scope | ||
Uh oh!
There was an error while loading. Please reload this page.