Unfortunately, you are here.
You have OpenTelemetry tracing data that shouldn't exist and you want it gone.
Ideally, you are able to stop the generation of this data.
But until that day arrives, redact
can help!
Pass your needed redact option to a new OpenTelemetry TracerProvider.
Replace attributes from new spans that have keys matching "password"
, "user"
, and "secret"
with a redacted value.
tracerProvider := trace.NewTracerProvider(
redact.Attributes("password", "user", "secret"),
/* ... */
)
Drop spans whose name is "really-annoying-span"
or any that match "health?check*"
(e.g. "health-check"
, "healthcheck-my-service"
).
tracerProvider := trace.NewTracerProvider(
redact.Span("really-annoying-span", "health?check*"),
/* ... */
)