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
Pyroscope: Provide an example for ebpf sidecar collection #3285
base: main
Are you sure you want to change the base?
Pyroscope: Provide an example for ebpf sidecar collection #3285
Conversation
This shows how Alloy can be used to collect profiles as a sidecar. The workload will futhermore launch some shortlived processes of varying lenght, that should also get collected by the profiler.
labels: | ||
app: example-ebpf-sidecar | ||
spec: | ||
shareProcessNamespace: true |
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.
This is a hard requirement for this to work
|
||
cat > /tmp/config.alloy <<"EOF" | ||
discovery.process "all" { | ||
refresh_interval = "200ms" |
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.
With this I see the 100ms long running processes very rarely. I guess something that we loose by not consuming the PID events from the ebpf.Session in alloy directly.
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 dont like the idea to run discovery.process every 200ms, but idk how bad it is.
I also don't like using alloy as sidecar at all. The binary is huge, consuming tons of space and memory.
- As you said we can notify
discovery.process
fromdiscovery.ebpf
about new PID - Another option could be to somehow revive (but maybe with a different naming), the
targets_only = false && default_target={"service_name": "foo239"}
This could look like this
sidecar {
enabled=true
discover_config {
cwd = true
exe = true
...
}
relabel {
rule {
...
}
...
}
}
Can we get k8s labels somehow?
@korniltsev if you got a moment, would like to understand how you feel about this |
This shows how Alloy can be used to collect profiles as a sidecar. I am not too sure if this is something we should advertise too heavily, but valuable if you would only like to collect a very specific workloads, that is supported by eBPF.
Maybe we also want to have something like
pyroscope exec
was for this usecase.The test workload launches some short-lived sub processes of varying length, the problem is that collection requires to have a quite low
discovery.process.refresh_interval