Description
Component(s)
exporter/elasticsearch
Describe the issue you're reporting
Problem
Currently, stacktrace events in profiling are assumed to be collected with a 19 Hz sampling frequency - using any other frequency will end up in wrong or misleading values shown in Elastic Universal Profiling.
Since the sampling frequency is configurable for the OTEL profiling agent (see experimental collector/receiver code and example usage), we can assume that users will likely start sampling with different frequencies than the default.
Solution
Elasticsearch 9.1 will be prepared to deal with variable/mixed sampling frequencies (PR).
All we have to do is storing the sampling frequency of profiles in profiling-events-*
. The field profile.Period
is a period in nanoseconds and can be transformed into a frequency with
frequency = 1e9 / period
frequency
needs to be an integer and is stored as Stacktrace.sampling_frequency
in the profiles-events-*
indices.
Hint: There is no harm in storing this field in ES <9.1, it will be ignored and storage cost is negligible. So no requirement to have a version check, except when the effort is low.