Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPython runtime garbage collections metrics #1931

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

xrmx
Copy link
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

@trask
Copy link
Member

trask commented Feb 24, 2025

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


- id: metric.cpython.gc.collected
type: metric
metric_name: cpython.gc.collected
Copy link
Contributor

Choose a reason for hiding this comment

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

With cpython.gc.collected name it can be confusing to have number of object and the amount of memory (if we ever report it).

It'd be great to be specific in the metric name, e.g. call it

Suggested change
metric_name: cpython.gc.collected
metric_name: cpython.gc.collected.objects

Copy link
Contributor Author

@xrmx xrmx Mar 5, 2025

Choose a reason for hiding this comment

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

I can do that but we don't have any stats in bytes, this 3 metrics per gc generation are everything we have from gc.get_stats()

- ref: cpython.gc.generation
requirement_level: required

- id: metric.cpython.gc.uncollectable
Copy link
Contributor

Choose a reason for hiding this comment

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

similar to the previous comment, it'd be great to have explicit name like

Suggested change
- id: metric.cpython.gc.uncollectable
- id: metric.cpython.gc.uncollectable.objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

CPython runtime gc metrics
4 participants