otlp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package otlp admits public OTLP/HTTP into a deployment-owned Collector. It does not depend on operator sessions, IAM, the registry or PostgreSQL.

Index

Constants

View Source
const (
	IngestHeader = "X-Backplane-Ingest"
	IngestProxy  = "proxy"
)

IngestHeader carries IngestProxy on every request the proxy forwards: the Collector (include_metadata) turns it into the backplane.ingest attribute its audit pipeline drops.

Variables

View Source
var ErrConfig = errors.New("invalid OTLP admission configuration")

ErrConfig indicates an unsafe or incomplete admission configuration.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL            string          `json:"url,omitempty"`
	Keys           []config.Secret `json:"keys,omitempty"`
	TrustedProxies []string        `json:"trusted_proxies,omitempty"`
	BodyBytes      int64           `json:"body_bytes"                schemapb:"default=2097152;gte=1024;lte=16777216"`
	Concurrent     int64           `json:"concurrent"                schemapb:"default=16;gte=1;lte=1024"`
	RatePerMinute  int64           `json:"rate_per_minute"           schemapb:"default=300;gte=1;lte=1000000"`
	Burst          int64           `json:"burst"                     schemapb:"default=120;gte=1;lte=1000000"`
	MaxIPs         int64           `json:"max_ips"                   schemapb:"default=4096;gte=1;lte=1000000"`
	IdleTTL        time.Duration   `json:"idle_ttl"                  schemapb:"default=10m;gt=0"`
	Timeout        time.Duration   `json:"timeout"                   schemapb:"default=10s;gt=0"`
}

Config is deployment-only; an empty URL disables the ingress route.

func (Config) Validate

func (c Config) Validate() error

Validate also applies to callers that do not use the schema loader.

type Handler

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

Handler is shared by all three signals on one replica. The concurrency bound covers body reads, decompression and upstream response reads, with no queue.

func New

func New(cfg Config) (*Handler, error)

New constructs an enabled handler; defaults come from the config schema.

func (*Handler) Close

func (h *Handler) Close()

Close releases idle upstream connections during shutdown.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP expects /v1/logs, /v1/metrics or /v1/traces after prefix stripping.

func (*Handler) SessionLogs

func (h *Handler) SessionLogs() http.Handler

SessionLogs is for the console's authenticated, same-origin route only. It shares public admission limits and marks records as proxy traffic, so they cannot become application audit. The caller must validate the session.

Jump to

Keyboard shortcuts

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