package hwconv
import "go.opentelemetry.io/otel/semconv/v1.32.0/hwconv"
Package httpconv provides types and functionality for OpenTelemetry semantic conventions in the "hw" namespace.
Index ¶
- type Energy
- func NewEnergy( m metric.Meter, opt ...metric.Int64CounterOption, ) (Energy, error)
- func (m Energy) Add( ctx context.Context, incr int64, id string, hwType TypeAttr, attrs ...attribute.KeyValue, )
- func (Energy) AttrName(val string) attribute.KeyValue
- func (Energy) AttrParent(val string) attribute.KeyValue
- func (Energy) Description() string
- func (m Energy) Inst() metric.Int64Counter
- func (Energy) Name() string
- func (Energy) Unit() string
- type ErrorTypeAttr
- type Errors
- func NewErrors( m metric.Meter, opt ...metric.Int64CounterOption, ) (Errors, error)
- func (m Errors) Add( ctx context.Context, incr int64, id string, hwType TypeAttr, attrs ...attribute.KeyValue, )
- func (Errors) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue
- func (Errors) AttrName(val string) attribute.KeyValue
- func (Errors) AttrParent(val string) attribute.KeyValue
- func (Errors) Description() string
- func (m Errors) Inst() metric.Int64Counter
- func (Errors) Name() string
- func (Errors) Unit() string
- type HostAmbientTemperature
- func NewHostAmbientTemperature( m metric.Meter, opt ...metric.Int64GaugeOption, ) (HostAmbientTemperature, error)
- func (HostAmbientTemperature) AttrName(val string) attribute.KeyValue
- func (HostAmbientTemperature) AttrParent(val string) attribute.KeyValue
- func (HostAmbientTemperature) Description() string
- func (m HostAmbientTemperature) Inst() metric.Int64Gauge
- func (HostAmbientTemperature) Name() string
- func (m HostAmbientTemperature) Record( ctx context.Context, val int64, id string, attrs ...attribute.KeyValue, )
- func (HostAmbientTemperature) Unit() string
- type HostEnergy
- func NewHostEnergy( m metric.Meter, opt ...metric.Int64CounterOption, ) (HostEnergy, error)
- func (m HostEnergy) Add( ctx context.Context, incr int64, id string, attrs ...attribute.KeyValue, )
- func (HostEnergy) AttrName(val string) attribute.KeyValue
- func (HostEnergy) AttrParent(val string) attribute.KeyValue
- func (HostEnergy) Description() string
- func (m HostEnergy) Inst() metric.Int64Counter
- func (HostEnergy) Name() string
- func (HostEnergy) Unit() string
- type HostHeatingMargin
- func NewHostHeatingMargin( m metric.Meter, opt ...metric.Int64GaugeOption, ) (HostHeatingMargin, error)
- func (HostHeatingMargin) AttrName(val string) attribute.KeyValue
- func (HostHeatingMargin) AttrParent(val string) attribute.KeyValue
- func (HostHeatingMargin) Description() string
- func (m HostHeatingMargin) Inst() metric.Int64Gauge
- func (HostHeatingMargin) Name() string
- func (m HostHeatingMargin) Record( ctx context.Context, val int64, id string, attrs ...attribute.KeyValue, )
- func (HostHeatingMargin) Unit() string
- type HostPower
- func NewHostPower( m metric.Meter, opt ...metric.Int64GaugeOption, ) (HostPower, error)
- func (HostPower) AttrName(val string) attribute.KeyValue
- func (HostPower) AttrParent(val string) attribute.KeyValue
- func (HostPower) Description() string
- func (m HostPower) Inst() metric.Int64Gauge
- func (HostPower) Name() string
- func (m HostPower) Record( ctx context.Context, val int64, id string, attrs ...attribute.KeyValue, )
- func (HostPower) Unit() string
- type Power
- func NewPower( m metric.Meter, opt ...metric.Int64GaugeOption, ) (Power, error)
- func (Power) AttrName(val string) attribute.KeyValue
- func (Power) AttrParent(val string) attribute.KeyValue
- func (Power) Description() string
- func (m Power) Inst() metric.Int64Gauge
- func (Power) Name() string
- func (m Power) Record( ctx context.Context, val int64, id string, hwType TypeAttr, attrs ...attribute.KeyValue, )
- func (Power) Unit() string
- type StateAttr
- type Status
- func NewStatus( m metric.Meter, opt ...metric.Int64UpDownCounterOption, ) (Status, error)
- func (m Status) Add( ctx context.Context, incr int64, id string, state StateAttr, hwType TypeAttr, attrs ...attribute.KeyValue, )
- func (Status) AttrName(val string) attribute.KeyValue
- func (Status) AttrParent(val string) attribute.KeyValue
- func (Status) Description() string
- func (m Status) Inst() metric.Int64UpDownCounter
- func (Status) Name() string
- func (Status) Unit() string
- type TypeAttr
Types ¶
type Energy ¶
type Energy struct { metric.Int64Counter }
Energy is an instrument used to record metric values conforming to the "hw.energy" semantic conventions. It represents the energy consumed by the component.
func NewEnergy ¶
NewEnergy returns a new Energy instrument.
func (Energy) Add ¶
func (m Energy) Add( ctx context.Context, incr int64, id string, hwType TypeAttr, attrs ...attribute.KeyValue, )
Add adds incr to the existing count.
The id is the an identifier for the hardware component, unique within the monitored host
The hwType is the type of the component
All additional attrs passed are included in the recorded value.
func (Energy) AttrName ¶
AttrName returns an optional attribute for the "hw.name" semantic convention. It represents an easily-recognizable name for the hardware component.
func (Energy) AttrParent ¶
AttrParent returns an optional attribute for the "hw.parent" semantic convention. It represents the unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk controller).
func (Energy) Description ¶
Description returns the semantic convention description of the instrument
func (Energy) Inst ¶
func (m Energy) Inst() metric.Int64Counter
Inst returns the underlying metric instrument.
func (Energy) Name ¶
Name returns the semantic convention name of the instrument.
func (Energy) Unit ¶
Unit returns the semantic convention unit of the instrument
type ErrorTypeAttr ¶
type ErrorTypeAttr string
ErrorTypeAttr is an attribute conforming to the error.type semantic conventions. It represents the type of error encountered by the component.
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value. ErrorTypeOther ErrorTypeAttr = "_OTHER" )
type Errors ¶
type Errors struct { metric.Int64Counter }
Errors is an instrument used to record metric values conforming to the "hw.errors" semantic conventions. It represents the number of errors encountered by the component.
func NewErrors ¶
NewErrors returns a new Errors instrument.
func (Errors) Add ¶
func (m Errors) Add( ctx context.Context, incr int64, id string, hwType TypeAttr, attrs ...attribute.KeyValue, )
Add adds incr to the existing count.
The id is the an identifier for the hardware component, unique within the monitored host
The hwType is the type of the component
All additional attrs passed are included in the recorded value.
func (Errors) AttrErrorType ¶
func (Errors) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue
AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the type of error encountered by the component.
func (Errors) AttrName ¶
AttrName returns an optional attribute for the "hw.name" semantic convention. It represents an easily-recognizable name for the hardware component.
func (Errors) AttrParent ¶
AttrParent returns an optional attribute for the "hw.parent" semantic convention. It represents the unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk controller).
func (Errors) Description ¶
Description returns the semantic convention description of the instrument
func (Errors) Inst ¶
func (m Errors) Inst() metric.Int64Counter
Inst returns the underlying metric instrument.
func (Errors) Name ¶
Name returns the semantic convention name of the instrument.
func (Errors) Unit ¶
Unit returns the semantic convention unit of the instrument
type HostAmbientTemperature ¶
type HostAmbientTemperature struct { metric.Int64Gauge }
HostAmbientTemperature is an instrument used to record metric values conforming to the "hw.host.ambient_temperature" semantic conventions. It represents the ambient (external) temperature of the physical host.
func NewHostAmbientTemperature ¶
func NewHostAmbientTemperature( m metric.Meter, opt ...metric.Int64GaugeOption, ) (HostAmbientTemperature, error)
NewHostAmbientTemperature returns a new HostAmbientTemperature instrument.
func (HostAmbientTemperature) AttrName ¶
func (HostAmbientTemperature) AttrName(val string) attribute.KeyValue
AttrName returns an optional attribute for the "hw.name" semantic convention. It represents an easily-recognizable name for the hardware component.
func (HostAmbientTemperature) AttrParent ¶
func (HostAmbientTemperature) AttrParent(val string) attribute.KeyValue
AttrParent returns an optional attribute for the "hw.parent" semantic convention. It represents the unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk controller).
func (HostAmbientTemperature) Description ¶
func (HostAmbientTemperature) Description() string
Description returns the semantic convention description of the instrument
func (HostAmbientTemperature) Inst ¶
func (m HostAmbientTemperature) Inst() metric.Int64Gauge
Inst returns the underlying metric instrument.
func (HostAmbientTemperature) Name ¶
func (HostAmbientTemperature) Name() string
Name returns the semantic convention name of the instrument.
func (HostAmbientTemperature) Record ¶
func (m HostAmbientTemperature) Record( ctx context.Context, val int64, id string, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The id is the an identifier for the hardware component, unique within the monitored host
All additional attrs passed are included in the recorded value.
func (HostAmbientTemperature) Unit ¶
func (HostAmbientTemperature) Unit() string
Unit returns the semantic convention unit of the instrument
type HostEnergy ¶
type HostEnergy struct { metric.Int64Counter }
HostEnergy is an instrument used to record metric values conforming to the "hw.host.energy" semantic conventions. It represents the total energy consumed by the entire physical host, in joules.
func NewHostEnergy ¶
func NewHostEnergy( m metric.Meter, opt ...metric.Int64CounterOption, ) (HostEnergy, error)
NewHostEnergy returns a new HostEnergy instrument.
func (HostEnergy) Add ¶
Add adds incr to the existing count.
The id is the an identifier for the hardware component, unique within the monitored host
All additional attrs passed are included in the recorded value.
The overall energy usage of a host MUST be reported using the specific `hw.host.energy` and `hw.host.power` metrics **only**, instead of the generic `hw.energy` and `hw.power` described in the previous section, to prevent summing up overlapping values.
func (HostEnergy) AttrName ¶
func (HostEnergy) AttrName(val string) attribute.KeyValue
AttrName returns an optional attribute for the "hw.name" semantic convention. It represents an easily-recognizable name for the hardware component.
func (HostEnergy) AttrParent ¶
func (HostEnergy) AttrParent(val string) attribute.KeyValue
AttrParent returns an optional attribute for the "hw.parent" semantic convention. It represents the unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk controller).
func (HostEnergy) Description ¶
func (HostEnergy) Description() string
Description returns the semantic convention description of the instrument
func (HostEnergy) Inst ¶
func (m HostEnergy) Inst() metric.Int64Counter
Inst returns the underlying metric instrument.
func (HostEnergy) Name ¶
func (HostEnergy) Name() string
Name returns the semantic convention name of the instrument.
func (HostEnergy) Unit ¶
func (HostEnergy) Unit() string
Unit returns the semantic convention unit of the instrument
type HostHeatingMargin ¶
type HostHeatingMargin struct { metric.Int64Gauge }
HostHeatingMargin is an instrument used to record metric values conforming to the "hw.host.heating_margin" semantic conventions. It represents the by how many degrees Celsius the temperature of the physical host can be increased, before reaching a warning threshold on one of the internal sensors.
func NewHostHeatingMargin ¶
func NewHostHeatingMargin( m metric.Meter, opt ...metric.Int64GaugeOption, ) (HostHeatingMargin, error)
NewHostHeatingMargin returns a new HostHeatingMargin instrument.
func (HostHeatingMargin) AttrName ¶
func (HostHeatingMargin) AttrName(val string) attribute.KeyValue
AttrName returns an optional attribute for the "hw.name" semantic convention. It represents an easily-recognizable name for the hardware component.
func (HostHeatingMargin) AttrParent ¶
func (HostHeatingMargin) AttrParent(val string) attribute.KeyValue
AttrParent returns an optional attribute for the "hw.parent" semantic convention. It represents the unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk controller).
func (HostHeatingMargin) Description ¶
func (HostHeatingMargin) Description() string
Description returns the semantic convention description of the instrument
func (HostHeatingMargin) Inst ¶
func (m HostHeatingMargin) Inst() metric.Int64Gauge
Inst returns the underlying metric instrument.
func (HostHeatingMargin) Name ¶
func (HostHeatingMargin) Name() string
Name returns the semantic convention name of the instrument.
func (HostHeatingMargin) Record ¶
func (m HostHeatingMargin) Record( ctx context.Context, val int64, id string, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The id is the an identifier for the hardware component, unique within the monitored host
All additional attrs passed are included in the recorded value.
func (HostHeatingMargin) Unit ¶
func (HostHeatingMargin) Unit() string
Unit returns the semantic convention unit of the instrument
type HostPower ¶
type HostPower struct { metric.Int64Gauge }
HostPower is an instrument used to record metric values conforming to the "hw.host.power" semantic conventions. It represents the instantaneous power consumed by the entire physical host in Watts (`hw.host.energy` is preferred).
func NewHostPower ¶
NewHostPower returns a new HostPower instrument.
func (HostPower) AttrName ¶
AttrName returns an optional attribute for the "hw.name" semantic convention. It represents an easily-recognizable name for the hardware component.
func (HostPower) AttrParent ¶
AttrParent returns an optional attribute for the "hw.parent" semantic convention. It represents the unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk controller).
func (HostPower) Description ¶
Description returns the semantic convention description of the instrument
func (HostPower) Inst ¶
func (m HostPower) Inst() metric.Int64Gauge
Inst returns the underlying metric instrument.
func (HostPower) Name ¶
Name returns the semantic convention name of the instrument.
func (HostPower) Record ¶
func (m HostPower) Record( ctx context.Context, val int64, id string, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The id is the an identifier for the hardware component, unique within the monitored host
All additional attrs passed are included in the recorded value.
The overall energy usage of a host MUST be reported using the specific `hw.host.energy` and `hw.host.power` metrics **only**, instead of the generic `hw.energy` and `hw.power` described in the previous section, to prevent summing up overlapping values.
func (HostPower) Unit ¶
Unit returns the semantic convention unit of the instrument
type Power ¶
type Power struct { metric.Int64Gauge }
Power is an instrument used to record metric values conforming to the "hw.power" semantic conventions. It represents the instantaneous power consumed by the component.
func NewPower ¶
NewPower returns a new Power instrument.
func (Power) AttrName ¶
AttrName returns an optional attribute for the "hw.name" semantic convention. It represents an easily-recognizable name for the hardware component.
func (Power) AttrParent ¶
AttrParent returns an optional attribute for the "hw.parent" semantic convention. It represents the unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk controller).
func (Power) Description ¶
Description returns the semantic convention description of the instrument
func (Power) Inst ¶
func (m Power) Inst() metric.Int64Gauge
Inst returns the underlying metric instrument.
func (Power) Name ¶
Name returns the semantic convention name of the instrument.
func (Power) Record ¶
func (m Power) Record( ctx context.Context, val int64, id string, hwType TypeAttr, attrs ...attribute.KeyValue, )
Record records val to the current distribution.
The id is the an identifier for the hardware component, unique within the monitored host
The hwType is the type of the component
All additional attrs passed are included in the recorded value.
It is recommended to report `hw.energy` instead of `hw.power` when possible.
func (Power) Unit ¶
Unit returns the semantic convention unit of the instrument
type StateAttr ¶
type StateAttr string
StateAttr is an attribute conforming to the hw.state semantic conventions. It represents the current state of the component.
var ( // StateOk is the ok. StateOk StateAttr = "ok" // StateDegraded is the degraded. StateDegraded StateAttr = "degraded" // StateFailed is the failed. StateFailed StateAttr = "failed" )
type Status ¶
type Status struct { metric.Int64UpDownCounter }
Status is an instrument used to record metric values conforming to the "hw.status" semantic conventions. It represents the operational status: `1` (true) or `0` (false) for each of the possible states.
func NewStatus ¶
NewStatus returns a new Status instrument.
func (Status) Add ¶
func (m Status) Add( ctx context.Context, incr int64, id string, state StateAttr, hwType TypeAttr, attrs ...attribute.KeyValue, )
Add adds incr to the existing count.
The id is the an identifier for the hardware component, unique within the monitored host
The state is the the current state of the component
The hwType is the type of the component
All additional attrs passed are included in the recorded value.
`hw.status` is currently specified as an *UpDownCounter* but would ideally be represented using a [*StateSet* as defined in OpenMetrics]. This semantic convention will be updated once *StateSet* is specified in OpenTelemetry. This planned change is not expected to have any consequence on the way users query their timeseries backend to retrieve the values of `hw.status` over time.
func (Status) AttrName ¶
AttrName returns an optional attribute for the "hw.name" semantic convention. It represents an easily-recognizable name for the hardware component.
func (Status) AttrParent ¶
AttrParent returns an optional attribute for the "hw.parent" semantic convention. It represents the unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk controller).
func (Status) Description ¶
Description returns the semantic convention description of the instrument
func (Status) Inst ¶
func (m Status) Inst() metric.Int64UpDownCounter
Inst returns the underlying metric instrument.
func (Status) Name ¶
Name returns the semantic convention name of the instrument.
func (Status) Unit ¶
Unit returns the semantic convention unit of the instrument
type TypeAttr ¶
type TypeAttr string
TypeAttr is an attribute conforming to the hw.type semantic conventions. It represents the type of the component.
var ( // TypeBattery is the battery. TypeBattery TypeAttr = "battery" // TypeCPU is the CPU. TypeCPU TypeAttr = "cpu" // TypeDiskController is the disk controller. TypeDiskController TypeAttr = "disk_controller" // TypeEnclosure is the enclosure. TypeEnclosure TypeAttr = "enclosure" // TypeFan is the fan. TypeFan TypeAttr = "fan" // TypeGpu is the GPU. TypeGpu TypeAttr = "gpu" // TypeLogicalDisk is the logical disk. TypeLogicalDisk TypeAttr = "logical_disk" // TypeMemory is the memory. TypeMemory TypeAttr = "memory" // TypeNetwork is the network. TypeNetwork TypeAttr = "network" // TypePhysicalDisk is the physical disk. TypePhysicalDisk TypeAttr = "physical_disk" // TypePowerSupply is the power supply. TypePowerSupply TypeAttr = "power_supply" // TypeTapeDrive is the tape drive. TypeTapeDrive TypeAttr = "tape_drive" // TypeTemperature is the temperature. TypeTemperature TypeAttr = "temperature" // TypeVoltage is the voltage. TypeVoltage TypeAttr = "voltage" )
Source Files ¶
metric.go
- Version
- v1.36.0 (latest)
- Published
- May 21, 2025
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 2 hours ago –
Tools for package owners.