Documentation
¶
Overview ¶
Package telemetry wires ruptor's opt-in OpenTelemetry tracing.
Security rule: telemetry is DISABLED by default. It is enabled only after explicit `ruptor auth login` (user knowingly connects to cloud) or by setting RUPTOR_TELEMETRY_ENABLED=true. The telemetry payload contains ONLY: command name, fault types used, run duration, ruptor version. NEVER: tool response content, agent output, file paths, user data, IP.
The v1 implementation provides the tracer plumbing so the rest of the code base can annotate spans; the OTLP exporter lands with the `ruptor auth login` PR (auth token required to hit telemetry.ruptor.dev).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecordRun ¶
func RecordRun(span trace.Span, command string, faultTypes []string, durationS float64, version string)
RecordRun annotates a span with the minimum fields the security model allows: command, fault types, duration seconds, version. Callers pass only non-sensitive values — the allowlist here is enforced by function signature.
Types ¶
type Config ¶
type Config struct {
Enabled bool
ServiceVersion string
// Endpoint is the OTLP collector URL. Empty disables the exporter
// even when Enabled is true — useful for tests that want spans
// but no network traffic.
Endpoint string
}
Config controls telemetry startup.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider wraps the tracer provider so callers can Shutdown cleanly without importing otel/sdk directly.
func Init ¶
Init constructs a Provider per cfg. When cfg.Enabled is false, a noop provider is returned and Shutdown is a no-op. The global otel TracerProvider is set to the new provider so callers that reach for otel.Tracer("...") see the same configuration.