Comments (2)
Why you used fluentbit not promtail to send data to Loki, I think promtail will good to use when with Loki
from fluent-bit.
@YevhenLodovyi, are your log entries separated into different chunks, e. g. by making sure that they get re-emitted with a tag that contains the actual value of the tenant_id? Have a look at #2935 (comment), that describes the issue quite well. It would be helpful if you provided the lua script and the rest of the fluent-bit config.
If your chunks are well aligned:
We are possibly encountering the same issue, where a race condition seems to be involved. I guess it was introduced (or at least not fixed) by PR #6931 where dynamic_tenant_id
gets shared within the thread. I guess due to usage of coroutines, the value changes between loki_compose_payload and flb_http_add_header.
But I have to admit that I don't see a context switch in between. Maybe @leonardo-albertovich could shed some light on it?
Though we are quite sure that the value changes in between, as we captured the traffic using tcpdump and the chunks are well aligned and contain log messages from (in our case) distinct namespaces only, but are tagged with the wrong X-Scope-OrgID header.
We have configured Tenant_id_key
to customer
and the request looks like this:
POST /loki/api/v1/push HTTP/1.1
Host: loki-gateway.logging.svc:80
Content-Length: 944
User-Agent: Fluent-Bit
Content-Type: application/json
X-Scope-OrgID: customer1
Connection: keep-alive
{"streams":[{"stream":{"job":"fluent-bit","node":"worker11","namespace":"customer2-namespace"},"values":[["1715604287815933056","{\"stream\":\"stdout\",\"logtag\":\"F\",\"message\":\"INFO trace_generator_slow - generate_slow_traces - SlowOperation created in customer2-namespace - Trace ID: 95f6274c96752cf944547abda39e24b1, Span ID: 5eaddc539554b1ec - 13/05/2024 Monday 12:44:47\",\"namespace_name\":\"customer2-namespace\",\"host\":\"worker11\",\"kubernetes\":{\"pod_name\":\"trace-generator-slow-job-swzcs\",\"namespace_name\":\"customer2-namespace\",\"container_name\":\"trace-generator-slow\",\"labels\":{\"batch.kubernetes.io/controller-uid\":\"f935d0ea-6e29-4be8-a379-0126cb2d2b8d\",\"batch.kubernetes.io/job-name\":\"trace-generator-slow-job\",\"controller-uid\":\"f935d0ea-6e29-4be8-a379-0126cb2d2b8d\",\"job-name\":\"trace-generator-slow-job\"}},\"customer\":\"customer2\",\"cluster\":\"cluster-name\"}"]]}]}
If this is a separate topic, I'll file an additional issue.
Update: We recompiled fluent-bit with FLB_OUTPUT_SYNCHRONOUS
flag set in out_loki.c. The issue still persists. Either the cause is something else, or we misinterpreted the meaning of the flag.
from fluent-bit.
Related Issues (20)
- readOnlyFilesystem not supported by init image
- in_winevtlog: StringInserts field not present in resulting logs by default HOT 1
- CVE-2023-45853 listed as CRITICAL vulnerability on fluent-bit 3.0.4 HOT 1
- fluent-bit 3.0.3+ fails to build with -Wincompatible-pointer-types and -Wpointer-sign HOT 6
- Fluent-bit 3.0.4 throwing repeated warnings ( [ warn] [record accessor] translation failed, root key=hec_token) HOT 10
- out_http: don't retry non retryable 4xx status codes
- Multiple nestings under the same key lead to duplicate maps HOT 1
- Fluentbit 3.0 Opentelemetry does not process records correctly
- 3.0.5: output:splunk: Error http_status=401 Token is required HOT 8
- Prometheus metrics "fluentbit_output_upstream_busy_connections" shows negative value during connection timed out HOT 3
- `Logstash_Prefix_Key` not working (any more?) in Fluent Bit 3.x
- Support for linux on IBM Power platform (ppc64le) HOT 3
- Fluentbit multiline parsing is not working as intended HOT 3
- Unable to STS assume Role in fluentbit/S3 plugin HOT 2
- Store the logs in log-storage & GCS storage through fluentbit HOT 1
- Could the `Elasticsearch OUTPUT` Index configuration support dynamic index name (use record accessor) ? HOT 5
- Release 2.2.3 link is broken https://fluentbit.io/announcements/v2.2.3/ HOT 2
- HTTP requests should have an `User-Agent` header HOT 1
- Fluentbit AWS S3 output replaces %2F as Date
- Tracing documentation samples fail for the latest fluent bit release HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluent-bit.