grafana / alloy

OpenTelemetry Collector distribution with programmable pipelines
https://grafana.com/oss/alloy
Apache License 2.0
1.43k stars 211 forks source link

base64 encode function #2048

Open ruben-janssens opened 1 week ago

ruben-janssens commented 1 week ago

Request

Extend the standard library encoding with a to_base64 function.

Use case

We want to dynamically add a tenant id to the OTLP exporter but the exporter only supports 1 auth option and our endpoint is also protected with basic auth. We can manually add the Authentication header when we have a function to base64 encode the content.

wildum commented 1 day ago

This should be easy to add, we already have the from_base64. I'm adding the label "good first issue" if anyone wants to pick this up

ruben-janssens commented 1 day ago

Just as a side node base64 encode is actually not enough, it needs to be url safe base64 encoding. :)