-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Support logging of tenant ID #580
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
internal/env/env.go
Outdated
| import "os" | ||
|
|
||
| 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.
I suggest _CQ_TENANT_ID again.
managedplugin/plugin.go
Outdated
| c.logger.Info().Str("level", "unknown").Msg(string(line)) | ||
| } else { | ||
| c.jsonToLog(pluginsLogger, structuredLogLine) | ||
| c.jsonToLog(pluginsLogger, structuredLogLine, []string{"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.
This would affect all logs in all plugins, not just when CQ_CLOUD is set.
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.
True, I'll fix that
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.
Fixed in 3bc2d9e
🤖 I have created a release *beep* *boop* --- ## [1.27.0](v1.26.27...v1.27.0) (2025-12-01) ### Features * Support logging of tenant ID ([#580](#580)) ([4634b49](4634b49)) ### Bug Fixes * **deps:** Update module github.com/docker/docker to v28.5.2+incompatible ([#576](#576)) ([2794c32](2794c32)) * **deps:** Update module google.golang.org/grpc to v1.77.0 ([#575](#575)) ([bdbb9be](bdbb9be)) * Generate Go Code from `plugin-pb` ([#573](#573)) ([1ac0dfc](1ac0dfc)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Similar to cloudquery/cloudquery#21675, this adds support for logging tenant id at the plugin level.