mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 12:29:26 +08:00
devenv: trying to make fluentd with inoffical fluent-plugin-loki work
This commit is contained in:
@ -7,6 +7,10 @@ services:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
logging:
|
||||
driver: "fluentd"
|
||||
options:
|
||||
tag: nginx
|
||||
|
||||
db:
|
||||
image: mysql:5.6
|
||||
@ -73,6 +77,10 @@ services:
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
logging:
|
||||
driver: "fluentd"
|
||||
options:
|
||||
tag: grafana
|
||||
|
||||
prometheus:
|
||||
image: prom/prometheus:v2.4.2
|
||||
@ -82,3 +90,21 @@ services:
|
||||
- VIRTUAL_HOST=prometheus.loc
|
||||
ports:
|
||||
- 9090
|
||||
|
||||
loki:
|
||||
image: grafana/loki:master
|
||||
environment:
|
||||
- VIRTUAL_HOST=loki.loc
|
||||
ports:
|
||||
- 3100
|
||||
command: -config.file=/etc/loki/local-config.yaml
|
||||
|
||||
fluentd:
|
||||
build: ./fluentd
|
||||
volumes:
|
||||
- ./fluentd/fluent.conf:/fluentd/etc/fluent.conf
|
||||
links:
|
||||
- loki
|
||||
ports:
|
||||
- "24224:24224"
|
||||
- "24224:24224/udp"
|
||||
|
30
devenv/docker/ha_test/fluentd/Dockerfile
Normal file
30
devenv/docker/ha_test/fluentd/Dockerfile
Normal file
@ -0,0 +1,30 @@
|
||||
FROM fluent/fluentd:v1.3.3-debian-1.0
|
||||
|
||||
# USER root
|
||||
|
||||
# RUN apk add --no-cache --update --virtual .build-deps \
|
||||
# sudo build-base ruby-dev \
|
||||
# && sudo gem install bundler \
|
||||
# && gem 'loki', git: 'https://github.com/grafana/loki.git', glob: 'fluentd/fluent-plugin-loki/*.gemspec' \
|
||||
# && sudo gem sources --clear-all \
|
||||
# && apk del .build-deps \
|
||||
# && rm -rf /home/fluent/.gem/ruby/2.5.0/cache/*.gem
|
||||
|
||||
# USER fluent
|
||||
|
||||
USER root
|
||||
|
||||
COPY Gemfile .
|
||||
RUN ["gem", "install", "fluent-plugin-loki"]
|
||||
|
||||
# RUN apt-get -y update \
|
||||
# && apt-get -y install git \
|
||||
# && apt-get clean \
|
||||
# && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man/?? /usr/share/man/??_*
|
||||
|
||||
# RUN gem install bundler \
|
||||
# && bundler install
|
||||
|
||||
# COPY fluent.conf /fluentd/etc
|
||||
|
||||
USER fluent
|
1
devenv/docker/ha_test/fluentd/Gemfile
Normal file
1
devenv/docker/ha_test/fluentd/Gemfile
Normal file
@ -0,0 +1 @@
|
||||
source 'https://rubygems.org'
|
19
devenv/docker/ha_test/fluentd/fluent.conf
Normal file
19
devenv/docker/ha_test/fluentd/fluent.conf
Normal file
@ -0,0 +1,19 @@
|
||||
<source>
|
||||
@type forward
|
||||
port 24224
|
||||
bind 0.0.0.0
|
||||
</source>
|
||||
|
||||
<match **>
|
||||
@type stdout
|
||||
format json
|
||||
</match>
|
||||
|
||||
<match **>
|
||||
@type loki
|
||||
endpoint_url "http://loki:3100"
|
||||
labels {"env":"dev"}
|
||||
flush_interval 10s
|
||||
flush_at_shutdown true
|
||||
buffer_chunk_limit 1m
|
||||
</match>
|
@ -8,4 +8,9 @@ datasources:
|
||||
jsonData:
|
||||
timeInterval: 10s
|
||||
queryTimeout: 30s
|
||||
httpMethod: POST
|
||||
httpMethod: POST
|
||||
|
||||
- name: Loki
|
||||
type: loki
|
||||
access: proxy
|
||||
url: http://loki:3100
|
||||
|
Reference in New Issue
Block a user