-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Problem Statement
There are a number of different metrics in the processconv package that aren't using the Observable variants. I am trying to emit some more metrics like process.memory.usage but it's difficult to instrument this correct since that is an Int64UpDownCounter instead of an Int64ObservableUpDownCounter.
This would also make it easier to add these metrics into the go.opentelemetry.io/contrib/instrumentation/host which would be nice considering the Otel spec recommends to emit these metrics. https://opentelemetry.io/docs/specs/semconv/system/process-metrics/#metric-processmemoryusage
Proposed Solution
Update all metrics in processconv to use the Observable variants
Alternatives
I am planning on just creating my own Observable counters for the metrics I want to emit, but it would be nice to use the official semconv package so I didn't have to define that myself.
Prior Art
In the host metrics instrumentation, they are already emitting some metrics using this pattern. https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/instrumentation/host/host.go#L235-L239
You can see that CPUTime for example is an ObservableFloat64. https://github.com/open-telemetry/opentelemetry-go/blob/main/semconv/v1.37.0/processconv/metric.go#L215-L225
I tried looking into adding my own instrumentation so that I could emit more metrics like process.memory.usage but I noticed that that metric in processconv wasn't an Observable. https://github.com/open-telemetry/opentelemetry-go/blob/main/semconv/v1.37.0/processconv/metric.go#L501-L511 So it was difficult to emit like the CPUTime was.