- What Grafana version and what operating system are you using?
app.kubernetes<.io>/instance: kube-prometheus-stack
app.kubernetes<.io>/managed-by: Helm
app.kubernetes<.io>/name: grafana
app.kubernetes<.io>/version: 10.4.0
(The angle brackets have been added only to disable the url detection)
- What are you trying to achieve?
I would like to get my datasource, configured via yaml file, in a working state
- How are you trying to achieve it?
I configured a yaml file with the needed data like this:
---
apiVersion: 1
datasources:
- name: grafana-postgresql-datasource
type: postgres
access: proxy
orgId: 1
uid: grafana-postgresql-datasource
url: <ipaddress>:5432
user: the_user
secureJsonData:
password: 'password'
jsonData:
database: <databasename>
sslmode: disable # disable/require/verify-ca/verify-full
maxOpenConns: 100 # Grafana v5.4+
maxIdleConns: 100 # Grafana v5.4+
maxIdleConnsAuto: true # Grafana v9.5.1+
connMaxLifetime: 14400 # Grafana v5.4+
postgresVersion: 1000 # 903=9.3, 904=9.4, 905=9.5, 906=9.6, 1000=10
timescaledb: false
version: 2
editable: false
Within my Grafana pod I found the datasource as file configured under the path /etc/grafana/provisioning/datasources
-
What happened?
Within the UI I click the button test at the end of my configured datasource. But I got the error the the password is wrong. -
What did you expect to happen?
I expect that the configured datasource is working as expected because if I create a new datasource manually within the UI with the same data from the datasource file within the Grafana pod I got a connection and also the data for my dashboards.
- Can you copy/paste the configuration(s) that you are having problems with?
- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
logger=context userId=1 orgId=1 uname=admin t=2024-07-22T12:30:41.459917016Z level=error msg="Internal server error" error="[plugin.healthCheck] client: failed to check health: invalid port in host specifier \"//172.20.1.45:5432\": strconv.Atoi: parsing \"//172.20.1.45:5432\": invalid syntax" remote_addr=172.18.98.84 traceID=
logger=context userId=1 orgId=1 uname=admin t=2024-07-22T12:30:41.459964596Z level=error msg="Request Completed" method=GET path=/api/datasources/uid/grafana-postgresql-datasource/health status=500 remote_addr=172.18.98.84 time_ms=3 duration=3.029609ms size=103 referer=https://<fqdn>/grafana/connections/datasources/edit/grafana-postgresql-datasource handler=/api/datasources/uid/:uid/health status_source=downstream
The logs are from the pod. You can get it via the command:
kubectl logs <podname> -n <namespace>
- Did you follow any online instructions? If so, what is the URL?