Skip to content

Commit 14c8a62

Browse files
authored
docs: use --hive-usage-* variants for the gateway usage reporting (#6612)
1 parent 86dd49b commit 14c8a62

File tree

3 files changed

+47
-26
lines changed

3 files changed

+47
-26
lines changed

packages/web/docs/src/content/api-reference/gateway-cli.mdx

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,27 @@ Usage: hive-gateway [options] [command]
2727
Federated GraphQL Gateway
2828
2929
Options:
30-
--fork <count> count of workers to spawn. uses "12" (available parallelism) workers when NODE_ENV is "production", otherwise "1" (the main) worker (default: 1 (env: FORK)
31-
-c, --config-path <path> path to the configuration file. defaults to the following files respectively in the current working directory: gateway.ts, gateway.mts, gateway.cts, gateway.js, gateway.mjs, gateway.cjs (env: CONFIG_PATH)
32-
-h, --host <hostname> host to use for serving (default: "0.0.0.0" (default: "0.0.0.0")
33-
-p, --port <number> port to use for serving (default: 4000 (env: PORT)
34-
--polling <duration> schema polling interval in human readable duration (default: "10s") (env: POLLING)
30+
--fork <count> count of workers to spawn. uses "24" (available parallelism) workers when NODE_ENV is "production",
31+
otherwise "1" (the main) worker (default: 1) (env: FORK)
32+
-c, --config-path <path> path to the configuration file. defaults to the following files respectively in the current working
33+
directory: gateway.ts, gateway.mts, gateway.cts, gateway.js, gateway.mjs, gateway.cjs (env:
34+
CONFIG_PATH)
35+
-h, --host <hostname> host to use for serving (default: 0.0.0.0)
36+
-p, --port <number> port to use for serving (default: 4000) (env: PORT)
37+
--polling <duration> schema polling interval in human readable duration (default: 10s) (env: POLLING)
3538
--no-masked-errors don't mask unexpected errors in responses
3639
--masked-errors mask unexpected errors in responses (default: true)
37-
--hive-registry-token <token> Hive registry token for usage metrics reporting (env: HIVE_REGISTRY_TOKEN)
38-
--hive-persisted-documents-endpoint <endpoint> [EXPERIMENTAL] Hive CDN endpoint for fetching the persisted documents. requires the "--hive-persisted-documents-token <token>" option
39-
--hive-persisted-documents-token <token> [EXPERIMENTAL] Hive persisted documents CDN endpoint token. requires the "--hive-persisted-documents-endpoint <endpoint>" option
40+
--hive-usage-target <target> Hive registry target to which the usage data should be reported to. requires the
41+
"--hive-usage-access-token <token>" option (env: HIVE_USAGE_TARGET)
42+
--hive-usage-access-token <token> Hive registry access token for usage metrics reporting. requires the "--hive-usage-target <target>"
43+
option (env: HIVE_USAGE_ACCESS_TOKEN)
44+
--hive-persisted-documents-endpoint <endpoint> [EXPERIMENTAL] Hive CDN endpoint for fetching the persisted documents. requires the
45+
"--hive-persisted-documents-token <token>" option
46+
--hive-persisted-documents-token <token> [EXPERIMENTAL] Hive persisted documents CDN endpoint token. requires the
47+
"--hive-persisted-documents-endpoint <endpoint>" option
4048
--hive-cdn-endpoint <endpoint> Hive CDN endpoint for fetching the schema (env: HIVE_CDN_ENDPOINT)
41-
--hive-cdn-key <key> Hive CDN API key for fetching the schema. implies that the "schemaPathOrUrl" argument is a url (env: HIVE_CDN_KEY)
49+
--hive-cdn-key <key> Hive CDN API key for fetching the schema. implies that the "schemaPathOrUrl" argument is a url (env:
50+
HIVE_CDN_KEY)
4251
--apollo-graph-ref <graphRef> Apollo graph ref of the managed federation graph (<YOUR_GRAPH_ID>@<VARIANT>) (env: APOLLO_GRAPH_REF)
4352
--apollo-key <apiKey> Apollo API key to use to authenticate with the managed federation up link (env: APOLLO_KEY)
4453
--disable-websockets Disable WebSockets support
@@ -47,9 +56,12 @@ Options:
4756
--help display help for command
4857
4958
Commands:
50-
supergraph [options] [schemaPathOrUrl] serve a Federation supergraph provided by a compliant composition tool such as Mesh Compose or Apollo Rover
51-
subgraph [schemaPathOrUrl] serve a Federation subgraph that can be used with any Federation compatible router like Apollo Router/Gateway
52-
proxy [options] [endpoint] serve a proxy to a GraphQL API and add additional features such as monitoring/tracing, caching, rate limiting, security, and more
59+
supergraph [options] [schemaPathOrUrl] serve a Federation supergraph provided by a compliant composition tool such as Mesh Compose or Apollo
60+
Rover
61+
subgraph [schemaPathOrUrl] serve a Federation subgraph that can be used with any Federation compatible router like Apollo
62+
Router/Gateway
63+
proxy [options] [endpoint] serve a proxy to a GraphQL API and add additional features such as monitoring/tracing, caching, rate
64+
limiting, security, and more
5365
help [command] display help for command
5466
5567
```

packages/web/docs/src/content/gateway/usage-reporting.mdx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ Before proceeding, make sure you have
2929
```sh filename="Run Hive Gateway with Usage Reporting enabled." {4}
3030
hive-gateway supergraph \
3131
http://cdn.graphql-hive.com/artifacts/v1/12713322-4f6a-459b-9d7c-8aa3cf039c2e/supergraph \
32-
--hive-cdn-key "YOUR HIVE CDN KEY" \
33-
--hive-registry-token "YOUR HIVE REGISTRY TOKEN"
32+
--hive-cdn-key "<hive_cdn_access_key>" \
33+
--hive-usage-target "<hive_usage_target>" \
34+
--hive-usage-access-token "<hive_usage_access_token>"
3435
```
3536

3637
</Tabs.Tab>
@@ -43,8 +44,9 @@ hive-gateway supergraph \
4344
docker run --rm --name hive-gateway -p 4000:4000 \
4445
ghcr.io/graphql-hive/gateway supergraph \
4546
http://cdn.graphql-hive.com/artifacts/v1/12713322-4f6a-459b-9d7c-8aa3cf039c2e/supergraph \
46-
--hive-cdn-key "YOUR HIVE CDN KEY" \
47-
--hive-registry-token "YOUR HIVE REGISTRY TOKEN"
47+
--hive-cdn-key "<hive_cdn_access_key>" \
48+
--hive-usage-target "<hive_usage_target>" \
49+
--hive-usage-access-token "<hive_usage_access_token>"
4850
```
4951

5052
</Tabs.Tab>
@@ -56,8 +58,9 @@ docker run --rm --name hive-gateway -p 4000:4000 \
5658
```sh filename="Run Hive Gateway with Usage Reporting enabled." {4}
5759
npx hive-gateway supergraph \
5860
http://cdn.graphql-hive.com/artifacts/v1/12713322-4f6a-459b-9d7c-8aa3cf039c2e/supergraph \
59-
--hive-cdn-key "YOUR HIVE CDN KEY" \
60-
--hive-registry-token "YOUR HIVE REGISTRY TOKEN"
61+
--hive-cdn-key "<hive_cdn_access_key>" \
62+
--hive-usage-target "<hive_usage_target>" \
63+
--hive-usage-access-token "<hive_usage_access_token>"
6164
```
6265

6366
</Tabs.Tab>
@@ -75,6 +78,8 @@ export const gatewayConfig = defineConfig({
7578
type: 'hive',
7679
// The registry token provided by Hive Registry
7780
token: '<token>'
81+
// The registry target which the usage data should be reported to
82+
target: '<target>'
7883
/**
7984
* Other options
8085
*

packages/web/docs/src/content/get-started/apollo-federation.mdx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,8 @@ guide, we can simply re-use the registry token we already use for the CLI.
609609
hive-gateway supergraph \
610610
"<hive_cdn_endpoint>" \
611611
--hive-cdn-key "<hive_cdn_access_key>" \
612-
--hive-registry-token "<hive_registry_token>"
612+
--hive-usage-target "<hive_usage_target>" \
613+
--hive-usage-access-token "<hive_usage_access_token>"
613614
```
614615

615616
| Parameter | Description |
@@ -632,7 +633,8 @@ docker run --name hive-gateway -rm \
632633
ghcr.io/graphql-hive/gateway supergraph \
633634
"<hive_cdn_endpoint>" \
634635
--hive-cdn-key "<hive_cdn_access_key>" \
635-
--hive-registry-token "<hive_registry_token>"
636+
--hive-usage-target "<hive_usage_target>" \
637+
--hive-usage-access-token "<hive_usage_access_token>"
636638
```
637639

638640
| Parameter | Description |
@@ -651,14 +653,16 @@ docker run --name hive-gateway -rm \
651653
npx hive-gateway supergraph \
652654
"<hive_cdn_endpoint>" \
653655
--hive-cdn-key "<hive_cdn_access_key>" \
654-
--hive-registry-token "<hive_registry_token>"
656+
--hive-usage-target "<hive_usage_target>" \
657+
--hive-usage-access-token "<hive_usage_access_token>"
655658
```
656659

657-
| Parameter | Description |
658-
| ----------------------- | ------------------------------------------- |
659-
| `<hive_cdn_endpoint>` | The endpoint of your Hive target |
660-
| `<hive_cdn_access_key>` | The Hive CDN access key |
661-
| `<hive_registry_token>` | The Hive registry token for usage reporting |
660+
| Parameter | Description |
661+
| --------------------------- | ---------------------------------------------------------------------- |
662+
| `<hive_cdn_endpoint>` | The endpoint of your Hive target |
663+
| `<hive_cdn_access_key>` | The Hive CDN access key |
664+
| `<hive_usage_target>` | The Hive registry target to which the usage data should be reported to |
665+
| `<hive_usage_access_token>` | The Hive registry token for usage reporting |
662666

663667
</Tabs.Tab>
664668

0 commit comments

Comments
 (0)