<p>We have added Loki twice as additional datasource for grafana in <code>kube-prometheus-stack</code> helm chart, the first is as type <code>loki</code>, the second one as type <code>prometheus</code> as the second is an only hack that allows grafana to have alerts from loki:</p>
<pre><code>grafana:
  ## Configure additional grafana datasources (passed through tpl)
  ## ref: http://docs.grafana.org/administration/provisioning/#datasources
  additionalDataSources:
    - name: Loki
      type: loki
      access: proxy
      url: http://loki.monitoring.svc.cluster.local:3100
      jsonData:
        maxLines: 1000
    - name: LokiAsPrometheus
      type: prometheus
      access: proxy
      url: http://loki.monitoring.svc.cluster.local:3100
      jsonData:
        maxLines: 1000
</code></pre>
<p>But when I create a new dashboard and select <code>LokiAsPromtheus</code> as datasorce, grafana http responses respond with errors, like there is some misconfiguration.</p>

Eljah
<p>It was critical to put <code>/loki</code> resource as the part of loki-as-prometheus url like that:</p>
<pre><code>grafana:
  ## Configure additional grafana datasources (passed through tpl)
  ## ref: http://docs.grafana.org/administration/provisioning/#datasources
  additionalDataSources:
    - name: Loki
      type: loki
      access: proxy
      url: http://loki.monitoring.svc.cluster.local:3100
      jsonData:
        maxLines: 1000
    - name: LokiAsPrometheus
      type: prometheus
      access: proxy
      url: http://loki.monitoring.svc.cluster.local:3100/loki
      jsonData:
        maxLines: 1000
</code></pre>
