Semantic conventions for battery metrics

Status: Development

Battery metrics hw.battery.*

A battery in a computer system or an UPS.

hw.type MUST be set to "battery".

All battery metrics may include the below attributes to describe the characteristics of the monitored battery:

AttributeTypeDescriptionExamplesRequirement LevelStability
hw.idstringAn identifier for the hardware component, unique within the monitored hostwin32battery_battery_testsysa33_1RequiredDevelopment
hw.battery.capacitystringDesign capacity in Watts-hours or Amper-hours9.3Ah; 50WhRecommendedDevelopment
hw.battery.chemistrystringBattery chemistry, e.g. Lithium-Ion, Nickel-Cadmium, etc.Li-ion; NiMHRecommendedDevelopment
hw.modelstringDescriptive model name of the hardware componentPERC H740P; Intel(R) Core(TM) i7-10700K; Dell XPS 15 BatteryRecommendedDevelopment
hw.namestringAn easily-recognizable name for the hardware componenteth0RecommendedDevelopment
hw.parentstringUnique identifier of the parent component (typically the hw.id attribute of the enclosure, or disk controller)dellStorage_perc_0RecommendedDevelopment
hw.vendorstringVendor name of the hardware componentDell; HP; Intel; AMD; LSI; LenovoRecommendedDevelopment

Metric: hw.battery.charge

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
hw.battery.chargeGauge1Remaining fraction of battery charge.Development
AttributeTypeDescriptionExamplesRequirement LevelStability
hw.idstringAn identifier for the hardware component, unique within the monitored hostwin32battery_battery_testsysa33_1RequiredDevelopment
hw.battery.capacitystringDesign capacity in Watts-hours or Amper-hours9.3Ah; 50WhRecommendedDevelopment
hw.battery.chemistrystringBattery chemistry, e.g. Lithium-Ion, Nickel-Cadmium, etc.Li-ion; NiMHRecommendedDevelopment
hw.modelstringDescriptive model name of the hardware componentPERC H740P; Intel(R) Core(TM) i7-10700K; Dell XPS 15 BatteryRecommendedDevelopment
hw.namestringAn easily-recognizable name for the hardware componenteth0RecommendedDevelopment
hw.parentstringUnique identifier of the parent component (typically the hw.id attribute of the enclosure, or disk controller)dellStorage_perc_0RecommendedDevelopment
hw.vendorstringVendor name of the hardware componentDell; HP; Intel; AMD; LSI; LenovoRecommendedDevelopment

Metric: hw.battery.charge.limit

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
hw.battery.charge.limitGauge1Lower limit of battery charge fraction to ensure proper operation.Development
AttributeTypeDescriptionExamplesRequirement LevelStability
hw.idstringAn identifier for the hardware component, unique within the monitored hostwin32battery_battery_testsysa33_1RequiredDevelopment
hw.battery.capacitystringDesign capacity in Watts-hours or Amper-hours9.3Ah; 50WhRecommendedDevelopment
hw.battery.chemistrystringBattery chemistry, e.g. Lithium-Ion, Nickel-Cadmium, etc.Li-ion; NiMHRecommendedDevelopment
hw.limit_typestringRepresents battery charge level thresholds relevant to device operation and health. Each limit_type denotes a specific charge limit such as the minimum or maximum optimal charge, the shutdown threshold, or energy-saving thresholds. These values are typically provided by the hardware or firmware to guide safe and efficient battery usage.critical; throttled; degradedRecommendedDevelopment
hw.modelstringDescriptive model name of the hardware componentPERC H740P; Intel(R) Core(TM) i7-10700K; Dell XPS 15 BatteryRecommendedDevelopment
hw.namestringAn easily-recognizable name for the hardware componenteth0RecommendedDevelopment
hw.parentstringUnique identifier of the parent component (typically the hw.id attribute of the enclosure, or disk controller)dellStorage_perc_0RecommendedDevelopment
hw.vendorstringVendor name of the hardware componentDell; HP; Intel; AMD; LSI; LenovoRecommendedDevelopment

hw.limit_type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
criticalCriticalDevelopment
degradedDegradedDevelopment
high.criticalHigh CriticalDevelopment
high.degradedHigh DegradedDevelopment
low.criticalLow CriticalDevelopment
low.degradedLow DegradedDevelopment
maxMaximumDevelopment
throttledThrottledDevelopment
turboTurboDevelopment

