Skip to content

Conversation

@hermanschaaf
Copy link
Member

Similar to cloudquery/cloudquery#21675, this adds support for logging tenant id at the plugin level.

@hermanschaaf hermanschaaf requested a review from a team as a code owner December 1, 2025 16:07
@hermanschaaf hermanschaaf requested review from disq and stoovon and removed request for a team December 1, 2025 16:07
@hermanschaaf hermanschaaf changed the title feat: Support logging of tenant id feat: Support logging of tenant ID Dec 1, 2025
import "os"

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.

I suggest _CQ_TENANT_ID again.

c.logger.Info().Str("level", "unknown").Msg(string(line))
} else {
c.jsonToLog(pluginsLogger, structuredLogLine)
c.jsonToLog(pluginsLogger, structuredLogLine, []string{"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.

This would affect all logs in all plugins, not just when CQ_CLOUD is set.

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 3bc2d9e

@hermanschaaf hermanschaaf requested a review from disq December 1, 2025 16:29
@hermanschaaf hermanschaaf added the automerge Add to automerge PRs once requirements are met label Dec 1, 2025
@kodiakhq kodiakhq bot merged commit 4634b49 into main Dec 1, 2025
9 checks passed
@kodiakhq kodiakhq bot deleted the add-tenant-id-support branch December 1, 2025 16:39
kodiakhq bot pushed a commit that referenced this pull request Dec 1, 2025
🤖 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Add to automerge PRs once requirements are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants