-
Notifications
You must be signed in to change notification settings - Fork 206
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
eBPF config provider #1481
eBPF config provider #1481
Conversation
…entationConfiguration since the first is needed for backword compatibility until we fully move to the new config provider
return nil | ||
} | ||
|
||
func (c *ConfigProvider[C]) Watch() <-chan C { |
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.
Shouldn't we pass context.Context
here as well? And maybe cancel it when we want to stop watching?
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'm not sure since it is ment to be a getter for the channel.
The calling code in the instrumentation looks like:
for {
select {
case <-ctx.Done():
return
case c, ok := <-m.cp.Watch():
if !ok {
m.logger.Info("Configuration provider closed, configuration updates will no longer be received")
return
}
err := m.applyConfig(c)
if err != nil {
m.logger.Error(err, "Failed to apply config")
continue
}
m.currentConfig = c
}
}
The way to stop watching should be to call Shutdown
- which is called by the instrumentation once it is closing
odiglet/pkg/ebpf/configprovider.go
Outdated
select { | ||
case c.configChan <- newConfig: | ||
return nil | ||
case <-ctx.Done(): |
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.
We assume the caller passed ctx
which has a timeout, maybe a better design would be to get both context and time.Time
or something as arguments and wrap the context in this function instead of assuming the caller did it
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.
added timeout of 50ms for sending configuration
OtelEbpfSdk
which allows to send configuration to a running SDK - the extended interface is calledConfigurableOtelEbpfSdk
.go.opentelemetry.io/auto
Languages
method toInstrumentationConfig
which returns the relevant languages specified in the CRD - this allows filtering the call to the relevant eBPF directors.