telemetry

package
v2.17.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package telemetry relays browser OpenTelemetry data to the collector configured through the standard OTEL_* exporter, endpoint, protocol, and header variables.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPayloadTooLarge = errors.New("telemetry payload exceeds 512 KiB")
	ErrInvalidPayload  = errors.New("telemetry payload is not OTLP/JSON from arcane-frontend")
)

Functions

func Endpoint

func Endpoint(signal string) string

Endpoint returns the OTLP/HTTP URL for signal, or "" when its exporter is off, uses gRPC, or has no endpoint configured.

func RegisterRoutes

func RegisterRoutes(g *echo.Group, service *Service)

RegisterRoutes adds an unauthenticated relay route per enabled signal; disabled signals return 404. Routes share a per-IP limit, a global limit, and a cap on concurrent requests.

func SDKDisabled

func SDKDisabled() bool

SDKDisabled reports whether OTEL_SDK_DISABLED turns all telemetry off.

Types

type Service

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

Service relays browser OTLP/JSON payloads to the configured collector so the collector and its credentials stay server-side.

func NewService

func NewService() *Service

NewService returns nil when no signal can be relayed.

func (*Service) Forward

func (s *Service) Forward(ctx context.Context, signal string, body io.Reader) (int, error)

Forward posts an OTLP/JSON payload of at most 512 KiB for signal to the collector and returns its status code. Every resource must identify as arcane-frontend.

Jump to

Keyboard shortcuts

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