[Grafana] Error reading Prometheus: server_error: server error: 500

Hi Friends,
I am trying to add loki metrics as prometheus in grafana. I am using loki distributed.
loki-loki-distributed-gateway NodePort <none> 80:31242/TCP 6d9h
My data source looks like.

        type: prometheus
        url: [http://loki-loki-distributed-gateway.monitoring.svc.cluster.local/loki](http://loki-loki-distributed-gateway.monitoring.svc.cluster.local/loki)
        access: proxy
        basicAuth: true
        basicAuthUser: admin
        basicAuthPassword: supersecret```
Unfortunately it is giving me following error
```Error reading Prometheus: server_error: server error: 500
"level=error ts=2022-01-30T17:21:12.724275282Z caller=retry.go:73 org_id=fake msg=\"error processing request\" try=1 err=\"rpc error: code = Code(500) desc = unsupported response type, got (scalar)\"\n"```
Am I missing something ? how can i solve this issue?

Why do you want to add loki metrics as prometheus? :thinking_face:
I think your datasource type should be loki.

thanks for taking your time to reply. My goal is to create create alert from loki logs.

I can run query like rate({app="grafana",namespace="monitoring"}[1m]) and it plots the data point into dashboard

But when I try to create alert, same query returns no data with error “Failed to evaluate queries and expressions: failed to execute conditions: failed to query data: Run out of attempts while querying the server”

I googled, and found we can use loki data source as prometheus and create alert.