-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
promtail: add multi-tenant support #1135
promtail: add multi-tenant support #1135
Conversation
0cf4393
to
b64515f
Compare
b64515f
to
1134b22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we find support for multiple tenants without tenant-specific authentication a valid use case, this certainly looks like it would work.
- template: | ||
source: tenant_id | ||
template: 'team-api' | ||
- tenant: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is convoluted example with constant tenant ID. If that is a useful use case, maybe tenant stage can support it directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This originates from a comment made by @cyriltovena, where he was suggesting to add this example too (at least this is what I understood). Cyril, is this example what you meant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes because I think that's mainly how it will be used. I don't think someone has a tenant id in its log, or at least this is not the most common.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the tenant stage support also a const tenant ID ? I think that's a valid use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not, but it can. What do you think if we add a value
field, which is mutually exclusive with source
? For example:
# Here the value is hardcoded
- tenant:
value: team-api
# Here the value is picked from tenant_id field
- tenant:
source: tenant_id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cyriltovena Done! What's your take?
1134b22
to
9336bf2
Compare
Thanks @pstibrany for your feedback. I've addressed 2 out of 3 comments. May you check it out again, please? |
Works for me
Le mar. 5 nov. 2019 à 12:49, Marco Pracucci <notifications@github.com> a
écrit :
… ***@***.**** commented on this pull request.
------------------------------
In docs/clients/promtail/stages/tenant.md
<#1135 (comment)>:
> +
+```yaml
+pipeline_stages:
+ - json:
+ expressions:
+ app:
+ message:
+ - labels:
+ app:
+ - match:
+ selector: '{app="api"}'
+ stages:
+ - template:
+ source: tenant_id
+ template: 'team-api'
+ - tenant:
It does not, but it can. What do you think if we add a value field, which
is mutually exclusive with source? For example:
# Here the value is hardcoded
- tenant:
value: team-api
# Here the value is picked from tenant_id field
- tenant:
source: tenant_id
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1135?email_source=notifications&email_token=AAIBF3PFHXZWEMOOH3VR2RTQSGWZPA5CNFSM4I65PT32YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCKLXONA#discussion_r342703617>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIBF3IEUBXCYERS6OVNECTQSGWZPANCNFSM4I65PT3Q>
.
|
9336bf2
to
34e55d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I don't think we need a new file for a single constant that's a nitpick.
Nice! 🎉 |
What this PR does / why we need it:
Promtail currently doesn't allow to specify the tenant / org ID. In this PR I've introduced three main changes:
tenant_id
support to promtail client configtenant
stage to easily override the tenant IDWhich issue(s) this PR fixes:
Special notes for your reviewer:
logcli
tenant selection support is missing (if this PR will be eventually accepted, I will submit a subsequent PR forlogcli
)Checklist