feat(effect): Add extra opt-in for logs and metrics#19755
feat(effect): Add extra opt-in for logs and metrics#19755JPeer264 merged 2 commits intojp/add-effect-sdkfrom
Conversation
size-limit report 📦
|
| * dsn: '__DSN__', | ||
| * enableLogs: true, | ||
| * enableMetrics: true, | ||
| * enableEffectLogs: true, |
There was a problem hiding this comment.
m: We should probably keep enableLogs in the example too, otherwise you wouldn't get logs just with this right?
There was a problem hiding this comment.
That is true, let's keep that in.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| attributes: { ...attributes, word }, | ||
| }); | ||
| } | ||
| } |
There was a problem hiding this comment.
Frequency metrics overcounted on every periodic flush
High Severity
Frequency metrics use sentryMetrics.count with cumulative occurrence values from metricState.occurrences, but unlike counter metrics, they bypass the delta calculation in sendDeltaMetricToSentry. Since flushMetricsToSentry runs every 10 seconds via the layer's scheduler, each flush re-sends the full cumulative count. After N flushes, Sentry shows roughly N × actual_count for each word. Frequency metrics need the same delta treatment that counters receive.
Additional Locations (1)
87daa55 to
5beef22
Compare
5beef22 to
930bbf5
Compare
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|


This PR is now adding a different naming schema for enabling logs and metrics based on: https://develop.sentry.dev/sdk/telemetry/metrics/#auto-emitted-metrics
For the logs I also added them, which might not make the most sense, as
enableLogsis nowfalseby default, which means that there is a double opt-in needed to make logs work viaEffect.log.The naming is TBD, but this is the best I came up with:
enableEffectLogs&enableEffectMetrics