Documentation
¶
Index ¶
- func EndSpan(span oteltrace.Span, err error)
- func ExtractTraceContext(ctx context.Context, h http.Header) context.Context
- func InjectTraceContext(ctx context.Context, h http.Header)
- func StartSpan(ctx context.Context, name string, attrs ...attribute.KeyValue) (context.Context, oteltrace.Span)
- type ExpvarLabel
- type ExpvarSample
- type MetricsShutdown
- type OTELMetricsConfig
- type OTELTracesConfig
- type TracesShutdown
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTraceContext ¶ added in v0.6.12
ExtractTraceContext is the API edge's extraction: the configured propagator first (trace context and baggage once SB_OTEL_TRACES is on), then W3C trace context alone when that found none. With tracing off the global propagator is a no-op, and the fallback is what still carries a caller's trace id through sandboxd to toolboxd's log.
func InjectTraceContext ¶ added in v0.6.12
InjectTraceContext sets h's traceparent and tracestate to the span context ctx carries: sandboxd's API span with tracing on (a child of the caller's trace), else the caller's own context. Whatever h held before is dropped first, so a header the edge did not accept (malformed, or sent on a route that never extracted it) is never forwarded into the sandbox.
Types ¶
type ExpvarLabel ¶
type ExpvarSample ¶
type ExpvarSample struct {
Name string
Labels []ExpvarLabel
Int64 *int64
Float *float64
}
func CollectAerolVMExpvars ¶
func CollectAerolVMExpvars() []ExpvarSample
type MetricsShutdown ¶
func StartOTELMetrics ¶
func StartOTELMetrics(ctx context.Context, logger *slog.Logger, cfg OTELMetricsConfig) (MetricsShutdown, error)
type OTELMetricsConfig ¶
type OTELTracesConfig ¶
type TracesShutdown ¶
func StartOTELTraces ¶
func StartOTELTraces(ctx context.Context, logger *slog.Logger, cfg OTELTracesConfig) (TracesShutdown, error)