sourcegraph/internal/codygateway
Robert Lin 99c4320ccd
feat/enterpriseportal: implement GetCodyGatewayUsage RPC (#63555)
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 https://github.com/sourcegraph/managed-services/pull/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>
2024-07-02 09:39:15 -07:00
..
codygatewayactor chore/codygatewayevents: extract into standalone package for reuse, split up internal/codygateway (#63528) 2024-06-28 12:03:16 -07:00
codygatewayevents feat/enterpriseportal: implement GetCodyGatewayUsage RPC (#63555) 2024-07-02 09:39:15 -07:00
BUILD.bazel chore/codygatewayevents: extract into standalone package for reuse, split up internal/codygateway (#63528) 2024-06-28 12:03:16 -07:00
client_test.go Enterprise instance uses gateway for attribution (#59513) 2024-01-16 10:16:32 +01:00
client.go Quickfix for attribution panics (#60465) 2024-02-13 12:51:50 +01:00
consts.go chore/codygatewayevents: extract into standalone package for reuse, split up internal/codygateway (#63528) 2024-06-28 12:03:16 -07:00
types.go chore/codygatewayevents: extract into standalone package for reuse, split up internal/codygateway (#63528) 2024-06-28 12:03:16 -07:00