-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(consumer): Add transactions consumer SLO #4442
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a9fd9e3
add transactions SLO
ayirr7 2cdce7d
pass received
ayirr7 1543898
fix received typing to datetime
ayirr7 d07d4f0
fix test
ayirr7 e542463
add received to test event
ayirr7 264e841
do try/except
ayirr7 182441f
fix typing
ayirr7 bf41325
except KeyError
ayirr7 5144969
add logging
ayirr7 842557c
fix try except
ayirr7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -24,6 +24,7 @@ | |||||
InsertBatch, | ||||||
ProcessedMessage, | ||||||
_as_dict_safe, | ||||||
_collapse_uint32, | ||||||
_ensure_valid_date, | ||||||
_ensure_valid_ip, | ||||||
_unicodify, | ||||||
|
@@ -141,6 +142,7 @@ def _process_base_event_values( | |||||
metrics.increment("group_ids_exceeded_limit") | ||||||
|
||||||
processed["group_ids"] = group_ids[:GROUP_IDS_LIMIT] | ||||||
|
||||||
return processed | ||||||
|
||||||
def _process_tags( | ||||||
|
@@ -472,4 +474,11 @@ def process_message( | |||||
# the following operation modifies the event_dict and is therefore *not* order-independent | ||||||
self._process_contexts_and_user(processed, event_dict) | ||||||
|
||||||
return InsertBatch([processed], None) | ||||||
try: | ||||||
raw_received = _collapse_uint32(int(event_dict["data"]["received"])) | ||||||
assert raw_received is not None | ||||||
received = datetime.utcfromtimestamp(raw_received) | ||||||
return InsertBatch([processed], received) | ||||||
except KeyError as err: | ||||||
logger.exception("Missing required field received in payload", err) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return InsertBatch([processed], None) |
This file contains 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
Oops, something went wrong.
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.
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.
If received is not there, won't you get an AssertionError that isn't being caught?
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.
Right, but wouldn't the first line (which throws KeyError) be thrown and caught first? So we go into the except clause?
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.
But I guess the AssertionError could be even easier, since it'd be guaranteed that it's being thrown at that line