Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mralias/redact
Redact OpenTelemetry tracing data.
https://github.com/mralias/redact
go golang opentelemetry opentelemetry-go otel tracing
Last synced: 2 months ago
JSON representation
Redact OpenTelemetry tracing data.
- Host: GitHub
- URL: https://github.com/mralias/redact
- Owner: MrAlias
- License: apache-2.0
- Created: 2022-09-01T15:51:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-20T17:40:18.000Z (3 months ago)
- Last Synced: 2024-11-01T15:44:01.143Z (2 months ago)
- Topics: go, golang, opentelemetry, opentelemetry-go, otel, tracing
- Language: Go
- Homepage:
- Size: 96.7 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Redact
[![Go Reference](https://pkg.go.dev/badge/github.com/MrAlias/redact.svg)](https://pkg.go.dev/github.com/MrAlias/redact)
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!## Getting Started
Pass your needed redact option to a new [OpenTelemetry] [TracerProvider].
### Redact Attributes
Replace attributes from new spans that have keys matching `"password"`, `"user"`, and `"secret"` with a redacted value.
```go
tracerProvider := trace.NewTracerProvider(
redact.Attributes("password", "user", "secret"),
/* ... */
)
```### Redact Spans based on name
Drop spans whose name is `"really-annoying-span"` or any that match `"health?check*"` (e.g. `"health-check"`, `"healthcheck-my-service"`).
```go
tracerProvider := trace.NewTracerProvider(
redact.Span("really-annoying-span", "health?check*"),
/* ... */
)
```[OpenTelemetry]: https://opentelemetry.io/
[TracerProvider]: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#TracerProvider