feat: Log resource when exception occurs to aid debugging#172
Merged
kodiakhq[bot] merged 2 commits intomainfrom May 17, 2024
Merged
feat: Log resource when exception occurs to aid debugging#172kodiakhq[bot] merged 2 commits intomainfrom
kodiakhq[bot] merged 2 commits intomainfrom
Conversation
bbernays
reviewed
May 17, 2024
| "failed to resolve resource", | ||
| client_id=client.id(), | ||
| table=resolver.table.name, | ||
| resource=item, |
There was a problem hiding this comment.
Can't this leak sensitive information? Is that something we are alright with?
Member
Author
There was a problem hiding this comment.
I thought about this, and think the chances of this happening are low enough that we can accept the risk/reward trade-off for now. This will help plugin authors during development, and should be relatively rare in production.
I'm open to other suggestions. Maybe only log it in verbose mode?
Member
Author
There was a problem hiding this comment.
I think logging it only in debug mode is better, so I've updated it now, PTAL 🙇
bbernays
reviewed
May 17, 2024
Comment on lines
+119
to
+124
| self._logger.debug( | ||
| "details about resource that failed to resolve", | ||
| client_id=client.id(), | ||
| table=resolver.table.name, | ||
| resource=item, | ||
| ) |
There was a problem hiding this comment.
I think this is a better approach that balances user experience with security
bbernays
approved these changes
May 17, 2024
kodiakhq bot
pushed a commit
that referenced
this pull request
May 17, 2024
🤖 I have created a release *beep* *boop* --- ## [0.1.23](v0.1.22...v0.1.23) (2024-05-17) ### Features * Log resource when exception occurs to aid debugging ([#172](#172)) ([6403290](6403290)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change will allow plugin authors to see the resource that caused the exception, helping them find the underlying cause. To get this level of information,
--log-level debugneeds to be passed to the plugin server (or the CLI, depending on whether or not the plugin is run using the grpc registry)Closes cloudquery/cloudquery#18002