Devenv: Add back loki-promtail (#60282)

* add back loki-promtail

* update README

* add MacOS note
This commit is contained in:
Sven Grossmann 2022-12-14 15:02:12 +01:00 committed by GitHub
parent 30e2de89ec
commit 6f64dd533f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,10 @@
NB: This will not work properly on MacOS. The loglines of grafana.log are ingested at the start of this devenv and you won't get any more logs are the Docker service is started.
By default this block is setup to scrape logs from Grafana. If you need to log some service from the docker-compse you can add:
```
# For this to work you need to install the logging driver see https://github.com/grafana/loki/tree/master/cmd/docker-driver#plugin-installation
logging:
driver: loki
options:
loki-url: "http://loki:3100/loki/api/v1/push"
```

View File

@ -0,0 +1,12 @@
loki:
image: grafana/loki:latest
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
promtail:
image: grafana/promtail:latest
volumes:
- ./docker/blocks/loki-promtail/promtail-config.yaml:/etc/promtail/docker-config.yaml
- ../data/log:/var/log/grafana
command:
-config.file=/etc/promtail/docker-config.yaml

View File

@ -0,0 +1,25 @@
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
client:
url: http://loki:3100/api/prom/push
scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: varlogs
__path__: /var/log/*log
- job_name: grafana
static_configs:
- targets:
- localhost
labels:
job: grafana
__path__: /var/log/grafana/*log