> For the complete documentation index, see [llms.txt](https://yutakatay.gitbook.io/katapedia/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yutakatay.gitbook.io/katapedia/doc/grafana.md).

# Grafana

## 設定

### 設定ファイルをGitで管理する方法

<https://grafana.com/docs/administration/provisioning/>

#### Datasources

```
mkdir -p datasources && curl -s "http://localhost:3000/api/datasources"  -u admin:admin|jq -c -M '.[]'|split -l 1 - datasources/
```

yqなどでyamlに変換して /etc/grafana/provisioning/datasourcesに格納する

## TroubleShooting

### lokiをクエリして

なぜか現状(2019/08/13)できない模様 <https://github.com/grafana/grafana/issues/14576> <https://github.com/grafana/grafana/issues/14860>

がんばればpromtailをPrometheusに飛ばす方法でできる模様。 <https://github.com/grafana/loki/issues/340>
