redact

package
v0.0.0-...-4a72ded Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attributes

func Attributes(keys []attribute.Key, redactFunc RedactFunc) trace.TracerProviderOption

Attributes returns an OpenTelemetry SDK TracerProviderOption. It registers an OpenTelemetry SpanProcessor that redacts attributes of new spans matching the passed keys.

Types

type AttributeCensor

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

AttributeCensor is an OpenTelemetry SpanProcessor that censors attributes of new spans.

func NewAttributeCensor

func NewAttributeCensor(replacements map[attribute.Key]struct{}, redactFunc RedactFunc) AttributeCensor

NewAttributeCensor returns an AttributeCensor that uses the provided mapping of replacement values for a set of keys to redact matching attributes. Attributes are matched based on the equality of keys.

func (AttributeCensor) ForceFlush

func (AttributeCensor) ForceFlush(context.Context) error

ForceFlush does nothing.

func (AttributeCensor) OnEnd

func (c AttributeCensor) OnEnd(s trace.ReadOnlySpan)

OnEnd censors the attributes of s matching the Replacements keys of c.

func (AttributeCensor) OnStart

OnStart does nothing.

func (AttributeCensor) Shutdown

Shutdown does nothing.

type RedactFunc

type RedactFunc func(key attribute.KeyValue) string

Jump to

Keyboard shortcuts

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