Documentation
¶
Overview ¶
Package observability declares the optional GOWDK Trace compiler/runtime capability and re-exports dependency-free runtime trace helpers.
Index ¶
- Constants
- func Addon() gowdk.Addon
- func AlwaysOff() gowdktrace.Sampler
- func AlwaysOn() gowdktrace.Sampler
- func DropSpansNamed(name string) gowdktrace.SamplerRule
- func KeepSpansNamed(name string) gowdktrace.SamplerRule
- func ParentBasedSampler(root gowdktrace.Sampler) gowdktrace.Sampler
- func RatioSampler(ratio float64) gowdktrace.Sampler
- func RuleSampler(base gowdktrace.Sampler, rules ...gowdktrace.SamplerRule) gowdktrace.Sampler
- func WithSink(sink gowdktrace.Sink) gowdktrace.TracerOption
- type Collector
- type CollectorOption
- type SamplerRule
- type Tracer
Constants ¶
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 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 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 SamplerRule ¶ added in v0.8.0
type SamplerRule = gowdktrace.SamplerRule
SamplerRule overrides the sampling decision for matching spans.
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.