-
Notifications
You must be signed in to change notification settings - Fork 26
Add ability to provide fields to remove from Rollbar payload [CIRCLE-16074] #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor note; probably not worth worrying about but thought I'd ask anyway.
Other than that looks great; thanks!
src/circleci/rollcage/json.clj
Outdated
(json/generate-string item {:key-fn snake-case}) | ||
(catch JsonGenerationException _ | ||
(json/generate-string (postwalk backstop-encoder item) {:key-fn snake-case})))) | ||
[item block-fields] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a public function, maybe we should include an arity where block-fields
may be omitted so it can default to an empty list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move the filtering to the notify
function, and add an integration test, please?
To run the integration tests you need to grab a test token from Rollbar.com - ping me on Slack if you need help with that.
src/circleci/rollcage/core.clj
Outdated
:block-fields | ||
A list of fields to remove/scrub from the payload prior to sending to Rollbar | ||
using snake case keywords. The list will be automatically expanded into different |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make it clear what the input is expected to be, please? It looks like Kebab case keywords are expected.
src/circleci/rollcage/core.clj
Outdated
"Send a Rollbar item using the HTTP REST API. | ||
Return the result JSON parsed as a Map" | ||
[^String endpoint ^Throwable exception item] | ||
[block-fields ^String endpoint ^Throwable exception item] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The blocking of fields should happen higher up the callstack. I would put it into the notify
function.
We need to separate concerns so that we can test in isolation.
This function is the function that sends items over HTTP, and should not be concerned with the contents of an item. make-rollbar
returns an item in the shape expected by the Rollbar API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. LGTM
from Rollbar payload. This allows services to customize what PII information should not be logged to rollbar. Rename
2808ef0
to
d5c2b32
Compare
generated from commit 55b3cf5
This allows services to customize what PII information should not be logged to Rollbar.
This change is prompted by the following JIRA: https://circleci.atlassian.net/browse/CIRCLE-16074
Considerations: