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

[lambda] Add lambda flare subcommand #979

Merged
merged 28 commits into from
Jul 12, 2023
Merged

Conversation

nhulston
Copy link
Contributor

@nhulston nhulston commented Jul 12, 2023

What and why?

Add lambda flare command to automatically collect useful information from customers to help Datadog support resolve customer issues.

Screenshot 2023-07-12 at 4 08 19 PM Screenshot 2023-07-12 at 4 08 40 PM

How?

#924 Get and send AWS configuration for a single lambda function
#941 Collect CloudWatch logs and save in the logs folder
#947 Obfuscate secrets in AWS function configuration
#953 Ask for user confirmation before sending zip file to support
#954 Add human readable timestamp to CSV files for logs
#958 Refactor flag validation
#955 Get resource tags for the Lambda function and save in tags.json
#967 Build endpoint URL from Datadog site environment variables for lower latency when sending zip file:
#973 Don't require email or case ID as flags when running in dry mode
#960 Add optional start/end flags for CloudWatch logs. Only collect log events that fall inside that time range
#978 Update config obfuscation to use shared functions in commons.ts
#980 Remove unused constants
#981 Update site endpoints to append app. when no subdomain is included.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)

sfirrin and others added 27 commits June 2, 2023 11:12
…-initial

[lambda][flare] Add initial code for Lambda serverless flare
* Create and validate flare flags
* Write config to file and zip it
* - Send zip to Datadog when not in dry run
* Change zip method to use the `jszip` package for compatability on Windows, Mac, and Linux
* Add `jszip` copyright
* - Move constant endpoints
- Remove redundant try/catch on `fs.createReadStream` since the higher-level function `execute` handles the error
- Remove redundant `.then()` since we already use `await`
* Get CLI version programmatically and set as `operator_version`
* Rename `operator_version` to `datadog_ci_version`
* Code review refactoring
* Create thorough tests
* Create and validate flare flags
* Write config to file and zip it
* - Send zip to Datadog when not in dry run
* Change zip method to use the `jszip` package for compatability on Windows, Mac, and Linux
* Add `jszip` copyright
* - Move constant endpoints
- Remove redundant try/catch on `fs.createReadStream` since the higher-level function `execute` handles the error
- Remove redundant `.then()` since we already use `await`
* Get CLI version programmatically and set as `operator_version`
* Rename `operator_version` to `datadog_ci_version`
* Code review refactoring
* Create thorough tests
Add `--with-logs` flag, which gets logs from the last 3 AWS CloudWatch Streams
Add human readable timestamp as a column in the CSV file
Get resource tags and save in `tags.json`
Use `DATADOG_SITE` and `DD_SITE` environment variables to build endpoint URL
@duncanista duncanista changed the title Add lambda flare command [lambda] Add lambda flare subcommand Jul 12, 2023
@nhulston nhulston marked this pull request as ready for review July 12, 2023 20:57
@nhulston nhulston requested review from a team as code owners July 12, 2023 20:57
@datadog-datadog-prod-us1
Copy link

Datadog Report

Branch report: add-lambda-flare-command
Commit report: 1da3ea4

datadog-ci-tests: 0 Failed, 0 New Flaky, 873 Passed, 0 Skipped, 19.66s Wall Time

Copy link
Contributor

@duncanista duncanista left a comment

Choose a reason for hiding this comment

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

Approving directly.

All previous reviews are combined into this PR.

@duncanista duncanista merged commit eefa71a into master Jul 12, 2023
20 checks passed
@duncanista duncanista deleted the add-lambda-flare-command branch July 12, 2023 21:00
This was referenced Jul 12, 2023
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.

3 participants