-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use string concatenation (+
) on secrets
#1514
Comments
Thanks for opening a ticket, that seems reasonable to me.
|
I think a good solution should also support use of string functions on a secret where appropriate |
Hey all, just wanted to Subscribe and also share that I had the same experience.
Also agree with your suggestions 👍 |
I would like to add this implementation to alloy. If work is not been started on this can we assign this to me. |
done, thanks! |
Request
Currently, it doesn't seem possible to use an operator like
+
(which works for strings) onsecret
types. It would be good if that kind of thing was available.Use case
For example, constructing a
connection_string
in aprometheus.exporter.mssql
component:remote.kubernetes.secret "sql" { namespace = "alloy" name = "sql-password" } prometheus.exporter.mssql "demo" { connection_string = "sqlserver://grafana-alloy:" + remote.kubernetes.secret.sql.data.pwd + "@mssql:1433?trustservercertificate=true" }
The majority of the
connection_string
isn't actually secret, even if the result is, but doing the above results in an error like:Marking the export as
nonsensitive
works:prometheus.exporter.mssql "demo" { connection_string = "sqlserver://grafana-alloy:" + nonsensitive(remote.kubernetes.secret.sql.data.pwd) + "@mssql:1433?trustservercertificate=true" }
But that exposes the secret in logs.
Alternatives:
username
andpassword
fields can be provided separately from the rest of the connection string, and the string constructed internally);Thanks in advance.
The text was updated successfully, but these errors were encountered: