telemetryredaction

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const RedactedValue = "[redacted]"

Variables

This section is empty.

Functions

func Configure

func Configure(parsePolicy Policy)

Configure installs the current process-wide telemetry redaction policy.

func Field

func Field(parsePath string, parseField string, parseValue any) (any, bool)

Field applies the active redaction policy to one field.

func JoinPath

func JoinPath(parseBase string, parseField string) string

JoinPath appends one telemetry field to a dotted redaction path.

func StringMap

func StringMap(parsePath string, parseValues map[string]string) map[string]string

StringMap applies telemetry redaction to a string map and drops fields whose redactor fails.

func Value

func Value(parsePath string, parseValue any) any

Value recursively redacts JSON-like telemetry values.

Types

type Context

type Context struct {
	Path  string
	Field string
	Value any
}

Context describes one telemetry field being filtered.

type Policy

type Policy struct {
	Fields []string
	Redact func(Context) (any, error)
}

Policy configures opt-in telemetry redaction. Field names are matched case-insensitively against the final path segment. Redactor errors drop the field so telemetry fails closed.

func Current

func Current() Policy

Current returns a copy of the active redaction policy.

Jump to

Keyboard shortcuts

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