hostmetrics

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package hostmetrics provides minimal, dependency-free metric emission via CloudWatch Embedded Metric Format (EMF).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit(namespace string, dimensions map[string]string, metrics []Metric, properties map[string]any)

Emit writes a CloudWatch Embedded Metric Format (EMF) JSON log line to stdout.

Dimensions define the CloudWatch metric dimensions for this record. Keys must match the values emitted into the top-level JSON object.

Types

type Metric

type Metric struct {
	Name  string
	Unit  Unit
	Value float64
}

Metric is a single metric value emitted in an EMF record.

type Unit

type Unit string

Unit is a CloudWatch metric unit string for EMF emission.

const (
	// UnitCount is a count unit.
	UnitCount Unit = "Count"
	// UnitMilliseconds is a milliseconds unit.
	UnitMilliseconds Unit = "Milliseconds"
	// UnitNone is an unspecified unit.
	UnitNone Unit = "None"
)

Jump to

Keyboard shortcuts

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