Skip to content

Conversation

@erezrokah
Copy link
Member

@erezrokah erezrokah commented Jan 17, 2023

Summary

Fixes cloudquery/cloudquery#5665, by making this log message look less like an error.
I could go with Warn too and maybe update the level of the other errors here (but won't do it unless someone finds those confusing).

The current message can cause users to think that there is data loss or something wrong with the sync


Use the following steps to ensure your PR is ready to be reviewed

  • Read the contribution guidelines 🧑‍🎓
  • Run go fmt to format your code 🖊
  • Lint your changes via golangci-lint run 🚨 (install golangci-lint here)
  • Update or add tests 🧪
  • Ensure the status checks below are successful ✅

@github-actions github-actions bot added fix and removed fix labels Jan 17, 2023
@github-actions
Copy link

github-actions bot commented Jan 17, 2023

⏱️ Benchmark results

Comparing with 38b136b

  • DefaultConcurrencyDFS-2 resources/s: 11,933 ⬆️ 1.79% increase vs. 38b136b
  • DefaultConcurrencyRoundRobin-2 resources/s: 12,457 ⬆️ 1.10% increase vs. 38b136b
  • Glob-2 ns/op: 168.1 ⬆️ 13.27% increase vs. 38b136b
  • TablesWithChildrenDFS-2 resources/s: 30,783 ⬇️ 1.43% decrease vs. 38b136b
  • TablesWithChildrenRoundRobin-2 resources/s: 28,171 ⬆️ 8.07% increase vs. 38b136b
  • TablesWithRateLimitingDFS-2 resources/s: 28.35 ⬆️ 0.25% increase vs. 38b136b
  • TablesWithRateLimitingRoundRobin-2 resources/s: 825.9 ⬇️ 3.61% decrease vs. 38b136b
  • BufferedScanner-2 ns/op: 9.306 ⬆️ 0.21% increase vs. 38b136b
  • LogReader-2 ns/op: 31.18 ⬆️ 0.03% increase vs. 38b136b

Copy link
Contributor

@yevgenypats yevgenypats left a comment

Choose a reason for hiding this comment

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

Small nit on logs.

}
if errors.Is(err, errLogLineToLong) {
c.logger.Err(err).Str("line", string(line)).Msg("skipping too long log line")
c.logger.Info().Str("line", string(line)).Msg("truncated source plugin log line")
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if the word source plugin is needed. our logger has context so it is contexted with the source plugin name and all other properties.

Copy link
Member Author

Choose a reason for hiding this comment

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

This logging happens in the context of the CLI logger so module=cli.
It comes from https://github.com/cloudquery/cloudquery/blob/9f33362ebc9989ca0f6f74eac9e5700657a18116/cli/cmd/sync.go#L79

You might be referring to the plugin logger that is created here

p.logger = logger.With().Str("module", p.name+"-src").Logger()
from the serve command

@erezrokah erezrokah force-pushed the fix/change_too_long_line_error_message branch from 48f9b40 to e6de91d Compare January 18, 2023 10:27
@kodiakhq kodiakhq bot merged commit 0d3ff48 into cloudquery:main Jan 18, 2023
kodiakhq bot pushed a commit that referenced this pull request Jan 23, 2023
🤖 I have created a release *beep* *boop*
---


## [1.28.0](v1.27.0...v1.28.0) (2023-01-23)


### Features

* Add version discovery service ([#619](#619)) ([33ab32a](33ab32a))
* Dynamic tables and introduce proto versioning ([#610](#610)) ([448232c](448232c))


### Bug Fixes

* **clients:** Update `log line too long` message ([#611](#611)) ([0d3ff48](0d3ff48))
* Simplify client naming conventions ([#617](#617)) ([38b136b](38b136b))

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error="log line too long, discarding"

3 participants