Skip to content

procmeta/runtimeinfo: report process.runtime.name and process.runtime.version - #1770

Draft
nsavoire wants to merge 3 commits into
open-telemetry:mainfrom
DataDog:nsavoire/resource_enricher_runtime
Draft

procmeta/runtimeinfo: report process.runtime.name and process.runtime.version#1770
nsavoire wants to merge 3 commits into
open-telemetry:mainfrom
DataDog:nsavoire/resource_enricher_runtime

Conversation

@nsavoire

Copy link
Copy Markdown
Contributor

Reports process.runtime.name and process.runtime.version per process, derived from the
interpreter instances already attached to it: a new RuntimeInfo() on interpreter.Instance, plus a
procmeta.ResourceEnricher that selects among them and emits the attributes.

A process may host several runtimes, so the enricher prefers the one whose DSO is the process's own
executable, falls back to the lexicographically smallest for determinism, and resolves once until the
executable changes. All of that policy lives in the enricher, so no runtime-specific code is added to
the process manager. Relates to #1716.

Draft, since the first two commits add the procmeta.ResourceEnricher extension point this builds
on, which is a separate change.

MetaEnricher collects metadata once, when a process is first observed, which is
too early for a region published after startup or a runtime whose interpreter
attaches later. ResourceEnricher runs on every resynchronization and returns an
immutable resource, merged by MergeResources in registration order, later ones
winning. No callers yet.
Run the registered ResourceEnrichers at the end of every SynchronizeProcess,
once the mapping pass and the interpreter attach are done, and publish the merge
of their contributions. Enrichers run without pm.mu held, receive the mappings
their WantMapping selected plus a per-process state slot dropped with the
processInfo, and the merge is republished only when one reports a change.
Report process.runtime.name and process.runtime.version from the attached
interpreter instances, through a new RuntimeInfo() on interpreter.Instance and a
second ResourceEnricher. Runtimes resolve late, once an interpreter attaches. A
process may host several: prefer the one whose DSO is the process's executable,
else the lexicographically smallest, resolved fill-once until the exe changes.
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.

1 participant