You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(profiling): Fix OTLP dictionary index 0 sentinel encoding
Dictionary tables (location, function, link, stack, attribute) were
omitting their required index 0 sentinel entries from the wire format,
causing profcheck validation failures.
Root cause:
1. Dictionary loops started at i=1 instead of i=0, skipping sentinels
2. ProtobufEncoder.writeNestedMessage() had an if (length > 0) check
that completely skipped writing empty messages
3. Sentinel entries encode as empty messages (all fields are 0/empty)
4. Result: Index 0 was not present in wire format, causing off-by-one
array indexing errors in profcheck validation
Fix:
- Changed ProtobufEncoder.writeNestedMessage() to always write tag+length
even for empty messages (required for sentinels)
- Changed all dictionary table loops to start from i=0 to include sentinels
- Added attribute_table encoding (was completely missing)
- Updated JSON encoding to match protobuf encoding
- Fixed test to use correct event type (datadog.ObjectSample)
All profcheck validation tests now pass with "conformance checks passed".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Copy file name to clipboardExpand all lines: dd-java-agent/agent-profiling/profiling-otel/src/main/java/com/datadog/profiling/otel/JfrToOtlpConverter.java
Copy file name to clipboardExpand all lines: dd-java-agent/agent-profiling/profiling-otel/src/main/java/com/datadog/profiling/otel/proto/ProtobufEncoder.java
Copy file name to clipboardExpand all lines: dd-java-agent/agent-profiling/profiling-otel/src/test/java/com/datadog/profiling/otel/ProfcheckValidationTest.java
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -152,10 +152,9 @@ public void testAllocationProfile() throws Exception {
0 commit comments