Repository navigation
feat(attributes): Add CPython garbage collection conventions - #719
Draft
sentrivana wants to merge 1 commit into
Draft
sentrivana wants to merge 1 commit into
sentrivana wants to merge 1 commit into
Conversation
Add conventions for spans that represent a run of the CPython garbage collector, to be emitted by an upcoming GC integration in the Python SDK. - cpython.gc.generation: the generation that was collected. Defined in OTel, so it's added with is_in_otel: true. - cpython.gc.collected_objects and cpython.gc.uncollectable_objects: the object counts of a single run. OTel only has counter metrics with these names, which track totals since interpreter start. - A new `runtime` op category with a `gc` op. - A span name convention for `gc` spans: "Garbage collection".
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds conventions for spans that represent a run of the CPython garbage collector. These will be emitted by an upcoming GC integration in the Python SDK, which hooks into
gc.callbacksand creates a child span of the active span for each (by default: full) collection.Attributes (
model/attributes/cpython/, all integers):cpython.gc.generation: the generation that was collected. Defined in OTel, sois_in_otel: true. Has a note about free-threaded builds, where the GC isn't generational: every collection is a full one, automatic collections report generation 0.cpython.gc.collected_objects: the number of objects collected in a single run.cpython.gc.uncollectable_objects: the number of uncollectable objects found in a single run.OTel only defines
cpython.gc.collected_objectsandcpython.gc.uncollectable_objectsas counter metrics (totals since interpreter start), not as attributes, so the two count attributes areis_in_otel: falseand have a note pointing out the difference.Op: a new
runtimecategory with agcop. None of the existing categories fit, and other runtime ops could live there in the future.Span name: a
runtimename convention mapping thegcop to the static nameGarbage collection.PR Checklist
yarn testand verified that the tests pass.yarn generateto generate and format code and docs.If an attribute was added:
nextjs.function_id, notfunction_id)apply_scrubbing(i.e.manualorauto. Useneveronly for values that should never be scrubbed such as IDs)