Skip to content

feat!: remove enable_logs/metrics - #1980

Draft
jpnurmi wants to merge 2 commits into
masterfrom
jpnurmi/feat/enable-logs-and-metrics
Draft

feat!: remove enable_logs/metrics#1980
jpnurmi wants to merge 2 commits into
masterfrom
jpnurmi/feat/enable-logs-and-metrics

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Important

BREAKING CHANGE

Remove sentry_options_get/set_enable_logs and sentry_options_get/set_enable_metrics

Structured logs and metrics have been enabled by default since 0.13.

We recognize that this change may inconvenience applications that rely on the opt-out. Use sentry_options_set_before_send_log or sentry_options_set_before_send_metric to filter logs or metrics. We made this tradeoff deliberately because consistent behavior across SDK integrations will help most users successfully adopt these features.

@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/enable-logs-and-metrics branch from abe79de to 6522a1f Compare August 12, 2026 10:18

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6522a1f. Configure here.

Comment thread tests/unit/test_logger.c
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.22%. Comparing base (aaf2432) to head (4eabf1e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1980   +/-   ##
=======================================
  Coverage   74.22%   74.22%           
=======================================
  Files         104      104           
  Lines       25361    25340   -21     
  Branches     4534     4527    -7     
=======================================
- Hits        18824    18809   -15     
+ Misses       5237     5232    -5     
+ Partials     1300     1299    -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@limbonaut

limbonaut commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Consensus changed towards making enable_logs noop, and removing it in the next major. Although, from compile-time safety perspective, it's less important for native.

@jpnurmi
jpnurmi marked this pull request as draft August 12, 2026 20:11
Comment thread src/sentry_telemetry.c
Comment on lines +10 to +11
sentry__logs_startup(options);
sentry__metrics_startup(options);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

one of my only concerns here is starting the batcher threads for every SDK user now, even if they never call a single log/metric API. but think there's probably no real way around this 🤔

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, these unconditional threads are a bit annoying, but fortunately quite cheap because they don't do anything besides waiting on the condition variable.

Perhaps lazy batcher creation/start could be one option? It might introduce some latency for the first log/metric call, but it would be justified because it speeds up SDK init for everyone, and moves the cost for those who actually use logs and metrics...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I had a prototype of this approach in #1611 that we ended up not doing back then, but might be worth reconsidering 👀

@JoshuaMoelans

Copy link
Copy Markdown
Member

I created a follow-up docs PR getsentry/sentry-docs#19041 , to be merged after we release this one

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.

3 participants