Metric: hw.battery.time_left

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
hw.battery.time_leftGaugesTime left before battery is completely charged or discharged.Development
AttributeTypeDescriptionExamplesRequirement LevelStability
hw.idstringAn identifier for the hardware component, unique within the monitored hostwin32battery_battery_testsysa33_1RequiredDevelopment
hw.statestringThe current state of the componentdegraded; failed; needs_cleaningRequiredDevelopment
hw.battery.statestringThe current state of the battery [1]charging; dischargingConditionally Required If the battery is charging or dischargingDevelopment
hw.battery.capacitystringDesign capacity in Watts-hours or Amper-hours9.3Ah; 50WhRecommendedDevelopment
hw.battery.chemistrystringBattery chemistry, e.g. Lithium-Ion, Nickel-Cadmium, etc.Li-ion; NiMHRecommendedDevelopment
hw.modelstringDescriptive model name of the hardware componentPERC H740P; Intel(R) Core(TM) i7-10700K; Dell XPS 15 BatteryRecommendedDevelopment
hw.namestringAn easily-recognizable name for the hardware componenteth0RecommendedDevelopment
hw.parentstringUnique identifier of the parent component (typically the hw.id attribute of the enclosure, or disk controller)dellStorage_perc_0RecommendedDevelopment
hw.vendorstringVendor name of the hardware componentDell; HP; Intel; AMD; LSI; LenovoRecommendedDevelopment

[1] hw.battery.state: The hw.state attribute should indicate the current state of the battery. It should be one of the predefined states such as “charging” or “discharging”.


hw.battery.state has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
chargingChargingDevelopment
dischargingDischargingDevelopment

hw.state has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
degradedDegradedDevelopment
failedFailedDevelopment
needs_cleaningNeeds CleaningDevelopment
okOKDevelopment
predicted_failurePredicted FailureDevelopment

Metric: hw.status (Battery)

This metric is recommended.

Operational status: 1 (true) or 0 (false) for each of the possible states.

When using this metric for battery status, the following attributes MUST be set:

  • hw.type MUST be set to "battery" to indicate that the status is for a battery.
  • hw.state MUST be set to one of the following values to indicate the battery state:
    • "ok": The battery is operating normally.
    • "degraded": The battery is operating with reduced functionality or performance.
    • "failed": The battery has failed and is not operational.
    • "charging": The battery is currently charging.
    • "discharging": The battery is currently discharging.

The hw.type attribute should indicate the type of hardware component, which in this case is a battery. It should be set to “battery” to clearly identify the component being monitored.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
hw.statusUpDownCounter1Operational status: 1 (true) or 0 (false) for each of the possible states. [1]Development

[1]: 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.

AttributeTypeDescriptionExamplesRequirement LevelStability
hw.idstringAn identifier for the hardware component, unique within the monitored hostwin32battery_battery_testsysa33_1RequiredDevelopment
hw.statestringThe current state of the componentdegraded; failed; needs_cleaningRequiredDevelopment
hw.typestringType of the component [1]battery; cpu; disk_controllerRequiredDevelopment
hw.namestringAn easily-recognizable name for the hardware componenteth0RecommendedDevelopment
hw.parentstringUnique identifier of the parent component (typically the hw.id attribute of the enclosure, or disk controller)dellStorage_perc_0RecommendedDevelopment

[1] hw.type: Describes the category of the hardware component for which hw.state is being reported. For example, hw.type=temperature along with hw.state=degraded would indicate that the temperature of the hardware component has been reported as degraded.


hw.state has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
degradedDegradedDevelopment
failedFailedDevelopment
needs_cleaningNeeds CleaningDevelopment
okOKDevelopment
predicted_failurePredicted FailureDevelopment

hw.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
batteryBatteryDevelopment
cpuCPUDevelopment
disk_controllerDisk controllerDevelopment
enclosureEnclosureDevelopment
fanFanDevelopment
gpuGPUDevelopment
logical_diskLogical diskDevelopment
memoryMemoryDevelopment
networkNetworkDevelopment
physical_diskPhysical diskDevelopment
power_supplyPower supplyDevelopment
tape_driveTape driveDevelopment
temperatureTemperatureDevelopment
voltageVoltageDevelopment