Go: Add opt-in CPU metric, and detailed opt-in attributes#3627
Go: Add opt-in CPU metric, and detailed opt-in attributes#3627lmolkova merged 6 commits intoopen-telemetry:mainfrom
Conversation
92f13d6 to
d04c7e2
Compare
d04c7e2 to
9d0a7d5
Compare
|
One thing that may be confusing with the taken approach is that users may expect that
Did you mean change the values reported on the |
The sum of all attributes must sum to the memory usage of the go process, otherwise it isn't useful. So we can aggregate the detailed, unstable values into higher-leveled ones, but we can't simply omit categories of memory usage without breaking the total. When we aggregate, it would be misleading to re-use the same attribute values to mean different things. |
joaopgrassi
left a comment
There was a problem hiding this comment.
Looks like the tables need updating, after that we can merge.
Co-authored-by: Christophe Kamphaus <christophe.kamphaus@gmail.com>
a7526bf to
dae9312
Compare
Fixes #3354
Related to open-telemetry/opentelemetry-go-contrib#6321
Also includes a request from golang/go#67120 (comment) for detailed CPU metrics.
Changes
All additions are all opt-in:
go.cpu.time, which hasgo.cpu.stateandgo.cpu.detailed_state.go.memory.detailed_typetogo.memory.usage.My goals with this are:
The approach i've taken is to use two attributes:
go.cpu.stateorgo.memory.type, which has a set of stable, well-defined constants that are useful to most users and highly unlikely to change. E.g. "stack" for memory, or "gc" for CPU.go.cpu.detailed_stateandgo.memory.detailed_type, which will provide all of the categories offered by the go runtime for each version: https://pkg.go.dev/runtime/metrics#hdr-Supported_metrics based on a prefix (cpu/classes/* and memory/classes/* respectively).Enabling the opt-in attribute increases cardinality, since multiple detailed types/states can apply to each of the high-level types/states.
Alternatives Considered
We could instead have separate metrics for detailed and basic attributes. This is more expensive without much benefit.
We could instead change the values reported to the detailed ones based on user configuration. This would break existing usage of the high-level attributes when a user enables the detailed ones.
Merge requirement checklist
[chore]Gemini helped me copy descriptions over from the runtime metrics documentation.
@open-telemetry/go-approvers @jmacd