package cpuconv
import "go.opentelemetry.io/otel/semconv/v1.32.0/cpuconv"
Package httpconv provides types and functionality for OpenTelemetry semantic conventions in the "cpu" namespace.
Index ¶
- type Frequency
- func NewFrequency( m metric.Meter, opt ...metric.Int64GaugeOption, ) (Frequency, error)
- func (Frequency) AttrLogicalNumber(val int) attribute.KeyValue
- func (Frequency) Description() string
- func (m Frequency) Inst() metric.Int64Gauge
- func (Frequency) Name() string
- func (m Frequency) Record( ctx context.Context, val int64, attrs ...attribute.KeyValue, )
- func (Frequency) Unit() string
- type ModeAttr
- type Time
- func NewTime( m metric.Meter, opt ...metric.Float64ObservableCounterOption, ) (Time, error)
- func (Time) AttrLogicalNumber(val int) attribute.KeyValue
- func (Time) AttrMode(val ModeAttr) attribute.KeyValue
- func (Time) Description() string
- func (m Time) Inst() metric.Float64ObservableCounter
- func (Time) Name() string
- func (Time) Unit() string
- type Utilization
- func NewUtilization( m metric.Meter, opt ...metric.Int64GaugeOption, ) (Utilization, error)
- func (Utilization) AttrLogicalNumber(val int) attribute.KeyValue
- func (Utilization) AttrMode(val ModeAttr) attribute.KeyValue
- func (Utilization) Description() string
- func (m Utilization) Inst() metric.Int64Gauge
- func (Utilization) Name() string
- func (m Utilization) Record( ctx context.Context, val int64, attrs ...attribute.KeyValue, )
- func (Utilization) Unit() string
Types ¶
type Frequency ¶
type Frequency struct { metric.Int64Gauge }
Frequency is an instrument used to record metric values conforming to the "cpu.frequency" semantic conventions. It represents the operating frequency of the logical CPU in Hertz.
func NewFrequency ¶
NewFrequency returns a new Frequency instrument.
func (Frequency) AttrLogicalNumber ¶
AttrLogicalNumber returns an optional attribute for the "cpu.logical_number" semantic convention. It represents the logical CPU number [0..n-1].
func (Frequency) Description ¶
Description returns the semantic convention description of the instrument
func (Frequency) Inst ¶
func (m Frequency) Inst() metric.Int64Gauge
Inst returns the underlying metric instrument.
func (Frequency) Name ¶
Name returns the semantic convention name of the instrument.
func (Frequency) Record ¶
Record records val to the current distribution.
All additional attrs passed are included in the recorded value.
func (Frequency) Unit ¶
Unit returns the semantic convention unit of the instrument
type ModeAttr ¶
type ModeAttr string
ModeAttr is an attribute conforming to the cpu.mode semantic conventions. It represents the mode of the CPU.
var ( // ModeUser is the none. ModeUser ModeAttr = "user" // ModeSystem is the none. ModeSystem ModeAttr = "system" // ModeNice is the none. ModeNice ModeAttr = "nice" // ModeIdle is the none. ModeIdle ModeAttr = "idle" // ModeIOWait is the none. ModeIOWait ModeAttr = "iowait" // ModeInterrupt is the none. ModeInterrupt ModeAttr = "interrupt" // ModeSteal is the none. ModeSteal ModeAttr = "steal" // ModeKernel is the none. ModeKernel ModeAttr = "kernel" )
type Time ¶
type Time struct { metric.Float64ObservableCounter }
Time is an instrument used to record metric values conforming to the "cpu.time" semantic conventions. It represents the seconds each logical CPU spent on each mode.
func NewTime ¶
NewTime returns a new Time instrument.
func (Time) AttrLogicalNumber ¶
AttrLogicalNumber returns an optional attribute for the "cpu.logical_number" semantic convention. It represents the logical CPU number [0..n-1].
func (Time) AttrMode ¶
AttrMode returns an optional attribute for the "cpu.mode" semantic convention. It represents the mode of the CPU.
func (Time) Description ¶
Description returns the semantic convention description of the instrument
func (Time) Inst ¶
func (m Time) Inst() metric.Float64ObservableCounter
Inst returns the underlying metric instrument.
func (Time) Name ¶
Name returns the semantic convention name of the instrument.
func (Time) Unit ¶
Unit returns the semantic convention unit of the instrument
type Utilization ¶
type Utilization struct { metric.Int64Gauge }
Utilization is an instrument used to record metric values conforming to the "cpu.utilization" semantic conventions. It represents the for each logical CPU, the utilization is calculated as the change in cumulative CPU time (cpu.time) over a measurement interval, divided by the elapsed time.
func NewUtilization ¶
func NewUtilization( m metric.Meter, opt ...metric.Int64GaugeOption, ) (Utilization, error)
NewUtilization returns a new Utilization instrument.
func (Utilization) AttrLogicalNumber ¶
func (Utilization) AttrLogicalNumber(val int) attribute.KeyValue
AttrLogicalNumber returns an optional attribute for the "cpu.logical_number" semantic convention. It represents the logical CPU number [0..n-1].
func (Utilization) AttrMode ¶
func (Utilization) AttrMode(val ModeAttr) attribute.KeyValue
AttrMode returns an optional attribute for the "cpu.mode" semantic convention. It represents the mode of the CPU.
func (Utilization) Description ¶
func (Utilization) Description() string
Description returns the semantic convention description of the instrument
func (Utilization) Inst ¶
func (m Utilization) Inst() metric.Int64Gauge
Inst returns the underlying metric instrument.
func (Utilization) Name ¶
func (Utilization) Name() string
Name returns the semantic convention name of the instrument.
func (Utilization) Record ¶
Record records val to the current distribution.
All additional attrs passed are included in the recorded value.
func (Utilization) Unit ¶
func (Utilization) Unit() string
Unit returns the semantic convention unit of the instrument
Source Files ¶
metric.go
- Version
- v1.36.0 (latest)
- Published
- May 21, 2025
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 4 hours ago –
Tools for package owners.