observability

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package observability declares the optional GOWDK Trace compiler/runtime capability and re-exports dependency-free runtime trace helpers.

Index

Constants

View Source
const (
	SurfaceBackend  = gowdktrace.SurfaceBackend
	SurfaceFrontend = gowdktrace.SurfaceFrontend
	SurfaceWorker   = gowdktrace.SurfaceWorker
)

Surface values for use with MatchSurface.

View Source
const (
	LaneRoute    = gowdktrace.LaneRoute
	LaneGuard    = gowdktrace.LaneGuard
	LaneHandler  = gowdktrace.LaneHandler
	LaneSSR      = gowdktrace.LaneSSR
	LaneAction   = gowdktrace.LaneAction
	LaneAPI      = gowdktrace.LaneAPI
	LaneFragment = gowdktrace.LaneFragment
	LaneContract = gowdktrace.LaneContract
	LaneJob      = gowdktrace.LaneJob
	LaneIsland   = gowdktrace.LaneIsland
	LaneNav      = gowdktrace.LaneNav
	LaneUser     = gowdktrace.LaneUser
)

Lane values for use with MatchLane.

View Source
const ImportPath = "github.com/cssbruno/gowdk/addons/observability"

ImportPath is the canonical Go import path for the observability addon.

Variables

This section is empty.

Functions

func Addon

func Addon() gowdk.Addon

Addon enables generated app trace wiring.

func AlwaysOff

func AlwaysOff() gowdktrace.Sampler

AlwaysOff samples no spans.

func AlwaysOn

func AlwaysOn() gowdktrace.Sampler

AlwaysOn samples every span.

func DropSpansNamed added in v0.8.0

func DropSpansNamed(name string) gowdktrace.SamplerRule

DropSpansNamed builds a rule that always drops spans with the exact name.

func KeepSpansNamed added in v0.8.0

func KeepSpansNamed(name string) gowdktrace.SamplerRule

KeepSpansNamed builds a rule that always keeps spans with the exact name.

func MatchLane added in v0.9.0

func MatchLane(lane Lane) func(SamplingContext) bool

MatchLane builds a matcher for spans on the given GOWDK lane.

func MatchSpanName added in v0.9.0

func MatchSpanName(name string) func(SamplingContext) bool

MatchSpanName builds a matcher for spans whose name equals name.

func MatchSpanNamePrefix added in v0.9.0

func MatchSpanNamePrefix(prefix string) func(SamplingContext) bool

MatchSpanNamePrefix builds a matcher for spans whose name starts with prefix.

func MatchSurface added in v0.9.0

func MatchSurface(surface Surface) func(SamplingContext) bool

MatchSurface builds a matcher for spans on the given GOWDK surface.

func ParentBasedSampler added in v0.8.0

func ParentBasedSampler(root gowdktrace.Sampler) gowdktrace.Sampler

ParentBasedSampler keeps a trace whole: it honors a propagated parent decision and samples roots with root. It is the production-safe default for distributed tracing.

func RatioSampler

func RatioSampler(ratio float64) gowdktrace.Sampler

RatioSampler samples a deterministic fraction of traces.

func RuleSampler added in v0.8.0

func RuleSampler(base gowdktrace.Sampler, rules ...gowdktrace.SamplerRule) gowdktrace.Sampler

RuleSampler applies per-span override rules (silence health checks, force high-value endpoints on) before falling back to base.

func WithSink

func WithSink(sink gowdktrace.Sink) gowdktrace.TracerOption

WithSink configures the completed span sink.

Types

type Collector

type Collector = gowdktrace.Collector

Collector stores recent spans and serves the self-contained viewer.

func NewCollector

func NewCollector(limit int, options ...CollectorOption) *Collector

NewCollector creates a bounded in-memory trace collector.

type CollectorOption added in v0.8.0

type CollectorOption = gowdktrace.CollectorOption

CollectorOption configures a Collector.

func WithCollectorIngestRate added in v0.8.0

func WithCollectorIngestRate(limit int, window time.Duration) CollectorOption

WithCollectorIngestRate configures the collector's per-client POST rate.

func WithCollectorSSELimit added in v0.8.0

func WithCollectorSSELimit(limit int) CollectorOption

WithCollectorSSELimit configures the collector's concurrent SSE stream cap.

type Lane added in v0.9.0

type Lane = gowdktrace.Lane

Lane identifies the GOWDK execution lane a span represents. Re-exported with its values so MatchLane rules can be written without importing runtime/trace directly.

type SamplerRule added in v0.8.0

type SamplerRule = gowdktrace.SamplerRule

SamplerRule overrides the sampling decision for matching spans.

type SamplingContext added in v0.9.0

type SamplingContext = gowdktrace.SamplingContext

SamplingContext is the per-span context a SamplerRule matcher inspects.

type Surface added in v0.9.0

type Surface = gowdktrace.Surface

Surface identifies where a span was produced. Re-exported with its values so MatchSurface rules can be written without importing runtime/trace directly.

type Tracer

type Tracer = gowdktrace.Tracer

Tracer records spans for generated app instrumentation.

func NewTracer

func NewTracer(options ...gowdktrace.TracerOption) *Tracer

NewTracer creates a dependency-free tracer.

Jump to

Keyboard shortcuts

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