Documentation
¶
Overview ¶
Package upstream forwards the exception records an installation accepted to a configured OTLP/HTTP logs endpoint: typically a service of the installation, reached over the mesh's mutual TLS, that passes them on to the vendor (where errors group across installations by tenant.id). Records leave as they came (resource, scope and log record unchanged), through a bounded queue that never blocks local ingestion; what cannot be delivered is dropped and counted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrURL = errors.New("errors.upstream.url: want an absolute http(s) URL") ErrMeshURL = errors.New("errors.upstream.url: want https with errors.upstream.service (mutual TLS)") )
Errors of Validate.
Functions ¶
This section is empty.
Types ¶
type Forwarder ¶
Forwarder sends accepted records to the upstream.
type Option ¶
type Option func(*Forwarder)
Option configures New.
func WithTransport ¶
func WithTransport(rt http.RoundTripper) Option
WithTransport sets the transport: the mesh's mutual TLS when settings.Service names the receiver; http.DefaultTransport otherwise.
type Record ¶
type Record struct {
Resource *resourcepb.Resource
ResourceSchemaURL string
Scope *commonpb.InstrumentationScope
ScopeSchemaURL string
Log *logspb.LogRecord
}
Record is one accepted exception record with where it came from: the messages as received, never modified.
type Settings ¶
type Settings struct {
// URL is the receiver's OTLP/HTTP logs endpoint
// (https://core.service.consul:8443/v1/logs). Empty: nothing is
// forwarded and no forwarder runs (an air-gapped installation leaves it
// empty).
URL string `json:"url,omitempty"`
// Service is the receiver's mesh identity: set, the request goes over
// mutual TLS (this installation's certificate, the server verified as
// that service) and never through the environment's proxy; empty, a
// plain HTTP(S) request.
Service string `json:"service,omitempty"`
// Enabled is the operator's switch, live from the console: off drops
// the queue and forwards nothing until switched on again.
Enabled config.Live[bool] `json:"enabled" schemapb:"default=true"`
// Queue bounds the records waiting to be sent; past it new ones are
// dropped and counted.
Queue int `json:"queue" schemapb:"default=10000;gt=0"`
// Batch is the most records one request carries.
Batch int `json:"batch" schemapb:"default=512;gt=0"`
// Flush is how long a record waits for a fuller batch.
Flush time.Duration `json:"flush" schemapb:"default=5s;gt=0"`
// Timeout bounds one request.
Timeout time.Duration `json:"timeout" schemapb:"default=10s;gt=0"`
// GiveUp is how long a batch is retried (network failures, 408, 429,
// 5xx; Retry-After is honored) before it is dropped.
GiveUp time.Duration `json:"give_up" schemapb:"default=15m;gt=0"`
}
Settings of the forwarding: BACKPLANE_ERRORS_UPSTREAM_*.