Skip to content

Conversation

@erezrokah
Copy link
Member

Summary

Fixes #18443
Also needs cloudquery/plugin-pb-go#366 so the field isn't duplicated in JSON logs

@erezrokah erezrokah requested review from a team and bbernays and removed request for a team July 19, 2024 16:04
kodiakhq bot pushed a commit to cloudquery/plugin-pb-go that referenced this pull request Jul 19, 2024
#### Summary

Part of cloudquery/cloudquery#18443. Both CLI and plugins add the invocation ID field to the log.
When the CLI invokes plugins it streams their logs into its own log so it all shows up in the same file.
This happens here https://github.com/cloudquery/plugin-pb-go/blob/28fae3fab7dd225622fdea542ae67ee5649e8b8c/managedplugin/plugin.go#L480
We parse the log line as JSON, then log it with the CLI logger.
`zerolog` doesn't remove duplicate fields (see https://github.com/rs/zerolog?tab=readme-ov-file#field-duplication ) we need to remove the duplicate ourselves (similar to `level`).
Please note that the duplicates only show up when passing `--log-format json` as it seems the text format does remove duplicates (`zerolog` saves the message to be printed internally in JSON format so probably the conversion to text removes the duplicate somewhere, didn't both to check).

CLI PR in cloudquery/cloudquery#18641

---
@erezrokah erezrokah requested review from marianogappa and removed request for bbernays July 22, 2024 09:48
@erezrokah erezrokah added the automerge Automatically merge once required checks pass label Jul 22, 2024
@kodiakhq kodiakhq bot merged commit 7c51f70 into cloudquery:main Jul 22, 2024
kodiakhq bot pushed a commit that referenced this pull request Jul 22, 2024
🤖 I have created a release *beep* *boop*
---


## [6.0.1](cli-v6.0.0...cli-v6.0.1) (2024-07-22)


### Bug Fixes

* **deps:** Update module github.com/cloudquery/cloudquery-api-go to v1.12.3 ([#18613](#18613)) ([9f1ced6](9f1ced6))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.20.7 ([#18645](#18645)) ([91172f4](91172f4))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.49.4 ([#18616](#18616)) ([b818bfb](b818bfb))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.50.0 ([#18642](#18642)) ([703b60c](703b60c))
* Use `invocation_id` instead of `invocation-id` in the CLI logger ([#18641](#18641)) ([7c51f70](7c51f70))

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

bug: Duplicated invocationID in logs

3 participants