prometheus

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetricPrefix contains the prefix used by all metrics emitted from this collector.
	Namespace = "flowercare"

	LabelAddress = "macaddress"
	LabelName    = "name"
	LabelVersion = "version"
)

Variables

View Source
var (
	MetricOptsInfo = prometheus.GaugeOpts{
		Namespace: Namespace,
		Name:      "info",
		Help:      "Contains information about the Flower Care device.",
	}
	MetricOptsBattery = prometheus.GaugeOpts{
		Namespace: Namespace,
		Name:      "battery",
		Help:      "Battery level in percent.",
	}
	MetricOptsConductivity = prometheus.GaugeOpts{
		Namespace: Namespace,
		Name:      "conductivity_sm",
		Help:      "Soil conductivity in Siemens/meter.",
	}
	MetricOptsBrightness = prometheus.GaugeOpts{
		Namespace: Namespace,
		Name:      "brightness_lux",
		Help:      "Ambient lighting in lux.",
	}
	MetricOptsMoisture = prometheus.GaugeOpts{
		Namespace: Namespace,
		Name:      "moisture_percent",
		Help:      "Soil relative moisture in percent.",
	}
	MetricOptsTemperature = prometheus.GaugeOpts{
		Namespace: Namespace,
		Name:      "temperature_celsius",
		Help:      "Ambient temperature in celsius.",
	}
	MetricOptsRSSI = prometheus.HistogramOpts{
		Namespace: Namespace,
		Name:      "signal_strength_rssi",
		Help:      "Signal strenght of the sensors as reported by the bluetooth adapter.",
		Buckets:   prometheus.LinearBuckets(-120, 10, 12),
	}
	MetricLastAdv = prometheus.GaugeOpts{
		Namespace: Namespace,
		Name:      "last_adv_timestamp",
		Help:      "Contains the timestamp when the last advertisement from the sensor was received by the Bluetooth device.",
	}
)

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	Info         *prometheus.GaugeVec
	Battery      *prometheus.GaugeVec
	Conductivity *prometheus.GaugeVec
	Brightness   *prometheus.GaugeVec
	Moisture     *prometheus.GaugeVec
	Temperature  *prometheus.GaugeVec
	RSSI         *prometheus.HistogramVec
	LastAdv      *prometheus.GaugeVec
}

func NewMetrics

func NewMetrics(r prometheus.Registerer) *Metrics

func (*Metrics) ObserveMeasurement added in v0.1.1

func (m *Metrics) ObserveMeasurement(v *model.Measurement, labelValues ...string)

func (*Metrics) ObserveRSSI added in v0.1.1

func (m *Metrics) ObserveRSSI(v float64, labelValues ...string)

Jump to

Keyboard shortcuts

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