usemetrics

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

README

USE Metrics Examples

This directory contains OpenSLO examples for USE (Utilization, Saturation, Errors) metrics, a resource-focused monitoring methodology for infrastructure and hardware.

What are USE Metrics?

USE is a monitoring methodology created by Brendan Gregg for analyzing system performance. It focuses on every resource in your system and checks three key metrics:

  • Utilization: The average time that the resource was busy servicing work (% busy)
  • Saturation: The degree to which the resource has extra work which it can't service (queue length)
  • Errors: The count of error events for that resource

Files in this Directory

utilization.go

Tracks resource utilization (how busy resources are):

  • ExampleCPUUtilizationSLO - Monitor CPU usage percentage
  • ExampleMemoryUtilizationSLO - Monitor memory usage percentage
  • ExampleDiskUtilizationSLO - Monitor disk space usage percentage
saturation.go

Measures resource saturation (queueing and contention):

  • ExampleCPUSaturationSLO - Track CPU load average per core
  • ExampleMemorySaturationSLO - Monitor swap usage as memory pressure indicator
  • ExampleDiskSaturationSLO - Track disk I/O utilization and queuing
  • ExampleNetworkSaturationSLO - Monitor network bandwidth saturation
errors.go

Monitors resource-level errors:

  • ExampleDiskErrorsSLO - Track disk I/O errors
  • ExampleNetworkErrorsSLO - Monitor network packet errors and drops
  • ExampleMemoryErrorsSLO - Track ECC memory errors
  • ExampleCPUThrottlingErrorsSLO - Monitor CPU throttling in containers
use_test.go

Validation tests for all USE metric SLOs

When to Use USE Metrics

USE metrics are ideal for:

  • Infrastructure monitoring: Servers, VMs, containers, bare metal
  • Resource capacity planning: Understanding resource constraints
  • Performance debugging: Identifying bottlenecks at the hardware level
  • System health: Monitoring physical and virtual resource health

How to Apply USE Methodology

For each resource in your system, ask:

  1. What is the utilization? (How busy is it?)
  2. What is the saturation? (Is work queueing?)
  3. Are there any errors? (Hardware/resource failures?)

Common resources to monitor:

  • CPU (cores)
  • Memory (RAM)
  • Disk (storage devices)
  • Network (interfaces)
  • Storage I/O
  • GPU (if applicable)

Example Prometheus Queries

The examples use Prometheus with node_exporter metrics:

CPU Utilization:

avg(rate(node_cpu_seconds_total{mode!="idle"}[5m])) * 100

CPU Saturation:

node_load5 / count(node_cpu_seconds_total{mode="idle"})

Disk Errors:

rate(node_disk_io_errors_total[5m])

Complementary Frameworks

  • RED Metrics: For request-driven service monitoring (see ../red-metrics/)
  • Four Golden Signals: Google's framework (combines aspects of both)
  • TSI Method: Thread, Saturation, Instrumentation (for application-level)

References

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExampleCPUSaturationSLO

func ExampleCPUSaturationSLO() v1.SLO

ExampleCPUSaturationSLO is a SLO that measures CPU saturation via load average. Saturation is the "S" in USE metrics - tracking the degree to which a resource has extra work it can't service.

func ExampleCPUThrottlingErrorsSLO

func ExampleCPUThrottlingErrorsSLO() v1.SLO

ExampleCPUThrottlingErrorsSLO is a SLO that measures CPU throttling events.

func ExampleCPUUtilizationSLO

func ExampleCPUUtilizationSLO() v1.SLO

ExampleCPUUtilizationSLO is a SLO that measures CPU utilization. Utilization is the "U" in USE metrics - tracking the average time a resource is busy.

func ExampleDiskErrorsSLO

func ExampleDiskErrorsSLO() v1.SLO

ExampleDiskErrorsSLO is a SLO that measures disk I/O errors. Errors is the "E" in USE metrics - tracking error events for resources.

func ExampleDiskSaturationSLO

func ExampleDiskSaturationSLO() v1.SLO

ExampleDiskSaturationSLO is a SLO that measures disk I/O saturation.

func ExampleDiskUtilizationSLO

func ExampleDiskUtilizationSLO() v1.SLO

ExampleDiskUtilizationSLO is a SLO that measures disk utilization.

func ExampleMemoryErrorsSLO

func ExampleMemoryErrorsSLO() v1.SLO

ExampleMemoryErrorsSLO is a SLO that measures memory errors (ECC errors).

func ExampleMemorySaturationSLO

func ExampleMemorySaturationSLO() v1.SLO

ExampleMemorySaturationSLO is a SLO that measures memory saturation via swap usage.

func ExampleMemoryUtilizationSLO

func ExampleMemoryUtilizationSLO() v1.SLO

ExampleMemoryUtilizationSLO is a SLO that measures memory utilization.

func ExampleNetworkErrorsSLO

func ExampleNetworkErrorsSLO() v1.SLO

ExampleNetworkErrorsSLO is a SLO that measures network errors.

func ExampleNetworkSaturationSLO

func ExampleNetworkSaturationSLO() v1.SLO

ExampleNetworkSaturationSLO is a SLO that measures network saturation.

func SLOs

func SLOs() []v1.SLO

func SLOsBySetSlug added in v0.3.0

func SLOsBySetSlug() map[string][]v1.SLO

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL