-
Notifications
You must be signed in to change notification settings - Fork 91
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
Enable auto/sdk in otel global #1405
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
bc3fd1e
to
2cc75b0
Compare
0fa0bd8
to
555a184
Compare
This comment was marked as outdated.
This comment was marked as outdated.
555a184
to
dab479a
Compare
internal/pkg/instrumentation/bpf/go.opentelemetry.io/otel/traceglobal/bpf/probe.bpf.c
Show resolved
Hide resolved
d5356ef
to
89c0867
Compare
27dcc0f
to
b25ff44
Compare
Set the auto/sdk flag in the global API to true when newSpan is called.
Verify the auto/sdk probe is being used.
b25ff44
to
30e7015
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's very cool to see it all come together,
Left some comments but it looks great.
internal/pkg/instrumentation/bpf/go.opentelemetry.io/otel/traceglobal/probe.go
Outdated
Show resolved
Hide resolved
@@ -365,50 +371,76 @@ type Uprobe struct { | |||
// function specified by Sym. If ReturnProbe is empty, no eBPF program will be attached to the return of the function. | |||
ReturnProbe string | |||
DependsOn []string | |||
|
|||
closers atomic.Pointer[[]io.Closer] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not []io.Closer
?
What are the concurrent scenarios we are trying to protect against?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Uprobe.Close
is called by the Manager
which can shutdown asynchronously. For example, this can occur when the context passed to the new Instrumentation
is canceled asynchronously1. This is to prevent that data-race.
Footnotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Do you think we can use sync.Once
instead? I think it might be more readable
internal/pkg/instrumentation/bpf/go.opentelemetry.io/otel/traceglobal/probe.go
Outdated
Show resolved
Hide resolved
internal/pkg/instrumentation/bpf/go.opentelemetry.io/otel/traceglobal/probe.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also add package constraints on the auto sdk probes?
reader.Reset(record.RawSample) | ||
err = binary.Read(reader, binary.LittleEndian, e) | ||
case recordKindConrol: | ||
c.uprobeNewStartMu.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The decodeEvent
function of a probe instance can't be called from multiple goroutines , right? If so, maybe should remove the mutex
@@ -365,50 +371,76 @@ type Uprobe struct { | |||
// function specified by Sym. If ReturnProbe is empty, no eBPF program will be attached to the return of the function. | |||
ReturnProbe string | |||
DependsOn []string | |||
|
|||
closers atomic.Pointer[[]io.Closer] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Do you think we can use sync.Once
instead? I think it might be more readable
Resolve #1399
This includes a
probe.Uprobe
refactor. Instead of passing backlinks
when the uprobe loads, the uprobe itself now hold these values. When itsClose
method is called it will, itself, call each of these close methods.This redesign is used so that the
newSpan
uprobe can be closed prior to the others (which are closed by theManager
).