-
Notifications
You must be signed in to change notification settings - Fork 14
CLOUDP-290414: [Product Metrics/Observability] Set up Data Warehouse connection for exporting metrics #374
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
Conversation
…connection for exporting metrics
credentials: { | ||
accessKeyId: AWSConfig.aws.accessKeyId, | ||
secretAccessKey: AWSConfig.aws.secretAccessKey, | ||
}, | ||
region: AWSConfig.aws.region, |
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.
we should not use API keys anymore,
we've migrated other work to use assume role - example (https://github.com/mongodb/openapi/pull/329/files)
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 the owner team for the bucket can't provide this approach, I'm happy to approve if we have a ticket capturing this migration
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.
Let me check with them and update here accordingly 👍
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.
I checked with them, and they confirmed they’ll add the trust policy on their end and share it with us. Would it be okay if I create a ticket to update the credentials in the code once we have role-to-assume ARN
and update the GitHub secrets accordingly?
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.
Ticket link: https://jira.mongodb.org/browse/CLOUDP-295480
* Upload a file to an S3 bucket. | ||
* @param filePath | ||
*/ | ||
async function uploadMetricCollectionDataToS3(filePath = config.defaultMetricCollectionResultsFilePath) { |
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.
[q] will we have tests added as a separate PR?
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.
Are you asking if we will have integration tests to check whether the file is uploaded correctly to the S3 bucket?
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 now, we don’t have programmatic Read or Delete access, so we can’t verify the file once it’s written or delete it from the bucket. I’ll go ahead and create a ticket for future improvement so we can add these tests once we have the access.
Proposed changes
Jira ticket: CLOUDP-290414
This PR implements the data dump of the provided or default metric collection results file to S3 with given env variables.
The env variables will be provided by the GitHub Actions file, however, the script also allows a local .env file for local testing purposes if there are no env variables defined before code execution.
Testing
First data dump is made by running
dataDump.js
file with.env
file filled with credentialsChecklist
Changes to Spectral
Further comments
Differences from the ticket description: