-
Notifications
You must be signed in to change notification settings - Fork 544
feat: Add optional tenant ID field to logger #21675
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
Conversation
cli/internal/env/env.go
Outdated
| } | ||
|
|
||
| func TenantID() string { | ||
| return os.Getenv("CQ_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.
why not _CQ_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.
Why _CQ_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.
All other env vars we support right now start with CQ_, apart from some legacy ones that were previously used for Cloud
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.
Because it's an internal variable, not a user facing one. No user will ever have to configure this. Also all cloud-related env vars (apart from CQ_CLOUD, which "enables" the processing for these vars) start with _.
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.
Ok, I'll make it _CQ_TENANT_ID
disq
left a comment
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.
filterPluginEnv needs an update to pass this to plugins.
@disq I'll test, but I think it doesn't, because we're not expecting plugins to read this env variable, it's being read by the manager which is invoked from the CLI |
|
I tested and found it to work as expected, I don't think we need to change |
Similar to cloudquery/cloudquery#21675, this adds support for logging tenant id at the plugin level.
🤖 I have created a release *beep* *boop* --- ## [6.31.0](cli-v6.30.5...cli-v6.31.0) (2025-12-01) ### Features * Add optional tenant ID field to logger ([#21675](#21675)) ([1c79d05](1c79d05)) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.27.0 ([#21676](#21676)) ([7b917cc](7b917cc)) * **deps:** Update module golang.org/x/crypto to v0.45.0 [SECURITY] ([#21647](#21647)) ([d3f1ff8](d3f1ff8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
For deployments with multiple tenants syncing to a single log sync, this adds the possibility of having a
tenant_idfield in the logger.