ingest

package
v0.0.11-beta.13 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPHandler

type HTTPHandler struct {
	// contains filtered or unexported fields
}

HTTPHandler provides HTTP OTLP endpoints that delegate to the existing gRPC Export() methods.

func NewHTTPHandler

func NewHTTPHandler(traces *TraceServer, logs *LogsServer, metrics *MetricsServer) *HTTPHandler

NewHTTPHandler creates an HTTP OTLP handler wrapping the existing gRPC servers.

func (*HTTPHandler) RegisterRoutes

func (h *HTTPHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the HTTP OTLP endpoints on the given mux.

func (*HTTPHandler) SetMaxBodyBytes

func (h *HTTPHandler) SetMaxBodyBytes(n int64)

SetMaxBodyBytes configures the maximum request body size.

type LogsServer

type LogsServer struct {
	collogspb.UnimplementedLogsServiceServer
	// contains filtered or unexported fields
}

func NewLogsServer

func NewLogsServer(repo *storage.Repository, metrics *telemetry.Metrics, cfg *config.Config) *LogsServer

func (*LogsServer) Export

Export handles incoming OTLP log data.

func (*LogsServer) SetLogCallback

func (s *LogsServer) SetLogCallback(cb func(storage.Log))

SetLogCallback sets the function to call when a new log is received.

type MetricsServer

type MetricsServer struct {
	colmetricspb.UnimplementedMetricsServiceServer
	// contains filtered or unexported fields
}

func NewMetricsServer

func NewMetricsServer(repo *storage.Repository, metrics *telemetry.Metrics, aggregator *tsdb.Aggregator, cfg *config.Config) *MetricsServer

func (*MetricsServer) Export

Export handles incoming OTLP metrics data.

func (*MetricsServer) SetMetricCallback

func (s *MetricsServer) SetMetricCallback(cb func(tsdb.RawMetric))

SetMetricCallback sets the function to call when a new metric point is received.

type Sampler

type Sampler struct {
	// contains filtered or unexported fields
}

Sampler decides whether a trace/span should be ingested. Always keeps: error traces, slow traces (duration > latencyThresholdMs), new services. Samples healthy traces at the configured rate using a per-service token bucket.

func NewSampler

func NewSampler(rate float64, alwaysOnErrors bool, latencyThresholdMs float64) *Sampler

NewSampler creates a Sampler with the given parameters.

func (*Sampler) ShouldSample

func (s *Sampler) ShouldSample(serviceName string, isError bool, durationMs float64) bool

ShouldSample returns true if the trace should be ingested. isError: whether the trace/span has error status. durationMs: trace duration in milliseconds. serviceName: originating service.

func (*Sampler) Stats

func (s *Sampler) Stats() (int64, int64)

Stats returns (seen, dropped) counters for metrics.

type TraceServer

type TraceServer struct {
	coltracepb.UnimplementedTraceServiceServer
	// contains filtered or unexported fields
}

func NewTraceServer

func NewTraceServer(repo *storage.Repository, metrics *telemetry.Metrics, cfg *config.Config) *TraceServer

func (*TraceServer) Export

Export handles incoming OTLP trace data.

func (*TraceServer) SetLogCallback

func (s *TraceServer) SetLogCallback(cb func(storage.Log))

SetLogCallback sets the function to call when a new log is synthesized from a trace.

func (*TraceServer) SetSampler

func (s *TraceServer) SetSampler(sm *Sampler)

SetSampler enables adaptive trace sampling. Pass nil to disable.

func (*TraceServer) SetSpanCallback

func (s *TraceServer) SetSpanCallback(cb func(storage.Span))

SetSpanCallback sets the function to call when spans are persisted.

Jump to

Keyboard shortcuts

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