Skip to content

Alter default clock implementation#1487

Merged
breedx-splk merged 2 commits intoopen-telemetry:mainfrom
embrace-io:fw/alter-default-clock
Jan 16, 2026
Merged

Alter default clock implementation#1487
breedx-splk merged 2 commits intoopen-telemetry:mainfrom
embrace-io:fw/alter-default-clock

Conversation

@fractalwrench
Copy link
Copy Markdown
Member

Goal

Builds on #1486 by altering the default Clock implementation used by opentelemetry-android. The approach used is to take a baseline time by subtracting SystemClock.elapsedRealTimeNanos from System.currentTimeMillis, then return the time by adding elapsedRealTimeNanos.

This approach works on all the API levels the SDK supports and provides a monotonic wall-clock time.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.52%. Comparing base (825b6a8) to head (d01d403).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1487      +/-   ##
==========================================
- Coverage   64.69%   64.52%   -0.18%     
==========================================
  Files         159      160       +1     
  Lines        3181     3185       +4     
  Branches      327      327              
==========================================
- Hits         2058     2055       -3     
- Misses       1020     1029       +9     
+ Partials      103      101       -2     

☔ View full report in Codecov by Sentry.
📢 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.

@fractalwrench fractalwrench force-pushed the fw/alter-default-clock branch from 26955af to dc7b233 Compare January 8, 2026 10:44
@fractalwrench fractalwrench force-pushed the fw/alter-default-clock branch from dc7b233 to fd41ed3 Compare January 14, 2026 06:59
@fractalwrench fractalwrench force-pushed the fw/alter-default-clock branch from fd41ed3 to d01d403 Compare January 14, 2026 14:18
Copy link
Copy Markdown
Contributor

@LikeTheSalad LikeTheSalad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🙏

@breedx-splk breedx-splk merged commit c09eb2e into open-telemetry:main Jan 16, 2026
7 of 8 checks passed
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.

Clock.getDefault() isn’t configurable; add platform-aware selection & override hooks Time drift android emulator

4 participants