Documentation
¶
Index ¶
- type HTTPHandler
- type LogsServer
- type MetricsServer
- type Sampler
- type TraceServer
- func (s *TraceServer) Export(ctx context.Context, req *coltracepb.ExportTraceServiceRequest) (*coltracepb.ExportTraceServiceResponse, error)
- func (s *TraceServer) SetLogCallback(cb func(storage.Log))
- func (s *TraceServer) SetSampler(sm *Sampler)
- func (s *TraceServer) SetSpanCallback(cb func(storage.Span))
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 ¶
func (s *LogsServer) Export(ctx context.Context, req *collogspb.ExportLogsServiceRequest) (*collogspb.ExportLogsServiceResponse, error)
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 ¶
func (s *MetricsServer) Export(ctx context.Context, req *colmetricspb.ExportMetricsServiceRequest) (*colmetricspb.ExportMetricsServiceResponse, error)
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 ¶
NewSampler creates a Sampler with the given parameters.
func (*Sampler) ShouldSample ¶
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.
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 ¶
func (s *TraceServer) Export(ctx context.Context, req *coltracepb.ExportTraceServiceRequest) (*coltracepb.ExportTraceServiceResponse, error)
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.