Skip to content

CPython runtime garbage collections metrics#1931

Merged
trask merged 25 commits intoopen-telemetry:mainfrom
xrmx:python-runtime-metrics
Mar 27, 2025
Merged

CPython runtime garbage collections metrics#1931
trask merged 25 commits intoopen-telemetry:mainfrom
xrmx:python-runtime-metrics

Conversation

@xrmx
Copy link
Copy Markdown
Contributor

@xrmx xrmx commented Feb 24, 2025

Fixes #1930

Changes

This adds 3 new metrics to track CPython runtime garbage collector work.

Note: if the PR is touching an area that is not listed in the existing areas, or the area does not have sufficient domain experts coverage, the PR might be tagged as experts needed and move slowly until experts are identified.

Merge requirement checklist

Comment thread docs/runtime/cpython-metrics.md Outdated
Comment thread docs/runtime/cpython-metrics.md Outdated
Comment thread docs/runtime/cpython-metrics.md
Comment thread model/cpython/metrics.yaml Outdated
Comment thread model/cpython/metrics.yaml Outdated
Comment thread docs/runtime/cpython-metrics.md Outdated
@trask
Copy link
Copy Markdown
Member

trask commented Feb 24, 2025

cc @open-telemetry/python-approvers @open-telemetry/opentelemetry-python-contrib-approvers

Comment thread model/cpython/metrics.yaml Outdated
Comment thread model/cpython/metrics.yaml Outdated
@xrmx xrmx force-pushed the python-runtime-metrics branch 2 times, most recently from 039cd81 to f9c7a06 Compare March 6, 2025 20:43
@kamalmarhubi
Copy link
Copy Markdown
Contributor

Drive-by from seeing this in the #otel-python channel on cncf slack. We recently implemented a metric like this, so I'd be quite happy to see this make its way into semconv / the python contrib repo.

We also added spans for gen2 collections, which helped us understand some gaps in our slow traces, and figure out we could improve tail latencies by calling gc.collect(generation=2) between handling requests in our synchronous web workers, as in this Rippling blog post.

Copy link
Copy Markdown
Member

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment thread docs/runtime/cpython-metrics.md Outdated
Comment thread docs/runtime/cpython-metrics.md Outdated
@lmolkova lmolkova moved this from Untriaged to Needs More Approval in Semantic Conventions Triage Mar 7, 2025
Comment thread docs/runtime/cpython-metrics.md Outdated
Comment thread model/cpython/metrics.yaml Outdated
Comment thread model/cpython/registry.yaml
Comment thread model/cpython/metrics.yaml Outdated
Comment thread model/cpython/metrics.yaml Outdated
Comment thread model/cpython/registry.yaml
@xrmx xrmx force-pushed the python-runtime-metrics branch from 8e5340b to 589e469 Compare March 24, 2025 08:55
@xrmx xrmx requested review from kamalmarhubi, lmolkova and trask March 25, 2025 13:36
Comment thread model/cpython/registry.yaml Outdated
Comment thread model/cpython/metrics.yaml Outdated
Comment thread model/cpython/metrics.yaml Outdated
Comment thread model/cpython/metrics.yaml Outdated
Comment thread model/cpython/metrics.yaml Outdated
Comment thread model/cpython/metrics.yaml Outdated
@trask trask enabled auto-merge (squash) March 27, 2025 14:51
@trask trask merged commit 219c3d9 into open-telemetry:main Mar 27, 2025
15 checks passed
dyladan pushed a commit to dyladan/semantic-conventions that referenced this pull request Mar 28, 2025
Co-authored-by: Liudmila Molkova <[email protected]>
Co-authored-by: Joao Grassi <[email protected]>
Co-authored-by: Trask Stalnaker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

CPython runtime gc metrics

6 participants