Fix PostgreSQL metrics by URL-encoding password in alloy config
The password contained special characters (@, !, *) that broke the connection string URL parsing. Added urlencode filter to the template. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
88cf7fac7e
commit
cce4c3776e
1 changed files with 1 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ prometheus.remote_write "prometheus" {
|
|||
|
||||
// PostgreSQL exporter (read-only metrics via pg_monitor role)
|
||||
prometheus.exporter.postgres "postgresql" {
|
||||
data_source_names = ["postgresql://{{ alloy_postgres_user }}:{{ alloy_postgres_password }}@{{ alloy_postgres_host }}:{{ alloy_postgres_port }}/{{ alloy_postgres_database }}?sslmode=disable"]
|
||||
data_source_names = ["postgresql://{{ alloy_postgres_user }}:{{ alloy_postgres_password | urlencode }}@{{ alloy_postgres_host }}:{{ alloy_postgres_port }}/{{ alloy_postgres_database }}?sslmode=disable"]
|
||||
}
|
||||
|
||||
// Scrape PostgreSQL metrics
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue