Skip to content

Commit

Permalink
Unite docs for fluentd plugin (#1634)
Browse files Browse the repository at this point in the history
* Use original README.md for fluentd plugin explanations

`doc/client/fluentd.m` includes obsolete explanations and it confuses new users.
For example, label_keys option was removed at #1186
but `fluentd.md` has the explanation.

It's simple to maitain `fluentd/fluent-plugin-grafana-loki/README.md` for
the explantion of the output plugin and use the link when we share how to use it.

* Remove `label_keys` option and simplify usage for `drop_single_key`

* Fix environment variable: FLUENT_CONFIG -> FLUENTD_CONFIG

`docker-compose up` fails due to the wrong environment variable
specifying the fluentd config. As a result this causes the following error

```
docker-compose up --build
WARNING: The LOKI_USERNAME variable is not set. Defaulting to a blank
string.
WARNING: The LOKI_PASSWORD variable is not set. Defaulting to a blank
string.
Building fluentd
Step 1/17 : FROM fluent/fluentd:v1.3.2-debian
 ---> 4790aaf4d1e5
Step 2/17 : USER root
 ---> Using cache
 ---> 7b54da6cec9e
Step 3/17 : WORKDIR /home/fluent
 ---> Using cache
 ---> a161d2fcf64b
Step 4/17 : ENV PATH /fluentd/vendor/bundle/ruby/2.3.0/bin:$PATH
 ---> Using cache
 ---> b67529aad0b5
Step 5/17 : ENV GEM_PATH /fluentd/vendor/bundle/ruby/2.3.0
 ---> Using cache
 ---> 3a8b05beb185
Step 6/17 : ENV GEM_HOME /fluentd/vendor/bundle/ruby/2.3.0
 ---> Using cache
 ---> d68a94345cb4
Step 7/17 : ENV FLUENTD_DISABLE_BUNDLER_INJECTION 1
 ---> Using cache
 ---> 70f9bbf646e8
Step 8/17 : COPY docker/Gemfile* /fluentd/
 ---> Using cache
 ---> 5f8b2f6ffe1a
Step 9/17 : RUN buildDeps="sudo make gcc g++ libc-dev ruby-dev"
&& apt-get update        && apt-get install -y --no-install-recommends
$buildDeps libsystemd0 net-tools libjemalloc1        && gem install
bundler --version 1.16.2        && bundle config silence_root_warning
true        && bundle install --gemfile=/fluentd/Gemfile
--path=/fluentd/vendor/bundle        && sudo gem sources --clear-all
&& SUDO_FORCE_REMOVE=yes        apt-get purge -y --auto-remove        -o
APT::AutoRemove::RecommendsImportant=false        $buildDeps        &&
rm -rf /var/lib/apt/lists/*
/home/fluent/.gem/ruby/2.3.0/cache/*.gem        /tmp/* /var/tmp/*
/usr/lib/ruby/gems/*/cache/*.gem
 ---> Using cache
 ---> 36c960a53c2c
Step 10/17 : COPY docker/entrypoint.sh /fluentd/entrypoint.sh
 ---> Using cache
 ---> 7f8d72ae63ca
Step 11/17 : COPY lib/fluent/plugin/out_loki.rb
/fluentd/plugins/out_loki.rb
 ---> Using cache
 ---> d09473ee4f25
Step 12/17 : COPY docker/conf/ /fluentd/etc/loki/
 ---> Using cache
 ---> 00d0439ef3c8
Step 13/17 : ENV FLUENTD_CONF="/fluentd/etc/loki/fluentd.conf"
 ---> Using cache
 ---> 2d33a002baaf
Step 14/17 : ENV FLUENTD_OPT=""
 ---> Using cache
 ---> c314df064756
Step 15/17 : ENV LOKI_URL "https://logs-us-west1.grafana.net"
 ---> Using cache
 ---> df78c829d416
Step 16/17 : ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so.1"
 ---> Using cache
 ---> 3d7d14cf37f5
Step 17/17 : ENTRYPOINT ["/fluentd/entrypoint.sh"]
 ---> Using cache
 ---> 82c70c2354ac
Successfully built 82c70c2354ac
Successfully tagged fluentd:loki
Starting docker_fluentd_1 ... done
Attaching to docker_fluentd_1
fluentd_1  |
/fluentd/vendor/bundle/ruby/2.3.0/gems/fluentd-1.6.2/lib/fluent/supervisor.rb:769:in
`initialize': No such file or directory @ rb_sysopen -
/fluentd/etc/loki/fluentd.conf (Errno::ENOENT)
fluentd_1  |    from
/fluentd/vendor/bundle/ruby/2.3.0/gems/fluentd-1.6.2/lib/fluent/supervisor.rb:769:in
`open'
fluentd_1  |    from
/fluentd/vendor/bundle/ruby/2.3.0/gems/fluentd-1.6.2/lib/fluent/supervisor.rb:769:in
`read_config'
fluentd_1  |    from
/fluentd/vendor/bundle/ruby/2.3.0/gems/fluentd-1.6.2/lib/fluent/supervisor.rb:479:in
`run_supervisor'
fluentd_1  |    from
/fluentd/vendor/bundle/ruby/2.3.0/gems/fluentd-1.6.2/lib/fluent/command/fluentd.rb:314:in
`<top (required)>'
fluentd_1  |    from
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
fluentd_1  |    from
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
fluentd_1  |    from
/fluentd/vendor/bundle/ruby/2.3.0/gems/fluentd-1.6.2/bin/fluentd:8:in
`<top (required)>'
fluentd_1  |    from /fluentd/vendor/bundle/ruby/2.3.0/bin/fluentd:22:in
`load'
fluentd_1  |    from /fluentd/vendor/bundle/ruby/2.3.0/bin/fluentd:22:in
`<main>'
docker_fluentd_1 exited with code 1
```

* Use docs/clients/fluentd/README.md for fluent-plugin-grafana-loki explanation

* Arrange list order based on number

* Revert "Fix environment variable: FLUENT_CONFIG -> FLUENTD_CONFIG"

This reverts commit 8ed58ac97a82d5536321fb9a76120fed766ae506.

* Elaborate the way to use docker image

* Fix grammar: remove unnecessary with

* Add disclaimer for multi-worker usage
  • Loading branch information
takanabe authored Feb 7, 2020
1 parent e188109 commit 973b96d
Show file tree
Hide file tree
Showing 4 changed files with 213 additions and 391 deletions.
2 changes: 1 addition & 1 deletion docs/clients/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Loki supports the following official clients for sending logs:

1. [Promtail](./promtail/README.md)
2. [Docker Driver](./docker-driver/README.md)
3. [Fluentd](./fluentd/README.md)
4. [Fluent Bit](../../cmd/fluent-bit/README.md)
3. [Fluentd](./fluentd.md)

## Picking a Client

Expand Down
179 changes: 0 additions & 179 deletions docs/clients/fluentd.md

This file was deleted.

Loading

0 comments on commit 973b96d

Please sign in to comment.