Skip to content

Fix for timeout warning parameter for GCP integration & UTC time zone for AWS integration #799

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

Merged
merged 2 commits into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sentry_sdk/integrations/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def inner(*args, **kwargs):

def _make_request_event_processor(aws_event, aws_context, configured_timeout):
# type: (Any, Any, Any) -> EventProcessor
start_time = datetime.now()
start_time = datetime.utcnow()

def event_processor(event, hint, start_time=start_time):
# type: (Event, Hint, datetime) -> Optional[Event]
Expand Down Expand Up @@ -318,7 +318,7 @@ def _get_cloudwatch_logs_url(context, start_time):
Returns:
str -- AWS Console URL to logs.
"""
formatstring = "%Y-%m-%dT%H:%M:%S"
formatstring = "%Y-%m-%dT%H:%M:%SZ"

url = (
"https://console.aws.amazon.com/cloudwatch/home?region={region}"
Expand All @@ -329,7 +329,7 @@ def _get_cloudwatch_logs_url(context, start_time):
log_group=context.log_group_name,
log_stream=context.log_stream_name,
start_time=(start_time - timedelta(seconds=1)).strftime(formatstring),
end_time=(datetime.now() + timedelta(seconds=2)).strftime(formatstring),
end_time=(datetime.utcnow() + timedelta(seconds=2)).strftime(formatstring),
)

return url
4 changes: 4 additions & 0 deletions sentry_sdk/integrations/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ def sentry_func(*args, **kwargs):
class GcpIntegration(Integration):
identifier = "gcp"

def __init__(self, timeout_warning=False):
# type: (bool) -> None
self.timeout_warning = timeout_warning

@staticmethod
def setup_once():
# type: () -> None
Expand Down