exporter

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package exporter runs a metrics exporter: a poller asking what the tool reports on, and the metrics page written from what it last heard. It is the whole of a tool's print and serve commands but their settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(ctx context.Context, out io.Writer, p Poller, page *metrics.Page) error

Print asks everything once, writes the page to out whatever happened, and then says what failed: a page from a thing that did not answer is still worth seeing.

func Serve

func Serve(ctx context.Context, listen string, p Poller, page *metrics.Page) error

Serve asks on schedule and serves the page until the context ends, or until serving stops by itself, on a port already taken say; the asking stops with it. Whoever calls it ends the context on a signal.

Types

type Poller

type Poller interface {
	Run(ctx context.Context)
	PollAll(ctx context.Context) error
}

Poller is what an exporter asks with: a poller.Poller, whatever its targets are.

Jump to

Keyboard shortcuts

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