Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a custom time provider in TracerProviderBase #158

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

mikebosland
Copy link
Contributor

This mirrors the capability in WebTracerProvider.

Which problem is this PR solving?

I have an opentelemetry implementation using the Dart library (thanks!). I've noticed clock skew between my web/flutter client and dart backend. I have clock synchronisation in the client. This PR allows me to provide my own TimeProvider which exposes synchronised time time, nicely aligning traces between app and server.

The WebTracerProvider constructor does allow providing a TimeProvider, but cannot be used in non-web platforms.

Fixes # 99 which is expanded in opentelemetry-js 1652

Short description of the change

Simply provide a named parameter to override the default TimeProvider in the TracerProviderBase, as is done in the WebTracerProvider.

How Has This Been Tested?

I have added a unit test demonstrating a custom time provider.

Checklist:

  • Unit tests have been added
  • Documentation has been updated
    • The README.md references a TimeProvider for WebTracerProvider. Should I update for TracerProviderBase?

This mirrors the capability in WebTracerProvider.
@aviary2-wf
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@mikebosland
Copy link
Contributor Author

This is my first pull request!

Remove redundant @Protected annotation on private member.

Co-authored-by: Blake Roberts <[email protected]>
Copy link
Contributor Author

@mikebosland mikebosland left a comment

Choose a reason for hiding this comment

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

Thanks for the review!

This is my first proposal / use of github for code changes. Please let me know if there's something more I should be doing. :)

@blakeroberts-wk
Copy link
Contributor

QA +1 CI is sufficient

@blakeroberts-wk
Copy link
Contributor

@Workiva/release-management-p

Copy link

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

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

+1 from RM

@rmconsole5-wk rmconsole5-wk merged commit abf182f into Workiva:master Apr 17, 2024
4 checks passed
@mikebosland mikebosland deleted the custom-time-provider branch April 17, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants