-
Notifications
You must be signed in to change notification settings - Fork 296
Description
Component(s)
profile
Describe the issue you're reporting
Hello,
I've encountered a potential inconsistency between the proto definition for profile data and the actual data observed during debugging. Specifically, I'm concerned with the behavior of the Value and TimestampsUnixNano fields within the Sample structure.
According to the proto definition https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/profiles/v1development/profiles.proto#L375-L396 it states:
"All samples must have the same number of values, the same as the length of Profile.sample_type"
However, my debugging output shows the following:
Each Value entry appears to correspond to a specific Timestamp, rather than being determined by the Profile.sample_type length.
Samples within the same profile do not consistently have the same number of Value or Timestamp entries.
Here's an example of my debugging output:
Profile #1
Profile ID : c2d01967aa7b578f1b70e3c35fd6e379
SampleType #%d : %!s(int=0)
TypeStringIndex: events
UnitStringIndex: nanoseconds
Start time : 2025-03-05 04:56:59.894095226 +0000 UTC
Duration : 1970-01-01 00:00:01.756312228 +0000 UTC
Sample #0
Location start: 0
Location length: 6
Value: [903976986 839861575 883929035 463890732 668006176]
Attributes:
-> container.id: /
-> thread.name: kworker/0:0
-> process.pid: %!s(int64=2548176)
Timestamp: 1741150617770086999
Timestamp: 1741150618610126241
Timestamp: 1741150619494089058
Timestamp: 1741150619958085800
Timestamp: 1741150620626113008
Sample #1
Location start: 6
Location length: 6
Value: [20025858 1007966728 7908106]
Attributes:
-> container.id: /
-> thread.name: kworker/12:2
-> process.pid: %!s(int64=4041331)
Timestamp: 1741150618074111301
Timestamp: 1741150619082111579
Timestamp: 1741150619090073827
Based on these observations, I have the following questions:
- What is the intended relationship between Value, TimestampsUnixNano, and Profile.sample_type?
- Why do individual samples contain multiple Value and Timestamp entries? What does this represent?
- Is it a strict requirement that all samples within a profile share the same sample_type? I've noticed relevant checks in the Elasticsearch Exporter (https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/elasticsearchexporter/internal/serializer/otelserializer/serializeprofiles/transform.go#L46).
I'm new in OpenTelemetry and profiling, and currently want to implement a persistent storage for profile data. Now I'm working on open-telemetry/opentelemetry-collector-contrib#38077. I would greatly appreciate if anyone could clarify these points!