Skip to content
Snippets Groups Projects
Commit 82b232bb authored by Julius Laitala's avatar Julius Laitala Committed by Cyril Tovena
Browse files

fluent-plugin: Mark as multi-workers ready (#709)

* fluent-plugin: Mark as multi-workers ready

* fluent-plugin: Add info on multi-worker usage to README
parent e156d3ba
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,27 @@ In your Fluentd configuration, use `@type loki`. Additional configuration is opt
</match>
```
### Multi-worker usage
Loki doesn't currently support out-of-order inserts - if you try to insert a log entry an earlier timestamp after a log entry with with identical labels but a later timestamp, the insert will fail with `HTTP status code: 500, message: rpc error: code = Unknown desc = Entry out of order`. Therefore, in order to use this plugin in a multi worker Fluentd setup, you'll need to include the worker ID in the labels.
For example, using [fluent-plugin-record-modifier](https://github.com/repeatedly/fluent-plugin-record-modifier):
```
<filter mytag>
@type record_modifier
<record>
fluentd_worker "#{worker_id}"
</record>
</filter>
<match mytag>
@type loki
# ...
label_keys "fluentd_worker"
# ...
</match>
```
## Docker Image
There is a Docker image `grafana/fluent-plugin-grafana-loki:master` which contains default configuration files to git log information
......
......@@ -63,6 +63,10 @@ module Fluent
@label_keys = @label_keys.split(/\s*,\s*/) if @label_keys
end
def multi_workers_ready?
true
end
def http_opts(uri)
opts = {
use_ssl: uri.scheme == 'https'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment