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 ¶
- func Enabled(getenv func(string) string, signal string) bool
- func LogHandler(inner slog.Handler) slog.Handler
- func Middleware(untraced ...string) echo.MiddlewareFunc
- func ObserveQueue(pending func(context.Context) map[string]int64) func()
- func Start(ctx context.Context, version string) (func(context.Context), error)
- func Transport(base http.RoundTripper) http.RoundTripper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enabled ¶
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 ¶
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 ¶
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 ¶
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.