Skip to content
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

Adding datadog details to each lambda #36

Merged
merged 18 commits into from
Aug 14, 2023
Merged

Conversation

devinmatte
Copy link
Member

@devinmatte devinmatte commented Jul 21, 2023

Tried to get traces and logs from all data-ingestion lambdas into datadog so we can set monitors, and more easily link issues between runs. Also will ship logs to datadog so we can more easily discover broken lambdas

Sadly, there's a bug in how they handle chalice, so, this is going to only do a minimal piece for now

@devinmatte
Copy link
Member Author

devinmatte commented Jul 21, 2023

@mathcolo I'm having trouble getting DD_API_KEY or really anything from envvars.json to show up on the lambdas. Ideally I'd like these 3 new env vars to be on every single lambda created here but can't quite figure it out. Maybe you can help out?

Fixed in #41

@devinmatte devinmatte marked this pull request as ready for review August 1, 2023 14:36
@devinmatte devinmatte marked this pull request as draft August 2, 2023 14:31
@devinmatte
Copy link
Member Author

We may have found a bug in the datadog-chalice plugin 😅

@devinmatte devinmatte changed the title Adding datadog tracing and extention layer Adding datadog basic datadog monitoring and layer Aug 3, 2023
@devinmatte devinmatte marked this pull request as ready for review August 3, 2023 14:51
@devinmatte devinmatte requested a review from idreyn August 10, 2023 03:01
@devinmatte devinmatte changed the title Adding datadog basic datadog monitoring and layer Adding datadog details to each lambda Aug 10, 2023
@devinmatte
Copy link
Member Author

Okay this PR has gotten smaller as a result of bugs in how datadog reads chalice layers, so now it just adds tags and a version for tracking. But this should still ship useful data in the meantime

@@ -20,14 +20,16 @@
"iam_policy_file": "policy-newtrains.json"
},
"bb_store_station_status": {
"iam_policy_file": "policy-bluebikes-store.json"
"iam_policy_file": "policy-bluebikes-store.json",
"lambda_timeout": 90
Copy link
Member

Choose a reason for hiding this comment

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

Were these failing with default timeout?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep just slightly. Discovered it when trying to add tracing. They were hitting timeout every time

Copy link
Member

Choose a reason for hiding this comment

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

Is there data missing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't look like it in s3, but hard to tell until we start using this data somewhere

@@ -1,13 +1,21 @@
#!/bin/bash -x

if [[ -z "$MBTA_V2_API_KEY" ]]; then
echo "Must provide MBTA_V2_API_KEY in environment" 1>&2
if [[ -z "$MBTA_V2_API_KEY" || -z "$DD_API_KEY" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Do I need a DD_API_KEY to deploy locally now? Are there any docs/instructions we need to update?

Copy link
Member Author

Choose a reason for hiding this comment

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

Only for deployment. Probably need to update docs. You can use any DD_API_KEY from our account, anyone with the datadog account can get it easily in the UI

Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to store env vars across the lambdas? Or we have to apply to each function?

Copy link
Member Author

Choose a reason for hiding this comment

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

Best I could find was we need to do it per function. I couldn't find anything easier, I looked. Would love if we find something

@devinmatte devinmatte merged commit 5ad28ff into main Aug 14, 2023
1 check passed
@devinmatte devinmatte deleted the datadog-env-variables branch August 14, 2023 00:37
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