feat: new helpers and masking/encrypting attributes

New helper functions were added to make call-site less likely to need
to pull `go.opentelemetry.io/otel/attribute` as a dependency.
Additionally `Encrypted` and `Masked` were added to add a possibility of
logging sensitive data in a more secure manner.
This commit is contained in:
2024-09-13 15:48:16 +02:00
parent 2004e1b2f5
commit 9a1b41b1ad
4 changed files with 201 additions and 32 deletions

View File

@ -8,6 +8,7 @@ import (
"os/signal"
"time"
"git.ma-al.com/maal-libraries/observer/pkg/attr"
"git.ma-al.com/maal-libraries/observer/pkg/attr/layer_attr"
"git.ma-al.com/maal-libraries/observer/pkg/event"
"git.ma-al.com/maal-libraries/observer/pkg/exporters"
@ -111,6 +112,11 @@ func Serv(ctx context.Context) *fiber.Error {
return fiber.NewError(500, "xd")
}
span.SetAttributes(
attr.Masked("some_masked_value", "some_masked_value"),
attr.Encrypted("some_encrypted_value", "some_encrypted_value"),
)
return fiber.NewError(500, "x")
}