Files
compute-blade-agent/pkg/hal/metrics.go
Matthias Riegler 99920370fb feat: add smart fan unit support (#29)
* feat: add smart fanunit (serial) protocol

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* feat: add rudimentary eventbus to ease implementation

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* feat: smart fanunit client

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* feat: initial smart fan unit implementation

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* feat: improve logging, double btn press

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* fix: testcases

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* fix: context closure handling, RPM reporting

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* fix: address linting issues

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* fix: edge line closure

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* fix: reset CPU after i2c lockup

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

* feat: add uf2 to release

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>

---------

Signed-off-by: Matthias Riegler <matthias.riegler@ankorstore.com>
2023-11-25 11:07:50 +01:00

61 lines
1.8 KiB
Go

//go:build !tinygo
package hal
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
fanSpeedTargetPercent = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "computeblade",
Name: "fan_speed_target_percent",
Help: "Target fanspeed in percent",
})
fanSpeed = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "computeblade",
Name: "fan_speed",
Help: "Fan speed in RPM",
})
socTemperature = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "computeblade",
Name: "soc_temperature",
Help: "SoC temperature in °C",
})
airFlowTemperature = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "computeblade",
Name: "airflow_temperature",
Help: "airflow temperature in °C",
})
computeModule = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "computeblade",
Name: "compute_modul_present",
Help: "Compute module type",
}, []string{"type"})
ledColorChangeEventCount = promauto.NewCounter(prometheus.CounterOpts{
Namespace: "computeblade",
Name: "led_color_change_event_count",
Help: "Led color change event_count",
})
powerStatus = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "computeblade",
Name: "power_status",
Help: "Power status of the blade",
}, []string{"type"})
stealthModeEnabled = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "computeblade",
Name: "stealth_mode_enabled",
Help: "Stealth mode enabled",
})
fanUnit = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "computeblade",
Name: "fan_unit",
Help: "Fan unit",
}, []string{"type"})
edgeButtonEventCount = promauto.NewCounter(prometheus.CounterOpts{
Namespace: "computeblade",
Name: "edge_button_event_count",
Help: "Number of edge button presses",
})
)