Documentation
¶
Index ¶
- func ConvertLogs(req *logscollpb.ExportLogsServiceRequest) []*chstore.Log
- func ConvertMetrics(req *metricscollpb.ExportMetricsServiceRequest) ([]*chstore.MetricPoint, []*chstore.ExemplarRow)
- func ConvertTraces(req *tracecollpb.ExportTraceServiceRequest) ([]*chstore.Span, []*chstore.SpanLinkRow)
- func HTTPHandler(ing *Ingester) http.Handler
- func SeriesFingerprint(metricName string, dpAttrs []*commonpb.KeyValue, ...) uint64
- type GRPCHandle
- type HTTPHandle
- type Ingester
- func (ing *Ingester) ExemplarsDroppedCapped() uint64
- func (ing *Ingester) ExemplarsDroppedNoTrace() uint64
- func (ing *Ingester) ExemplarsIngested() uint64
- func (ing *Ingester) LogsDroppedByPipeline() uint64
- func (ing *Ingester) MetricsDroppedByPipeline() uint64
- func (ing *Ingester) SetAutocomplete(a *acache.Store)
- func (ing *Ingester) SetExemplarCap(n int)
- func (ing *Ingester) SetExemplarPolicy(requireTraceContext bool)
- func (ing *Ingester) SetExemplars(c *consumer.Consumer[*chstore.ExemplarRow])
- func (ing *Ingester) SetPipeline(p *pipeline.Engine)
- func (ing *Ingester) SetSpanLinks(c *consumer.Consumer[*chstore.SpanLinkRow])
- func (ing *Ingester) SpanLinksDroppedInvalid() uint64
- func (ing *Ingester) SpanLinksIngested() uint64
- func (ing *Ingester) SpansDroppedByPipeline() uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertLogs ¶
func ConvertLogs(req *logscollpb.ExportLogsServiceRequest) []*chstore.Log
func ConvertMetrics ¶
func ConvertMetrics(req *metricscollpb.ExportMetricsServiceRequest) ([]*chstore.MetricPoint, []*chstore.ExemplarRow)
ConvertMetrics returns the metric points plus the OTLP exemplars extracted from their datapoints (v0.8.328 — previously dp.Exemplars was silently dropped, pivot-audit §2). Exemplar rows carry the SAME series fingerprint as their datapoint's metric row — the metric→trace pivot join key. The require-trace-context gate is NOT applied here (pure conversion, unit- testable); the Ingester's addExemplar applies it so HTTP + gRPC share one policy + one set of counters.
func ConvertTraces ¶
func ConvertTraces(req *tracecollpb.ExportTraceServiceRequest) ([]*chstore.Span, []*chstore.SpanLinkRow)
ConvertTraces returns the span rows plus the span-link rows extracted from them (v0.8.329 — previously sp.Links was silently dropped, pivot-audit §2; mirrors how ConvertMetrics returns exemplars since v0.8.328). Link rows carry the OWNING span's identity (trace/span id, start time, service) — the forward key of the span_links table. The invalid-link gate (empty linked trace id) is NOT applied here: pure conversion, unit-testable; the Ingester's addSpanLink applies it so HTTP + gRPC share one gate + one set of counters (the v0.8.328 exemplar split, same reason).
func HTTPHandler ¶
HTTPHandler returns an http.Handler that accepts OTLP/HTTP (protobuf + JSON).
func SeriesFingerprint ¶ added in v0.8.328
func SeriesFingerprint(metricName string, dpAttrs []*commonpb.KeyValue, serviceName, serviceInstanceID string) uint64
SeriesFingerprint returns the stable identity of one metric series: (metric name, datapoint attribute set, service.name + service.instance.id). Resource identity is deliberately limited to those two keys (pivot-audit open question #3, approved): per-instance series pivot per-instance; service-level rollups use the metric+service fallback read path.
Types ¶
type GRPCHandle ¶ added in v0.8.336
type GRPCHandle struct {
// contains filtered or unexported fields
}
GRPCHandle is the shutdown handle StartGRPC returns (v0.8.336, HA audit H1). Opaque on purpose: main owns WHEN to stop accepting, the otlp package owns HOW (graceful-with-bound), and main never imports google.golang.org/grpc.
func StartGRPC ¶
func StartGRPC(addr string, ing *Ingester) (*GRPCHandle, error)
StartGRPC listens, registers the OTLP services and serves in a background goroutine, returning a handle main GracefulStops during shutdown (v0.8.336, HA audit H1 — the server used to outlive the consumers: post-SIGTERM Exports were ACKed into channels nobody drained, and the abrupt connection cut on process exit is the client-side trigger for the otelcol zero-addresses wedge).
func (*GRPCHandle) Shutdown ¶ added in v0.8.336
func (h *GRPCHandle) Shutdown(grace time.Duration)
Shutdown drains gracefully — GOAWAY to collectors, in-flight Exports finish — but never longer than `grace`: GracefulStop can hang on a stuck stream, and a shutdown that outlives terminationGracePeriod gets SIGKILLed mid-drain, losing more than the hard Stop would.
type HTTPHandle ¶ added in v0.9.168
type HTTPHandle struct {
// contains filtered or unexported fields
}
HTTPHandle wraps the dedicated OTLP/HTTP server so main can drain it on shutdown, symmetric with GRPCHandle (v0.9.168).
func StartHTTP ¶ added in v0.9.168
func StartHTTP(addr string, ing *Ingester) (*HTTPHandle, error)
StartHTTP starts a DEDICATED OTLP/HTTP listener on addr serving ONLY the OTLP ingest routes (POST /v1/{traces,logs,metrics}) — no Web UI, no REST, no auth middleware — so a cross-cluster collector pushes straight to the standard OTel port (:4318) without reaching the login-gated UI that shares :8088. Serves plain HTTP; TLS is terminated at the edge (OpenShift Route edge termination / Ingress / LB), never in-binary. Binds synchronously so a port clash fails boot loud (an ingest pod with a dead OTLP listener is not a degraded mode), then serves in a goroutine and returns a handle main drains on SIGTERM — symmetric with StartGRPC (v0.9.168).
func (*HTTPHandle) Shutdown ¶ added in v0.9.168
func (h *HTTPHandle) Shutdown(grace time.Duration)
Shutdown drains the dedicated OTLP/HTTP listener, bounded by `grace` — same contract as GRPCHandle.Shutdown so main's ordered teardown treats both symmetrically. Nil-safe (nil on non-ingest roles / when disabled).
type Ingester ¶
type Ingester struct {
Spans *consumer.Consumer[*chstore.Span]
Logs *consumer.Consumer[*chstore.Log]
Metrics *consumer.Consumer[*chstore.MetricPoint]
// Exemplars (v0.8.328) — OTLP metric exemplars extracted alongside the
// metric points (cross-signal pivot). Its flusher batches into
// chstore.InsertExemplars with the same consumer machinery / flush
// cadence as Metrics. nil-safe: addExemplar no-ops the enqueue (counters
// still tick) on pods where main didn't wire it.
Exemplars *consumer.Consumer[*chstore.ExemplarRow]
// SpanLinks (v0.8.329) — OTel span links extracted alongside the span
// rows (cross-signal pivot Phase 1b). Its flusher batches into
// chstore.InsertSpanLinks with the same consumer machinery / flush
// cadence as Spans. nil-safe: addSpanLink no-ops the enqueue (counters
// still tick) on pods where main didn't wire it.
SpanLinks *consumer.Consumer[*chstore.SpanLinkRow]
// contains filtered or unexported fields
}
Ingester wires the three OTLP consumers together. Every received span is stored — in-binary head/tail sampling was removed (v0.8.73); sampling, when wanted, happens at the collector (the sample-to-Coremetry / 100%-to-Tempo split). An optional pipeline drop/enrich engine still runs first.
func NewIngester ¶
func (*Ingester) ExemplarsDroppedCapped ¶ added in v0.8.433
func (*Ingester) ExemplarsDroppedNoTrace ¶ added in v0.8.328
func (*Ingester) ExemplarsIngested ¶ added in v0.8.328
ExemplarsIngested / ExemplarsDroppedNoTrace are the two v0.8.328 exemplar ingest totals surfaced on /admin/stats (SystemStats.Exemplars), following the pipeline-counter accessor pattern above.
func (*Ingester) LogsDroppedByPipeline ¶ added in v0.8.282
LogsDroppedByPipeline / MetricsDroppedByPipeline mirror the span accessor (v0.8.282). Surfaced on /admin/stats so the operator sees how many logs / metric points a pipeline rule discarded before the consumer buffer. Distinct from the queue-full / write-failed loss counters — pipeline drops are INTENTIONAL, not data loss.
func (*Ingester) MetricsDroppedByPipeline ¶ added in v0.8.282
func (*Ingester) SetAutocomplete ¶ added in v0.8.80
SetAutocomplete wires the Redis autocomplete cache so every accepted span also populates the service/operation/attribute picker facets. Called from main(); nil keeps the old behaviour (no autocomplete cache).
func (*Ingester) SetExemplarCap ¶ added in v0.8.433
SetExemplarCap arms the per-series×minute ingest cap (v0.8.433, exemplar audit Faz C). n <= 0 keeps the unlimited default. Called at boot before traffic like SetExemplarPolicy — not safe to flip live.
func (*Ingester) SetExemplarPolicy ¶ added in v0.8.328
SetExemplarPolicy applies config exemplars.require_trace_context (default true). require=false stores trace-less exemplars too — useful when the operator wants the value/attr context even without a click-through target.
func (*Ingester) SetExemplars ¶ added in v0.8.328
func (ing *Ingester) SetExemplars(c *consumer.Consumer[*chstore.ExemplarRow])
SetExemplars wires the exemplar consumer (v0.8.328). Called from main(); nil keeps addExemplar counting but not enqueueing (api-only pods).
func (*Ingester) SetPipeline ¶ added in v0.5.263
SetPipeline wires the ingest-time policy engine. Always called from main(); nil keeps the old behaviour (every span flows through unchanged).
func (*Ingester) SetSpanLinks ¶ added in v0.8.329
func (ing *Ingester) SetSpanLinks(c *consumer.Consumer[*chstore.SpanLinkRow])
SetSpanLinks wires the span-link consumer (v0.8.329). Called from main(); nil keeps addSpanLink counting but not enqueueing (api-only pods).
func (*Ingester) SpanLinksDroppedInvalid ¶ added in v0.8.329
func (*Ingester) SpanLinksIngested ¶ added in v0.8.329
SpanLinksIngested / SpanLinksDroppedInvalid are the two v0.8.329 span-link ingest totals surfaced on /admin/stats (SystemStats.SpanLinks), following the exemplar-counter accessor pattern above.
func (*Ingester) SpansDroppedByPipeline ¶ added in v0.5.263
SpansDroppedByPipeline is a monotonic counter of spans dropped by a pipeline rule since boot. Surfaced on /api/health alongside sampler-dropped + buffer-dropped counters so the operator can see the policy engine's effect at a glance.