Skip to content

feat(attributes): Add Android Runtime (ART) GC and memory attributes under runtime namespace#382

Draft
markushi wants to merge 4 commits into
mainfrom
feat/art-gc-attributes
Draft

feat(attributes): Add Android Runtime (ART) GC and memory attributes under runtime namespace#382
markushi wants to merge 4 commits into
mainfrom
feat/art-gc-attributes

Conversation

@markushi
Copy link
Copy Markdown
Member

@markushi markushi commented May 15, 2026

Summary

Adds Android Runtime (ART) garbage collection and memory attributes for tracking GC activity and memory usage on Android, nested under the runtime.* namespace.

Depends on #383.

GC attributes (runtime.art.gc.*)

  • runtime.art.gc.blocking_count / runtime.art.gc.blocking_time — blocking (stop-the-world) GC
  • runtime.art.gc.total_count / runtime.art.gc.total_time — all GC activity
  • runtime.art.gc.waiting_time — time threads spent waiting for GC
  • runtime.art.gc.pre_oome_count — last-resort GCs before OutOfMemoryError

Memory attributes (runtime.art.memory.*)

  • runtime.art.memory.free — free memory available to the process
  • runtime.art.memory.free_until_gc — free memory before GC would trigger
  • runtime.art.memory.free_until_oome — free memory before OOM
  • runtime.art.memory.total / runtime.art.memory.max — allocated and max memory

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Attributes

  • Add Android Runtime (ART) GC and memory attributes under runtime namespace by markushi in #382
  • Add calculated performance scores by loewenheim in #355
  • Add rpc.response.status_code attribute by alexander-alderman-webb in #352
  • Add rpc.method attribute by alexander-alderman-webb in #351
  • Add app vitals start attributes by buenaflor in #353
  • Add process.runtime.engine.* attributes by chargome in #347

Bug Fixes 🐛

Attributes

  • Increase some PII values by loewenheim in #373
  • Change several deprecation statuses to normalize to align with ingestion paths by constantinius in #350

Other

  • (create) Replace angle brackets in file names by loewenheim in #356

Internal Changes 🔧

  • (gh) Remove myself from CODEOWNERS by lcian in #354
  • Bump vulnerable pytest by alexander-alderman-webb in #360
  • Bump vulnerable js packages by chargome in #359

🤖 This preview updates automatically when you update the PR.

@markushi markushi marked this pull request as ready for review May 15, 2026 07:39
@markushi markushi requested review from a team, Lms24, cleptric, mjq and nsdeschenes as code owners May 15, 2026 07:39
@markushi markushi requested a review from a team May 15, 2026 07:55
Copy link
Copy Markdown
Contributor

@buenaflor buenaflor left a comment

Choose a reason for hiding this comment

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

I wonder if we should further split it into sub namespaces e.g

art.gc_blocking.count vs art.gc.blocking.count

@markushi
Copy link
Copy Markdown
Member Author

I wonder if we should further split it into sub namespaces e.g

art.gc_blocking.count vs art.gc.blocking.count

I've split them into art.gc and art.memory

markushi and others added 4 commits May 15, 2026 16:36
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>
@markushi markushi force-pushed the feat/art-gc-attributes branch from 6265928 to 4ee2e0c Compare May 15, 2026 14:40
@markushi markushi changed the title feat(attributes): Add Android Runtime (ART) GC and memory attributes feat(attributes): Add Android Runtime (ART) GC and memory attributes under runtime namespace May 15, 2026
@markushi markushi marked this pull request as draft May 15, 2026 14:52
@markushi
Copy link
Copy Markdown
Member Author

Moving back to draft for now, as we need to sort out the "runtime" vs. "process.runtime" discussion first.

@buenaflor
Copy link
Copy Markdown
Contributor

From what I can tell otel also prefers setting runtime specifics into its own namespace e.g

dotnet.gc.heap.total_allocated, jvm.gc.duration (and we also follow this with jvm)

It looks like art.gc.xyz fits as well

@buenaflor
Copy link
Copy Markdown
Contributor

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:

Key Description OTel alignment
art.memory.free Free heap memory available to the process ART-specific; V8 has available_size
art.memory.free_until_gc Free memory before next GC triggers ART-specific; Go has go.memory.gc.goal (target, not headroom)
art.memory.free_until_oome Free memory before OutOfMemoryError ART-specific
art.memory.committed Heap currently allocated to the process Matches jvm.memory.committed, .NET committed_size
art.memory.limit Maximum heap size the process can grow to Matches jvm.memory.limit, go.memory.limit
art.gc.collections Total GC collections since process start Matches dotnet.gc.collections, go.memory.gc.cycles
art.gc.duration Cumulative GC time since process start Matches jvm.gc.duration, v8js.gc.duration (leaf name)
art.gc.blocking_collections Stop-the-world GC collections since process start ART-specific; JVM uses jvm.gc.action attribute instead
art.gc.blocking_duration Cumulative stop-the-world GC time since process start ART-specific; closest to go.memory.gc.pause.duration
art.gc.pre_oome_collections Last-resort GC attempts to prevent OOM ART-specific
art.gc.wait_duration Cumulative thread wait time due to GC ART-specific

markushi added a commit to getsentry/sentry-java that referenced this pull request May 15, 2026
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>
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.

2 participants