Documentation
¶
Overview ¶
Package httpconv provides types and functionality for OpenTelemetry semantic conventions in the "cpu" namespace.
Index ¶
- type Frequency
- type ModeAttr
- type Time
- type Utilization
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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.
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 (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.
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