mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Devenv: Add back loki-promtail
(#60282)
* add back loki-promtail * update README * add MacOS note
This commit is contained in:
parent
30e2de89ec
commit
6f64dd533f
10
devenv/docker/blocks/loki-promtail/README.md
Normal file
10
devenv/docker/blocks/loki-promtail/README.md
Normal 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"
|
||||
```
|
12
devenv/docker/blocks/loki-promtail/docker-compose.yaml
Normal file
12
devenv/docker/blocks/loki-promtail/docker-compose.yaml
Normal 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
|
25
devenv/docker/blocks/loki-promtail/promtail-config.yaml
Normal file
25
devenv/docker/blocks/loki-promtail/promtail-config.yaml
Normal 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
|
Loading…
Reference in New Issue
Block a user