-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Loki output plugin #994
Comments
Hi, I've created grafana loki plugin which uses Golang interface: https://github.com/cosmo0920/fluent-bit-go-loki |
I’ve sent a PR to create Grafana/Loki fluent-bit-go plugin and merged in grafana/loki#847 |
Would be good if this plugin could be moved from grafana and promoted as official plugin under fluent-bit umbrella same as plugin for es or splunk. |
This allows to use the existing HTTP output to push logs into Grafana Loki. This uses the JSON format for pushing logs into Loki, as using protobuf would require more dependencies. (cf. fluent#994) Signed-off-by: Christian Simon <[email protected]>
Any update on this? I've currently created a hybrid fluent-bit (using the image provided by grafana and config from fluent bit itself). 🚀 With minimal tweaks I was able to get it working on Openshift. Both promtail and fluent-bit loki plugin (from Grafana) are proving to be very hard to get up and running. I can share my helm config if needed.. My C experience is very rusty so maybe not the best idea for me at this point 😅 |
Yes, there is a plan. One feature that we are working on Fluent Bit core is the ability to send chunks of data "in order". Fluent Bit was designed for fast performance and data delivery, meaning we send data in parallel. This could lead to having data chunks arriving at different intervals on the destination, for most of the services this is not a problem, but Loki requires that all data arrives ordered by timestamp which is something we cannot guarantee at the moment, consider this case:
the solution is to implement a logic to deliver data in order without multiplexing and in order. Of course, this hurt performance (meaning: deliver data at a slow rate) but solves the problem. This part is "work in process" |
@edsiper thank you for elaborating this! Really appreciated 👌 |
I've created buffering inside loki output plugin grafana/loki#2142 as an alternative to the future in order flb core buffering |
Hi @edsiper , |
@lanphan it will be implemented but other previous tasks are required like custom buffering (work in process) For now you can use the golang plugin available for Fluent Bit |
Thanks for your quick response, @edsiper .
What you mentioned is #2 I found above? |
Yeah, you can use official golang plugin for loki. |
Thank @cosmo0920 . |
fluent-bit golang plugin of Loki uses |
This patch adds a new plugin to deliver records to Loki (grafana). It supports the following configuration options: host Loki hostname or IP address port Loki TCP port tenant_id Tenant ID used by default to push logs to Loki. If omitted or empty it assumes Loki is running in single-tenant mode and no X-Scope-OrgID header is sent. > type: string labels labels for API requests. > default: job="fluent-bit", type: multiple comma delimited strings auto_kubernetes_labels If set to true, it will add all Kubernetes labels to Loki labels. > default: false, type: boolean label_keys Comma separated list of keys to use as stream labels. > type: multiple comma delimited strings One of the interesting features is that 'labels' and 'label_keys' support record accessor mode, e.g: [OUTPUT] name loki match * labels job=fluentbit, rec=$sub['field'] label_keys $somekey Note that 'label_keys' must be prefixed with '$' since it's a record accessor pattern. This plugin is still in development, community feedback is welcome. Signed-off-by: Eduardo Silva <[email protected]>
This patch adds a new plugin to deliver records to Loki (grafana). It supports the following configuration options: host Loki hostname or IP address port Loki TCP port tenant_id Tenant ID used by default to push logs to Loki. If omitted or empty it assumes Loki is running in single-tenant mode and no X-Scope-OrgID header is sent. > type: string labels labels for API requests. > default: job="fluent-bit", type: multiple comma delimited strings auto_kubernetes_labels If set to true, it will add all Kubernetes labels to Loki labels. > default: false, type: boolean label_keys Comma separated list of keys to use as stream labels. > type: multiple comma delimited strings One of the interesting features is that 'labels' and 'label_keys' support record accessor mode, e.g: [OUTPUT] name loki match * labels job=fluentbit, rec=$sub['field'] label_keys $somekey Note that 'label_keys' must be prefixed with '$' since it's a record accessor pattern. This plugin is still in development, community feedback is welcome. Signed-off-by: Eduardo Silva <[email protected]>
Describe the solution you'd like
Grafanalabs announced Loki log management system, it would be really nice to have output plugin in Fluentbit for it.
Describe alternatives you've considered
Loki comes with their own promtail log collector, nobody really needs yet another log collector.
Additional context
Loki API is dead simple and documented in https://github.com/grafana/loki/blob/master/docs/api.md
The text was updated successfully, but these errors were encountered: