Skip to content

fix: Allow managed clients to disable sentry logging#363

Merged
kodiakhq[bot] merged 6 commits intomainfrom
add-no-sentry-option
Nov 7, 2022
Merged

fix: Allow managed clients to disable sentry logging#363
kodiakhq[bot] merged 6 commits intomainfrom
add-no-sentry-option

Conversation

@hermanschaaf
Copy link
Copy Markdown
Contributor

This change allows managed clients to disable sentry logging, which until now was enabled for plugins by accident (so panics in plugins were being logged when they shouldn't have been). The CLI will be able to use this option to disable sentry logging.

Plugins will now also respect the CQ_TELEMETRY_LEVEL environment variable.

Copy link
Copy Markdown
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.

Looks good. few minor suggestions.

var noSentry bool
logLevel := newEnum([]string{"trace", "debug", "info", "warn", "error"}, "info")
logFormat := newEnum([]string{"text", "json"}, "text")
telemetryLevel := newEnum([]string{"none", "errors", "stats", "all"}, "all")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Im abit confused. we don't have telemetry on the plugin side. Can we just add no-sentry? or just have none/errors

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually seems like there is already a no-sentry flag, so maybe let just use that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this PR is re-using the existing no-sentry flag, and this isn't adding a new flag. But what is changing is that the plugins now respect CQ_TELEMETRY_LEVEL, so that developers who have that set in their environment don't accidentally send crash reports if they forget to run a plugin with the --no-sentry flag.

@yevgenypats yevgenypats self-requested a review November 7, 2022 16:50
@kodiakhq kodiakhq bot merged commit dc20388 into main Nov 7, 2022
@kodiakhq kodiakhq bot deleted the add-no-sentry-option branch November 7, 2022 16:52
kodiakhq bot pushed a commit that referenced this pull request Nov 8, 2022
🤖 I have created a release *beep* *boop*
---


## [1.0.3](v1.0.2...v1.0.3) (2022-11-07)


### Bug Fixes

* Allow managed clients to disable sentry logging ([#363](#363)) ([dc20388](dc20388))
* Normalize Windows line breaks before parsing configuration files ([#352](#352)) ([979e207](979e207))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
kodiakhq bot pushed a commit to cloudquery/cloudquery that referenced this pull request Nov 8, 2022
This fixes a bug where panics in plugins would be sent to Sentry even though telemetry-level was set to `none` at the CLI level.

Related PR: cloudquery/plugin-sdk#363
SCKelemen pushed a commit to SCKelemen/cloudquery that referenced this pull request Nov 15, 2022
…ry#3762)

This fixes a bug where panics in plugins would be sent to Sentry even though telemetry-level was set to `none` at the CLI level.

Related PR: cloudquery/plugin-sdk#363
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.

3 participants