Skip to content

refactor: Replace OnceCell with std::sync::OnceLock #2899

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

Closed
wants to merge 2 commits into from

Conversation

FalkWoldmann
Copy link

Fixes #
Design discussion issue (if applicable) #

Changes

Replaces once_cell::sync::OnceCell with itsstd equivalent. We cannot yet remove the whole once_cell crate, since we still use Lazy and its std counterpart LazyLock requires rust 1.80

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@FalkWoldmann FalkWoldmann requested a review from a team as a code owner April 3, 2025 21:32
Copy link

linux-foundation-easycla bot commented Apr 3, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

Copy link

codecov bot commented Apr 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.0%. Comparing base (86e842c) to head (99c05ec).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2899   +/-   ##
=====================================
  Coverage   81.0%   81.0%           
=====================================
  Files        125     125           
  Lines      23945   23945           
=====================================
  Hits       19414   19414           
  Misses      4531    4531           

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

@lalitb
Copy link
Member

lalitb commented Apr 4, 2025

Changes look good, but I believe this crate won't accept changes any longer as mentioned here - https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-prometheus

-clip
Warning: This crate is no longer recommended for use.

Development of the Prometheus exporter has been discontinued. See the related #2451. This crate depends on the unmaintained protobuf crate and has unresolved security vulnerabilities. Version 0.29 will be the final release.

For Prometheus integration, we strongly recommend using the OTLP exporter instead. Prometheus natively supports OTLP, providing a more stable and actively maintained solution.

@FalkWoldmann
Copy link
Author

Ah, I missed this comment. Thanks for the feedback!

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.

2 participants