-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[Profiling] Add support for variable sampling frequency #128086
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: main
Are you sure you want to change the base?
[Profiling] Add support for variable sampling frequency #128086
Conversation
@@ -76,6 +76,10 @@ | |||
"type": "short", | |||
"index": false | |||
}, | |||
"Stacktrace.sampling_frequency": { | |||
"type": "long", |
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.
Using long
here to
a) avoid hardly compressible FP type (no use case in sight for non-integer frequencies in sight)
b) long
compresses as well as any other integer type (variable length encoding)
.missing("") | ||
.field("Stacktrace.sampling_frequency") | ||
// missing(DEFAULT_SAMPLING_RATE) is used to include documents where the field is missing. | ||
.missing((long) DEFAULT_SAMPLING_FREQUENCY) |
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 allows compatibility with old data that doesn't have the sampling_frequency
field.
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
This PR adds support for a variable sampling frequency.
So far, all trace events are assumed to be sampled at exactly 19 Hz (19 samples per second).
The profiling agent allows to configure this frequency as positive integer values - as allowed by the eBPF API. But due to limitations in our backend processing, which only support 19 Hz, we could not expose this option to customers. Once we support variable sampling frequencies in our backend and UI, we can open this configuration option to customers. A second use case could, in theory, be that we implement changing sampling frequency on-demand during runtime. "On-demand" could be increase accuracy during selected APM traces and spans.
In short, a sampling variable frequency allows reducing the storage costs significantly and/or allows increasing accuracy of profiling data.
TODO: