Help us shape the future of Go! Take the 2026 Go Developer Survey

opensearch

package
v0.1.63 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package opensearch is the opensearch trace kind: span documents of an opentelemetry connection's index, imported over a window or followed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kind

func Kind() *tracing.Handler[Params, Span]

Kind is the opensearch trace kind: spans masked as they are stored.

Types

type Params

type Params struct {
	// Connection is the opentelemetry connection whose OpenSearch index holds
	// the spans.
	Connection string `json:"connection" clicky:"required,title=Connection"`
	// Index, Format and DateField override the connection's defaults:
	// otel-traces-*, flat, and @timestamp.
	Index     string `json:"index,omitempty" clicky:"title=Index"`
	Format    string `json:"format,omitempty" clicky:"title=Format"`
	DateField string `json:"dateField,omitempty" clicky:"title=Date field"`
	// Search narrows the spans read.
	Search *esdsl.Search `json:"search,omitempty"`
	// From and To bound the window, as date math such as now-1h or RFC3339.
	From string `json:"from,omitempty" clicky:"title=From"`
	To   string `json:"to,omitempty" clicky:"title=To"`
	// Follow goes on reading the spans indexed after the window, until the
	// session stops; it has no To.
	Follow bool `json:"follow,omitempty" clicky:"title=Follow"`
	// Poll and Lag, durations such as 2s, pace a follow and hold it behind now.
	Poll string `json:"poll,omitempty" clicky:"title=Poll"`
	Lag  string `json:"lag,omitempty" clicky:"title=Lag"`
}

Params choose the index and the window a capture reads.

func (Params) Validate

func (p Params) Validate() error

type Span

type Span struct {
	Timestamp   time.Time      `json:"timestamp" pretty:"label=Time" sort:"timestamp"`
	TraceID     string         `json:"traceId" pretty:"label=Trace" filter:"exact"`
	SpanID      string         `json:"spanId" pretty:"label=Span" filter:"exact"`
	ParentID    string         `json:"parentId,omitempty" pretty:"label=Parent" filter:"exact"`
	Service     string         `json:"service" filter:"terms"`
	Operation   string         `json:"operation" filter:"terms"`
	Status      string         `json:"status,omitempty" filter:"terms"`
	DurationMs  float64        `json:"durationMs" pretty:"label=Duration,type=duration,unit=ms" sort:"durationMs"`
	Attributes  map[string]any `json:"attributes,omitempty" pretty:"hide"`
	SourceIndex string         `json:"sourceIndex" pretty:"hide"`
	SourceID    string         `json:"sourceId" pretty:"hide"`
	SourceKey   string         `json:"sourceKey" pretty:"hide"`
}

Span is one span document as a capture stores it. SourceKey, its index and id, keys it: a span read twice, by overlapping reads, is stored once.

func FromRow

func FromRow(row query.Row) Span

FromRow is the span an opentelemetry row describes.

Jump to

Keyboard shortcuts

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