feat: add sentry_is_enabled() - #2045
Merged
Merged
Conversation
|
jpnurmi
force-pushed
the
jpnurmi/feat/is-enabled
branch
from
September 2, 2026 09:56
dc3e95d to
ba0f821
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2045 +/- ##
==========================================
+ Coverage 74.37% 74.41% +0.03%
==========================================
Files 103 103
Lines 26665 26670 +5
Branches 4852 4852
==========================================
+ Hits 19832 19846 +14
+ Misses 5501 5488 -13
- Partials 1332 1336 +4 🚀 New features to boost your workflow:
|
limbonaut
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
sentry_is_enabled()as a thread-safe public API for checking whether the SDK has completed initialization and has not yet been closed. It returns0before initialization, after initialization failure, and aftersentry_close().This is inspired by many other Sentry SDKs, and motivated by #1980, which needs a way to determine whether the SDK is initialized to avoid duplicating private state checks in the logging and metrics implementations.
Originally proposed by @limbonaut in #2000 (comment)