Conversation
0a75de8 to
76f4c08
Compare
76f4c08 to
ba29223
Compare
ba29223 to
9b9e2f1
Compare
8e3778f to
36c1b3e
Compare
whatyouhide
left a comment
There was a problem hiding this comment.
Have we considered doing this via the extremely well-established https://github.com/beam-telemetry/telemetry_poller under the hood?
@whatyouhide yeah we could but custom plumbing would still be needed. Do you think it'd still be better? I'm all for having less code over here of course. |
|
@solnic yes I think it's worth it. |
36c1b3e to
0ee95b0
Compare
29d2d1f to
8b3520f
Compare
8b3520f to
b6553a4
Compare
| _ = :telemetry.attach_many(@handler_id, @events, &__MODULE__.handle_event/4, config(opts)) | ||
|
|
||
| :ok | ||
| end |
There was a problem hiding this comment.
Startup crash without telemetry present
Medium Severity
Enabling metrics.runtime calls :telemetry.attach_many/4 during application start with no check that :telemetry (or telemetry_poller) is loaded. Both are optional dependencies, so a boot with runtime: [enabled: true] and no telemetry raises UndefinedFunctionError and takes down the :sentry app. Tracing already warns and disables itself when its optional stack is missing; this path does not. If telemetry is present but telemetry_poller is not, the handler still attaches and the feature silently never reports.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b6553a4. Configure here.
b6553a4 to
7bb7b13
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7bb7b13. Configure here.
| if runtime_config[:enabled] do | ||
| Sentry.Metrics.Runtime.attach(runtime_config) | ||
| end | ||
| end |
There was a problem hiding this comment.
Boot crash without telemetry loaded
High Severity
Enabling metrics.runtime.enabled calls :telemetry.attach_many from maybe_attach_runtime_metrics during application start with no check that :telemetry is available. Both :telemetry and :telemetry_poller are optional, so that call raises and fails host-app boot when the library is not on the path or not started yet.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 7bb7b13. Configure here.


Adds automatic BEAM runtime metrics. It must be enabled in your config:
Once enabled, memory usage is reported as gauges, in bytes:
elixir.runtime.mem.totalelixir.runtime.mem.processeselixir.runtime.mem.processes_usedelixir.runtime.mem.systemelixir.runtime.mem.atomelixir.runtime.mem.atom_usedelixir.runtime.mem.binaryelixir.runtime.mem.codeelixir.runtime.mem.etsCollection frequency
The SDK handles
telemetry_poller's events to get the data, the interval can be adjusted using the following config: