This repository was archived by the owner on Sep 30, 2024. It is now read-only.
feat/enterpriseportal: define GetCodyGatewayUsage RPC, use uint64 for rate limits#63531
Merged
feat/enterpriseportal: define GetCodyGatewayUsage RPC, use uint64 for rate limits#63531
Conversation
bobheadxi
referenced
this pull request
Jun 28, 2024
…plit up internal/codygateway (#63528) Allows us to directly reuse the Cody Gateway usage queries so that they can be served directly from Enterprise Portal (https://github.com/sourcegraph/sourcegraph/pull/63531). To enable this we also need to split up the monolithic `internal/codygateway` package so that not all roads lead back to `conf`: - `internal/codygateway`: Client mechanisms - `internal/codygateway/codygatewayevents`: Cody Gateway events service + related consts - `internal/codygateway/codygatewayactor`: Cody Gateway actor types Part of https://linear.app/sourcegraph/issue/CORE-201 ## Test plan n/a
bc3ad3c to
3dfb7af
Compare
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @bobheadxi and the rest of your teammates on |
jac
approved these changes
Jul 1, 2024
Member
There was a problem hiding this comment.
Should this be IDEMPOTENT or NO_SIDE_EFFECTS? 🤔
3dfb7af to
9ef8c09
Compare
Member
Author
Merge activity
|
bobheadxi
added a commit
that referenced
this pull request
Jul 2, 2024
Uses the refactors from #63528 and the new RPC proposed in #63531 to implement the existing GraphQL query for getting Cody Gateway usage stats using Enterprise Portal. Also adds some basic instrumentation on `codygatewayevents.Service`. Closes https://linear.app/sourcegraph/issue/CORE-201 Requires sourcegraph/managed-services#1685 ## Test plan Without setting any new vars: ```sh $ sg run enterprise-portal # ... [enterprise-...l] WARN service.codygatewayevents service/codygatewayevents.go:11 CodyGatewayEvents service is not configured ``` Add to `sg.config.overwrite.yaml`: ```yaml enterprise-portal: env: CODY_GATEWAY_EVENTS_PROJECT_ID: telligentsourcegraph ``` The client auths by default credentials, so if you have access to the dataset everything will "just work". Request S2 data by subscription ID at `:6081/debug/grpcui/`: <img width="1065" alt="Screenshot 2024-06-28 at 1 55 49 PM" src="https://github.com/sourcegraph/sourcegraph/assets/23356519/29549807-c3e1-4a2a-a6e6-a2414687f3bc"> --------- Co-authored-by: Erik Seliger <erikseliger@me.com>
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Part of https://linear.app/sourcegraph/issue/CORE-201. The RPC will be backed by https://github.com/sourcegraph/sourcegraph/pull/63528
The
uint64for ratelimits is a backwards-compatible change, per proto docs:Test plan
CI