-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[usage] Add a UsageReportService to content-service
API
#11474
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Define an upload RPC to allow usage reports to be uploaded to the content service.
Regenerate gRPC code.
Create the service and register it when the content-service starts.
b27092f
to
ab7553c
Compare
This was referenced Jul 20, 2022
easyCZ
reviewed
Jul 21, 2022
For the later PRs, we should gzip the report either through upload transcoding, or in the service before we upload it. That should shrink the size to about a tenth |
started the job as gitpod-build-af-store-usage-reports-with-content-service.5 because the annotations in the pull request description changed |
easyCZ
reviewed
Jul 21, 2022
easyCZ
reviewed
Jul 21, 2022
Test that usageReportService.UploadURL interacts with PresignedAccess correctly to produce an upload URL for the correct bucket and filename.
It doesn't make sense for a request to generate an upload URL to return NotFound after we've already ensured the bucket exists.
easyCZ
approved these changes
Jul 21, 2022
geropl
approved these changes
Jul 22, 2022
Furisto
approved these changes
Jul 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
deployed: webapp
Meta team change is running in production
deployed: workspace
Workspace team change is running in production
deployed
Change is completely running in production
release-note-none
size/XXL
team: webapp
Issue belongs to the WebApp team
team: workspace
Issue belongs to the Workspace team
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As part of the move towards usage based pricing (#9036), we'd like for the usage aggregator (
components/usage
) to be able to upload its usage reports to cloud storage. This will provide an audit trail of usage reports, allowing us to cross reference usage entries in the database with the usage reports that provided the data. In future, we may also allow access to these reports to users directly.The usage component:
json
format) of all workspace instance credit consumption for all instances that have any runtime in the current billing period (one month).This PR creates a new
UsageReportService
gRPC service and registers it withcontent-service
. I've manually tested getting a presigned S3 URL from theGetUploadUrl
API and uploaded some content tominio
(in a preview environment) using the URL.Following PRs will make the usage component request this pre-signed upload URL from the
content-service
and upload usage reports to it.Related Issue(s)
Part of #9036
How to test
content-service
locally using theconfig.json
from thecontent-service
pod in the preview env (withminio.endpoint
set tolocalhost:9000
):evans
or another gRPC client to invoke theuploadUrl
RPC on the newUsageReportService
:PUT
request to the URL in the response to upload some content to the bucket.Release Notes
Werft options: