-
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
out_loki: support new option tenant_id_key(#2935) #3260
Conversation
Signed-off-by: Takahiro Yamashita <nokute78@gmail.com>
This patch is draft. |
Remove draft status. Because |
The PR is ready to review. This is an example of the new property. Document example
|
please check the unit tests status |
@edsiper I re-run CI. There two error cases.
|
@edsiper Oops commit message regex is not updated by re-run... I tested using current pattern by hand and it reports ok. $ irb
irb(main):001:0> str = 'out_loki: support new option tenant_id_key(#2935)'
irb(main):002:0> str.match /^[a-z\-]+\:[ ]{0,1}[a-z]+[a-zA-Z0-9 \-\.\:]+$/
=> nil
irb(main):003:0> str.match /^[a-z0-9\-_]+\:[ ]{0,1}[a-z]+[a-zA-Z0-9 \-\.\:_\#\(\)]+$/
=> #<MatchData "out_loki: support new option tenant_id_key(#2935)">
|
I re-run CI and only Commit Message Check is failed. I tested it by hand using current regex and it reports ok. So, CI is all OK and we can merge it. |
@edsiper Ping. CI error should be recovered current master regex pattern. |
thanks |
Fixes #2935
This patch support new option
tenant_id_key
.The option allows record accessor for nested value.
Note:
If different values are sent to a loki plugin at once,
X-Scope-OrdID
will be set the value of last record.Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
Documentation
Example Cofiguration
Fluent-bit will send a dummy record which has
"tenant_id":"MyTenant"
.This configuration is to set
tenant_id_key
and fluent-bit will setMyTenant
as X-Scope-OrgID.a.conf:
Debug log
This testing log using nc to check
X-Scope-OrgID
.nc -l 3100
nc ouput is here. The point is
X-Scope-OrgID: MyTenant
Valgrind output
Launch loki using docker before testing.
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.