Draft
Conversation
mujacica
approved these changes
Mar 30, 2026
Member
Author
|
CI currently fails because we now log from our Metrics Batcher that starts by default; we can fix this either by a) changing those logging tests to expect the output (but then starting the metrics batcher even if no metric is ever sent) |
* update test to expect batching thread log message * fix(tests): disable metrics in logger unit tests to avoid tsan race The batcher thread spawned by metrics startup logs via the custom logger callback, racing with the main thread's writes to assert_now. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Metrics captured by the Public API should be
opt-outas per develop docs.Since we don't have any internal auto-instrumented metrics, we enable it by default so calling⚠️ this does make it so our batching thread starts regardless of whether it actually has any work (see the discussion below).
sentry_metrics_Xwill just capture instead of requiring setting the option.Also updates the tests to reflect this change; by default it is true, but one can set it to false with
sentry_options_set_enable_metrics(options, false);(for example, when only wanting metrics for debug and not production).follow-up
opt-outas well.Discussion
CI currently fails because we now log from our Metrics Batcher Thread that starts by default; we can fix this either by
a) changing those logging tests to expect the output (but then starting the metrics batcher even if no metric is ever sent) #1612
b) adding a lazy init to the metrics/logs batcher #1611
enable_metricsjust starts it; maybe we only want to do so once the first metric is captured?onby default)