feat(attributes): Add Android Runtime (ART) GC and memory attributes#382
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Other
Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
I've split them into |
Add top-level runtime.* attributes mapping to the Sentry runtime context: runtime.name, runtime.version, runtime.build, and runtime.raw_description. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 11 new attributes under the `art` namespace for Android Runtime garbage collection stats and memory info, parsed from ANR thread dumps. GC attributes: gc_total_count, gc_total_time, gc_blocking_count, gc_blocking_time, gc_pre_oome_count, gc_waiting_time Memory attributes: free_memory, free_memory_until_gc, free_memory_until_oome, total_memory, max_memory Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename ART attribute keys to use dot-separated sub-namespaces, consistent with existing patterns like jvm.gc.*, jvm.memory.*, and browser.web_vital.*. GC attributes move under art.gc.* and memory attributes under art.memory.*, with a max nesting depth of 2 dots. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…espace Rename art.* attributes to runtime.art.* to nest them under the runtime context namespace. This aligns with the runtime context attribute structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6265928 to
4ee2e0c
Compare
|
Moving back to draft for now, as we need to sort out the "runtime" vs. "process.runtime" discussion first. |
|
From what I can tell otel also prefers setting runtime specifics into its own namespace e.g
It looks like |
|
what do you think of this, I had 🤖 run through the GC and Memory attributes of OTEL runtime conventions to check how we can align with naming:
|
…time namespace" This reverts commit 4ee2e0c.
Use dotted attribute names (e.g. gc.total_count, memory.free) to match the sentry-conventions schema from getsentry/sentry-conventions#382. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ART GC and memory attributes under the `art` namespace with dotted sub-namespaces (`art.gc.*`, `art.memory.*`). Remove incorrectly added top-level `runtime` context attributes. Add required `visibility: public` field to all ART attributes. Regenerate code. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
I decided to move these new attributes into a top-level |
| isInOtel: false, | ||
| visibility: 'public', | ||
| example: 1, | ||
| sdks: ['sentry.java.android'], |
There was a problem hiding this comment.
do we need to mention hybrid SDKs for all these, too?
There was a problem hiding this comment.
Ideally, this include a list of SDKs that set this attribute. Though I can see this become outdated super quickly, so honestly, no strong opinion.
| isInOtel: false, | ||
| visibility: 'public', | ||
| example: 1, | ||
| sdks: ['sentry.java.android'], |
There was a problem hiding this comment.
Ideally, this include a list of SDKs that set this attribute. Though I can see this become outdated super quickly, so honestly, no strong opinion.
... which means we don't interpret them as attributes in the product (as in, not filter/searchable in Explure UIs for example). I think this is fine if our plan here is to be forward-thinking and eventually set them as attributes once the Android SDK starts sending streamed spans (?). |
yes, that's the general idea |
Summary
Adds Android Runtime (ART) garbage collection and memory attributes for tracking GC activity and memory usage on Android. Similar to the existing
jvmanddotnettop-level event context attributes.GC attributes (
art.gc.*)art.gc.blocking_count/art.gc.blocking_time— blocking (stop-the-world) GCart.gc.total_count/art.gc.total_time— all GC activityart.gc.waiting_time— time threads spent waiting for GCart.gc.pre_oome_count— last-resort GCs before OutOfMemoryErrorMemory attributes (
art.memory.*)art.memory.free— free memory available to the processart.memory.free_until_gc— free memory before GC would triggerart.memory.free_until_oome— free memory before OOMart.memory.total/art.memory.max— allocated and max memory