Skip to content

Fix ReadWriteLogRecord default getObservedTimestampEpochNanos returning record timestamp#8504

Draft
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/readwritelogrecord-observed-timestamp-default
Draft

Fix ReadWriteLogRecord default getObservedTimestampEpochNanos returning record timestamp#8504
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/readwritelogrecord-observed-timestamp-default

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8501

Description

  • ReadWriteLogRecord.getObservedTimestampEpochNanos() default returned toLogRecordData().getTimestampEpochNanos() instead of getObservedTimestampEpochNanos(), so implementations relying on the interface defaults got the record timestamp instead of the observed timestamp.
  • Matches the SDK implementation SdkReadWriteLogRecord.getObservedTimestampEpochNanos(), which returns the observedTimestampEpochNanos field, and the sibling default getTimestampEpochNanos(), which is correct. LogRecordData exposes both getters separately.
  • The slip was introduced when the default getters were added in Add getters/accessors for readable fields in ReadWriteLogRecord. #6924.

Testing done

  • Added ReadWriteLogRecordTest#defaultGetObservedTimestampEpochNanos_returnsObservedTimestamp, which exercises the interface defaults via a custom ReadWriteLogRecord whose LogRecordData has distinct timestamp (100) and observed timestamp (200). Fails before the fix (was 100), passes after.
  • ./gradlew :sdk:logs:check passed.
  • Added a ## Unreleased entry in CHANGELOG.md (replace #XXXX with the PR number).

@thswlsqls thswlsqls force-pushed the fix/readwritelogrecord-observed-timestamp-default branch from 299c092 to aa6aec0 Compare June 22, 2026 08:03
@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 (aa6aec0).

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

☔ 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.

ReadWriteLogRecord.getObservedTimestampEpochNanos() default returns the record timestamp

1 participant