metrics

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package metrics bridges a running goav task to monitoring: Handler serves its counters in the Prometheus text exposition format, and Publish exposes the same data through expvar. It reads Stats and Snapshot, which are lock-free atomic reads, so scraping never slows the data plane.

http.Handle("/metrics", metrics.Handler(task))
metrics.Publish("goav", task) // visible at /debug/vars

Metrics carry the goav_ prefix. Per-node counters are labelled node; drops add reason; branch and destination states are one-hot gauges labelled by name and state (1 for the current state, 0 for the others).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(task StatsSource) http.Handler

Handler serves the task's counters and states as Prometheus text.

func Publish

func Publish(name string, task StatsSource)

Publish exposes the task's stats and snapshot (state, branches, destinations) as the expvar variable name, rendered as JSON on demand. Like expvar.Publish it panics if name is already taken.

Types

type StatsSource added in v0.3.0

type StatsSource interface {
	Stats() pipeline.GraphStats
	Snapshot() goav.TaskSnapshot
}

StatsSource is the narrow view of a *goav.Task that metrics reads.

Jump to

Keyboard shortcuts

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