Hi there,
I’m trying to reference a kubernetes secret component in an mssql component to construct the connection string, however it doesn’t seem to be possible and I can’t find anything in the documentation that would point me otherwise.
Here’s my relevant config:
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"
}
This does not work and errors with:
Error: /etc/alloy/config.alloy:32:58: remote.kubernetes.secret.sql.data.pwd should be one of [number string] for binop +, got capsule
31 | prometheus.exporter.mssql "demo" {
32 | connection_string = "sqlserver://grafana-alloy:" + remote.kubernetes.secret.sql.data.pwd + "@mssql:1433&trustservercertificate=true"
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33 | }
Any assistance would be appreciated (I’d rather not store the whole connection string in the Kubernetes secret, since the vast majority of it… isn’t actually secret).