metricevents

package
v0.0.0-...-8bfff4f Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package metricevents provides a way to track state changes in specific cloud monitoring metrics. On state transitions, a cloud logging metric is written.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEvent

func AddEvent(ctx context.Context, p Parameters) bool

AddEvent adds an event to the list of events. If the event already exists, a cloud logging message is written if the value has changed. Returns true if an event incurs a state change.

func SetLogDelay

func SetLogDelay(delay time.Duration)

SetLogDelay changes how long to wait for a group of events before logging.

Types

type Parameters

type Parameters struct {
	Path    string
	Message string
	Value   string
	Labels  map[string]string

	// Identifier is used to distinguish between events with the same path.
	// The identifier is appended to the path to create a unique key for the
	// event in the event map.
	Identifier string
}

Parameters for AddEvent.

Jump to

Keyboard shortcuts

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