Error adding Loki and Prometheus data sources in Grafana after installing via Helm

Hi folks! i have some issue adding the loki and prometheus datasource to my grafana. i’ve installad using the following steps:

helm install grafana grafana/grafana --version 6.49.0
helm install loki grafana/loki --version 3.8.0 --set read.replicas=1,write.replicas=1
helm install prometheus-stack prometheus-community/kube-prometheus-stack --version 43.2.1 --set grafana.enabled=false```
when i try to add loki datasource [http://loki-read.default.svc.cluster.local:3100](http://loki-read.default.svc.cluster.local:3100) i receive an error. the grafana log say:
```logger=context userId=1 orgId=1 uname=admin t=2023-01-04T16:55:02.627967835Z level=info msg="Request Completed" method=GET path=/api/live/ws status=-1 remote_addr=127.0.0.1 time_ms=0 duration=683.996µs size=0 referer= handler=/api/live/ws                                                                                                                                           │
│ logger=context userId=1 orgId=1 uname=admin t=2023-01-04T16:55:02.684343459Z level=info msg="Request Completed" method=GET path=/api/datasources/uid/PHY6xzh4z status=404 remote_addr=127.0.0.1 time_ms=0 duration=568.235µs size=35 referer=[http://localhost:3000/datasources/edit/PHY6xzh4z](http://localhost:3000/datasources/edit/PHY6xzh4z) handler=/api/datasources/uid/:uid                                                          │
│ logger=context userId=1 orgId=1 uname=admin t=2023-01-04T16:55:02.70507278Z level=info msg="Request Completed" method=GET path=/api/datasources/PHY6xzh4z status=400 remote_addr=127.0.0.1 time_ms=0 duration=611.89µs size=27 referer=[http://localhost:3000/datasources/edit/PHY6xzh4z](http://localhost:3000/datasources/edit/PHY6xzh4z) handler=/api/datasources/:id                                                                     │
│ logger=context userId=1 orgId=1 uname=admin t=2023-01-04T16:55:41.410128773Z level=error msg="Failed to call resource" error="no org id\n" traceID=                                                                                                                                                                                                                                      │
│ logger=context userId=1 orgId=1 uname=admin t=2023-01-04T16:55:41.410182784Z level=error msg="Request Completed" method=GET path=/api/datasources/1/resources/labels status=500 remote_addr=127.0.0.1 time_ms=1 duration=1.819828ms size=51 referer=[http://localhost:3000/datasources/edit/7y9xakh4z](http://localhost:3000/datasources/edit/7y9xakh4z) handler=/api/datasources/:id/resources/*```
the same for prometheus. Any ideas?

Hey , this works for me, maybe give it a shot?

  datasources.yaml:
    apiVersion: 1
    datasources:
    - name: prometheus
      type: prometheus
      access: proxy
      orgId: 1
      uid: prometheus
      url: [http://prometheus-server.monitoring.svc.cluster.local:80](http://prometheus-server.monitoring.svc.cluster.local:80)
      isDefault: true
      jsonData:
        timeInterval: "5s"
      version: 1
      editable: true
      basicAuth: true
      basicAuthUser: <username>      
      basicAuthPassword: <password>
    - name: loki
      type: loki
      access: proxy
      orgId: 1
      url: [http://loki.logging.svc.cluster.local:80](http://loki.logging.svc.cluster.local:80)
      isDefault: false
      jsonData:
        maxLines: 1000
      version: 1
      editable: true
      basicAuth: true
      basicAuthUser: <username>      
      basicAuthPassword: <password>```