telemetry

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package telemetry is the one place steps meets the OpenTelemetry SDK, off unless OTEL_* asks: the docker and GCE clients already trace against the global provider, so installing one is all their calls need.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enabled

func Enabled(getenv func(string) string, signal string) bool

Enabled answers whether the environment asks for a signal, TRACES or METRICS. The exporter would default to localhost:4318 with nothing set, which is a dial on every run nobody asked for, so an exporter or an endpoint has to be named.

func LogHandler

func LogHandler(inner slog.Handler) slog.Handler

LogHandler adds trace_id and span_id to a record logged under a recording span, so a log line can be found from its trace and back.

func Middleware added in v0.2.0

func Middleware(untraced ...string) echo.MiddlewareFunc

Middleware traces every request an echo server answers but those to untraced paths, which a platform polls every few seconds. It is echo's own OpenTelemetry middleware, which names the span by the matched route rather than by URL.

func ObserveQueue

func ObserveQueue(pending func(context.Context) map[string]int64) func()

ObserveQueue reports pending builds per pipeline as steps.queue.pending, asking pending at each export; the returned func stops it, and must run before whatever pending reads from is closed.

func Start

func Start(ctx context.Context, version string) (func(context.Context), error)

Start returns the flush a command must run before it exits, a no-op when telemetry is off.

func Transport

func Transport(base http.RoundTripper) http.RoundTripper

Transport traces every request a client makes and carries the trace context to the server.

Types

This section is empty.

Jump to

Keyboard shortcuts

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