Package org.microproxy.otel
package org.microproxy.otel
OpenTelemetry for MicroProxy, with no dependencies but the JDK: W3C Trace Context, B3 and Jaeger
propagation (
Propagators), sampling (Sampler), a SERVER span per exchange and a CLIENT span per attempt to reach
the server, INTERNAL spans for tunnels and flows, and OTLP/HTTP export of traces, metrics (the
proxy's StatsRegistry) and access logs, as protobuf or JSON (Telemetry). It plugs into the core as its FlowTracer,
and into the launcher as --otel (OtelLauncherExtension).-
ClassDescriptionAdds
--oteland its options to the command line when this module is on the class path.Reads a trace context from request headers and writes one onto them, in one format: W3C Trace Context (Propagators.TRACE_CONTEXT), B3 in its single-header and multi-header forms (Propagators.B3,Propagators.B3_MULTI) or Jaeger'suber-trace-id(Propagators.JAEGER).The propagators, by the namesOTEL_PROPAGATORSuses:tracecontext(W3C Trace Context:traceparentandtracestate),b3(B3's singleb3header),b3multi(B3'sX-B3-*headers) andjaeger(uber-trace-id).Decides whether a new trace, or the proxy's part of a trace that came with the request, is sampled: recorded and exported.What a propagator carries between processes: a 128-bit trace id, a 64-bit span id, the trace flags (bit 0: sampled) and the W3Ctracestate, as OpenTelemetry'sSpanContext.Bounds on what one span (or log record) keeps, so that attributes a script or a request supplies cannot grow it without limit: past them, attributes and events are dropped and counted as dropped in the export, and longer string values are cut.OpenTelemetry for the proxy, with nothing but the JDK: context propagation (W3C Trace Context, and B3 and Jaeger when configured), anX-Request-Idper request, a SERVER span per exchange (HTTP/1, HTTP/2 and HTTP/3) with a CLIENT span per attempt to reach the server, an INTERNAL span per tunnel or flow (CONNECT, SOCKS, WebSocket, CONNECT-UDP, QUIC), and the export over OTLP/HTTP, as protobuf or JSON, of those spans, of the proxy's stats as metrics, and of its access-log records as log records.Configures aTelemetry; every setting has OpenTelemetry's default.How OTLP is sent:http/protobuforhttp/json.What happens to a request'sX-Request-Id.What goes upstream when the proxy strips tracing headers (HttpProxyServerBootstrap.withoutTracingHeadersUpstream()).