Skip to content

Conversation

@hermanschaaf
Copy link
Member

For deployments with multiple tenants syncing to a single log sync, this adds the possibility of having a tenant_id field in the logger.

@hermanschaaf hermanschaaf requested a review from a team as a code owner December 1, 2025 15:47
@hermanschaaf hermanschaaf requested a review from disq December 1, 2025 15:47
@cq-bot cq-bot added the area/cli label Dec 1, 2025
}

func TenantID() string {
return os.Getenv("CQ_TENANT_ID")
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why _CQ_TENANT_ID?

Copy link
Member Author

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

Copy link
Member

@disq disq Dec 1, 2025

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 _.

Copy link
Member Author

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

Copy link
Member

@disq disq left a 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.

@hermanschaaf
Copy link
Member Author

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

@hermanschaaf
Copy link
Member Author

I tested and found it to work as expected, I don't think we need to change filterPluginEnv

@hermanschaaf hermanschaaf added the automerge Automatically merge once required checks pass label Dec 1, 2025
kodiakhq bot pushed a commit to cloudquery/plugin-pb-go that referenced this pull request Dec 1, 2025
Similar to cloudquery/cloudquery#21675, this adds support for logging tenant id at the plugin level.
@kodiakhq kodiakhq bot merged commit 1c79d05 into main Dec 1, 2025
18 checks passed
@kodiakhq kodiakhq bot deleted the add-tenant-id branch December 1, 2025 16:51
kodiakhq bot pushed a commit that referenced this pull request Dec 2, 2025
🤖 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants