containerconv
v1.47.0
Documentation
pkg.go.dev ↗Package containerconv provides types and functionality for OpenTelemetry semantic conventions in the "container" namespace.
Types
CPUModeAttr
type CPUModeAttr string
CPUModeAttr is an attribute conforming to the cpu.mode semantic conventions. It represents the CPU mode for this data point. A container's CPU metric SHOULD be characterized *either* by data points with no `mode` labels, *or only* data points with `mode` labels.
CPUModeUser (8 declarations)
var ( // CPUModeUser is the none. CPUModeUser CPUModeAttr = "user" // CPUModeSystem is the none. CPUModeSystem CPUModeAttr = "system" // CPUModeNice is the none. CPUModeNice CPUModeAttr = "nice" // CPUModeIdle is the none. CPUModeIdle CPUModeAttr = "idle" // CPUModeIOWait is the none. CPUModeIOWait CPUModeAttr = "iowait" // CPUModeInterrupt is the none. CPUModeInterrupt CPUModeAttr = "interrupt" // CPUModeSteal is the none. CPUModeSteal CPUModeAttr = "steal" // CPUModeKernel is the none. CPUModeKernel CPUModeAttr = "kernel" )
CPUTime
type CPUTime struct {
metric.Float64Counter
}
CPUTime is an instrument used to record metric values conforming to the "container.cpu.time" semantic conventions. It represents the total CPU time consumed.
NewCPUTime
func NewCPUTime( m metric.Meter, opt ...metric.Float64CounterOption, ) (CPUTime, error)
NewCPUTime returns a new CPUTime instrument.
CPUTime.Add
func (m CPUTime) Add( ctx context.Context, incr float64, attrs ...attribute.KeyValue, )
Add adds incr to the existing count.
All additional attrs passed are included in the recorded value.
Total CPU time consumed by the specific container on all available CPU cores
CPUTime.AttrCPUMode
func (CPUTime) AttrCPUMode(val CPUModeAttr) attribute.KeyValue
AttrCPUMode returns an optional attribute for the "cpu.mode" semantic convention. It represents the CPU mode for this data point. A container's CPU metric SHOULD be characterized *either* by data points with no `mode` labels, *or only* data points with `mode` labels.
CPUTime.Description
func (CPUTime) Description() string
Description returns the semantic convention description of the instrument
CPUTime.Inst
func (m CPUTime) Inst() metric.Float64Counter
Inst returns the underlying metric instrument.
CPUTime.Name
func (CPUTime) Name() string
Name returns the semantic convention name of the instrument.
CPUTime.Unit
func (CPUTime) Unit() string
Unit returns the semantic convention unit of the instrument
CPUUsage
type CPUUsage struct {
metric.Int64Gauge
}
CPUUsage is an instrument used to record metric values conforming to the "container.cpu.usage" semantic conventions. It represents the container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs.
NewCPUUsage
func NewCPUUsage( m metric.Meter, opt ...metric.Int64GaugeOption, ) (CPUUsage, error)
NewCPUUsage returns a new CPUUsage instrument.
CPUUsage.AttrCPUMode
func (CPUUsage) AttrCPUMode(val CPUModeAttr) attribute.KeyValue
AttrCPUMode returns an optional attribute for the "cpu.mode" semantic convention. It represents the CPU mode for this data point. A container's CPU metric SHOULD be characterized *either* by data points with no `mode` labels, *or only* data points with `mode` labels.
CPUUsage.Description
func (CPUUsage) Description() string
Description returns the semantic convention description of the instrument
CPUUsage.Inst
func (m CPUUsage) Inst() metric.Int64Gauge
Inst returns the underlying metric instrument.
CPUUsage.Name
func (CPUUsage) Name() string
Name returns the semantic convention name of the instrument.
CPUUsage.Record
func (m CPUUsage) Record( ctx context.Context, val int64, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
All additional attrs passed are included in the recorded value.
CPU usage of the specific container on all available CPU cores, averaged over the sample window
CPUUsage.Unit
func (CPUUsage) Unit() string
Unit returns the semantic convention unit of the instrument
DiskIO
type DiskIO struct {
metric.Int64Counter
}
DiskIO is an instrument used to record metric values conforming to the "container.disk.io" semantic conventions. It represents the disk bytes for the container.
NewDiskIO
func NewDiskIO( m metric.Meter, opt ...metric.Int64CounterOption, ) (DiskIO, error)
NewDiskIO returns a new DiskIO instrument.
DiskIO.Add
func (m DiskIO) Add( ctx context.Context, incr int64, attrs ...attribute.KeyValue, )
Add adds incr to the existing count.
All additional attrs passed are included in the recorded value.
The total number of bytes read/written successfully (aggregated from all disks).
DiskIO.AttrDiskIODirection
func (DiskIO) AttrDiskIODirection(val DiskIODirectionAttr) attribute.KeyValue
AttrDiskIODirection returns an optional attribute for the "disk.io.direction" semantic convention. It represents the disk IO operation direction.
DiskIO.AttrSystemDevice
func (DiskIO) AttrSystemDevice(val string) attribute.KeyValue
AttrSystemDevice returns an optional attribute for the "system.device" semantic convention. It represents the device identifier.
DiskIO.Description
func (DiskIO) Description() string
Description returns the semantic convention description of the instrument
DiskIO.Inst
func (m DiskIO) Inst() metric.Int64Counter
Inst returns the underlying metric instrument.
DiskIO.Name
func (DiskIO) Name() string
Name returns the semantic convention name of the instrument.
DiskIO.Unit
func (DiskIO) Unit() string
Unit returns the semantic convention unit of the instrument
DiskIODirectionAttr
type DiskIODirectionAttr string
DiskIODirectionAttr is an attribute conforming to the disk.io.direction semantic conventions. It represents the disk IO operation direction.
DiskIODirectionRead (2 declarations)
var ( // DiskIODirectionRead is the none. DiskIODirectionRead DiskIODirectionAttr = "read" // DiskIODirectionWrite is the none. DiskIODirectionWrite DiskIODirectionAttr = "write" )
MemoryUsage
type MemoryUsage struct {
metric.Int64Counter
}
MemoryUsage is an instrument used to record metric values conforming to the "container.memory.usage" semantic conventions. It represents the memory usage of the container.
NewMemoryUsage
func NewMemoryUsage( m metric.Meter, opt ...metric.Int64CounterOption, ) (MemoryUsage, error)
NewMemoryUsage returns a new MemoryUsage instrument.
MemoryUsage.Add
func (m MemoryUsage) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
Add adds incr to the existing count.
Memory usage of the container.
MemoryUsage.Description
func (MemoryUsage) Description() string
Description returns the semantic convention description of the instrument
MemoryUsage.Inst
func (m MemoryUsage) Inst() metric.Int64Counter
Inst returns the underlying metric instrument.
MemoryUsage.Name
func (MemoryUsage) Name() string
Name returns the semantic convention name of the instrument.
MemoryUsage.Unit
func (MemoryUsage) Unit() string
Unit returns the semantic convention unit of the instrument
NetworkIO
type NetworkIO struct {
metric.Int64Counter
}
NetworkIO is an instrument used to record metric values conforming to the "container.network.io" semantic conventions. It represents the network bytes for the container.
NewNetworkIO
func NewNetworkIO( m metric.Meter, opt ...metric.Int64CounterOption, ) (NetworkIO, error)
NewNetworkIO returns a new NetworkIO instrument.
NetworkIO.Add
func (m NetworkIO) Add( ctx context.Context, incr int64, attrs ...attribute.KeyValue, )
Add adds incr to the existing count.
All additional attrs passed are included in the recorded value.
The number of bytes sent/received on all network interfaces by the container.
NetworkIO.AttrNetworkIODirection
func (NetworkIO) AttrNetworkIODirection(val NetworkIODirectionAttr) attribute.KeyValue
AttrNetworkIODirection returns an optional attribute for the "network.io.direction" semantic convention. It represents the network IO operation direction.
NetworkIO.AttrNetworkInterfaceName
func (NetworkIO) AttrNetworkInterfaceName(val string) attribute.KeyValue
AttrNetworkInterfaceName returns an optional attribute for the "network.interface.name" semantic convention. It represents the network interface name.
NetworkIO.Description
func (NetworkIO) Description() string
Description returns the semantic convention description of the instrument
NetworkIO.Inst
func (m NetworkIO) Inst() metric.Int64Counter
Inst returns the underlying metric instrument.
NetworkIO.Name
func (NetworkIO) Name() string
Name returns the semantic convention name of the instrument.
NetworkIO.Unit
func (NetworkIO) Unit() string
Unit returns the semantic convention unit of the instrument
NetworkIODirectionAttr
type NetworkIODirectionAttr string
NetworkIODirectionAttr is an attribute conforming to the network.io.direction semantic conventions. It represents the network IO operation direction.
NetworkIODirectionTransmit (2 declarations)
var ( // NetworkIODirectionTransmit is the none. NetworkIODirectionTransmit NetworkIODirectionAttr = "transmit" // NetworkIODirectionReceive is the none. NetworkIODirectionReceive NetworkIODirectionAttr = "receive" )
Uptime
type Uptime struct {
metric.Float64Gauge
}
Uptime is an instrument used to record metric values conforming to the "container.uptime" semantic conventions. It represents the time the container has been running.
NewUptime
func NewUptime( m metric.Meter, opt ...metric.Float64GaugeOption, ) (Uptime, error)
NewUptime returns a new Uptime instrument.
Uptime.Description
func (Uptime) Description() string
Description returns the semantic convention description of the instrument
Uptime.Inst
func (m Uptime) Inst() metric.Float64Gauge
Inst returns the underlying metric instrument.
Uptime.Name
func (Uptime) Name() string
Name returns the semantic convention name of the instrument.
Uptime.Record
func (m Uptime) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue)
Record records val to the current distribution.
Instrumentations SHOULD use a gauge with type `double` and measure uptime in seconds as a floating point number with the highest precision available. The actual accuracy would depend on the instrumentation and operating system.
Uptime.Unit
func (Uptime) Unit() string
Unit returns the semantic convention unit of the instrument