Skip to content

Fix profiles data model attribute count parameter name and timestamp doc unit#8514

Draft
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/profiles-data-model-doc-fixes
Draft

Fix profiles data model attribute count parameter name and timestamp doc unit#8514
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/profiles-data-model-doc-fixes

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Description

  • ProfileData.create(...)'s 11th parameter is named droppedAttributesCount, but the value is exposed via getTotalAttributeCount() and ProfileMarshaler derives dropped from it (getTotalAttributeCount() - getAttributeIndices().size()). It holds the total, not the dropped count, so the name misleads callers. Rename it to totalAttributeCount.
  • This matches the Span family, where marshalers compute droppedAttributesCount = getTotalAttributeCount() - getAttributes().size() (e.g. SpanMarshaler, LogStatelessMarshaler).
  • SampleData.getTimestamps() javadoc said "represented in ms", but SampleMarshaler serializes to timestamps_unix_nano and the timestamps must fall within the profile's nanosecond range (ProfileData.getTimeNanos()). Fix the unit to nanoseconds.

Testing done

  • Docs/naming only — no behavior, signature, or wire-output change; test-exempt. Parameter names are not part of the binary signature, so japicmp shows no diff and no docs/apidiffs update is needed. Not user-facing, so no CHANGELOG entry.
  • ./gradlew :sdk:profiles:check passed (test + spotlessCheck + ErrorProne/NullAway + jApiCmp).

…doc unit

ProfileData.create's parameter was named droppedAttributesCount, but the
value is exposed via getTotalAttributeCount() and ProfileMarshaler derives
the dropped count as total minus attached attributes, mirroring the Span
family. Rename the parameter to totalAttributeCount to match the getter.

SampleData.getTimestamps() javadoc said timestamps are in ms, but
SampleMarshaler serializes them to the timestamps_unix_nano field and they
must fall within the profile's nanosecond time range. Fix the unit to
nanoseconds.
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.77%. Comparing base (824334c) to head (f8da8a8).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8514   +/-   ##
=========================================
  Coverage     78.77%   78.77%           
  Complexity     8579     8579           
=========================================
  Files          1009     1009           
  Lines         28993    28993           
  Branches       3599     3599           
=========================================
  Hits          22839    22839           
  Misses         5311     5311           
  Partials        843      843           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant