Skip to content

feat: add cloudwatch logs URL to lambda additional data #618

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 3 commits into from
Feb 14, 2020

Conversation

flyinbutrs
Copy link
Contributor

As discussed on discord, this adds an additional "extra" for cloudwatch logs URL, log group, and log stream.

image

Not sure what if any tests are required for this change. Thoughts?

Copy link
Member

@untitaker untitaker left a comment

Choose a reason for hiding this comment

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

lgtm! two smaller changes though

"""
start_time_str = (start_time - timedelta(seconds=1)).isoformat().split(".")[0]
end_time_str = (datetime.now() + timedelta(seconds=2)).isoformat().split(".")[0]
url = ''.join([
Copy link
Member

Choose a reason for hiding this comment

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

Instead of this please do

url = (
    "string 1"
    "string 2"
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That syntax will only work with quoted strings, half of these are variables/functions. I can do a multiline string with .format at the end, is that what you want?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(fixed)

Copy link
Member

Choose a reason for hiding this comment

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

yeah sorry I didn't even think about that. .format is good

Returns:
str -- AWS Console URL to logs.
"""
start_time_str = (start_time - timedelta(seconds=1)).isoformat().split(".")[0]
Copy link
Member

Choose a reason for hiding this comment

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

would prefer a strftime with explicit args here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, why? Happy to do it, just curious. could also do this:

.replace(microsecond=0).isoformat() if you object to the .split('.')[0]

Copy link
Member

Choose a reason for hiding this comment

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

just personal preference

@untitaker
Copy link
Member

untitaker commented Feb 12, 2020

oh yeah please also add tests for this and ensure linting passes

@flyinbutrs flyinbutrs force-pushed the feature/cloudwatch-logs branch from 4ace295 to a1f2ed2 Compare February 13, 2020 19:22
@untitaker untitaker merged commit 47f4a7a into getsentry:master Feb 14, 2020
@untitaker
Copy link
Member

Awesome, thanks!

@flyinbutrs
Copy link
Contributor Author

Oh, uh... sorry, wasn't done. I just pushed up the tests.

@untitaker
Copy link
Member

Damn, sorry. Could you PR those separately?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants