-
Notifications
You must be signed in to change notification settings - Fork 123
docs(router): usage reporting #7171
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
Open
ardatan
wants to merge
8
commits into
main
Choose a base branch
from
doc-usage-reporting
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
763008e
docs(router): usage reporting
ardatan a240322
Apply suggestions
ardatan 807017c
Apply suggestion from @gemini-code-assist[bot]
ardatan e7ff0bd
Add dedicated section
ardatan 4f4e6b4
lets go
ardatan 92e6dd8
Better linking
ardatan 8e8ba88
Documentation
ardatan dae8080
Update
ardatan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
111 changes: 111 additions & 0 deletions
111
packages/web/docs/src/content/router/configuration/usage_reporting.mdx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| --- | ||
| title: 'usage' | ||
| --- | ||
|
|
||
| # usage_reporting | ||
|
|
||
| The `usage` configuration object allows you to control over how the Hive Router does | ||
ardatan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| [usage reporting](../../schema-registry/usage-reporting) to Hive Console. | ||
|
|
||
| ## Options | ||
|
|
||
| ### `token` | ||
|
|
||
| - **Type:** `string` | ||
|
|
||
| Your | ||
| [Registry Access Token](https://the-guild.dev/graphql/hive/docs/management/targets#registry-access-tokens) | ||
| with write permission. | ||
|
|
||
| Alternatively, you can set the `HIVE__USAGE_REPORTING__TOKEN` environment variable to provide the | ||
| token. | ||
ardatan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### `target_id` | ||
|
|
||
| - **Type:** `string` | ||
|
|
||
| A target ID, this can either be a slug following the format | ||
| “$organizationSlug/$projectSlug/$targetSlug” (e.g “the-guild/graphql-hive/staging”) or an UUID (e.g. | ||
| “a0f4c605-6541-4350-8cfe-b31f21a4bf80”). To be used when the token is configured with an | ||
| organization access token. | ||
ardatan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Alternatively, you can set the `HIVE__USAGE_REPORTING__TARGET_ID` environment variable to provide | ||
| the target ID. | ||
ardatan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### `endpoint` | ||
|
|
||
| - **Type:** `string` | ||
| - **Default:** `https://app.graphql-hive.com/usage` | ||
|
|
||
| For self-hosting, you can override `/usage` endpoint (defaults to | ||
| `https://app.graphql-hive.com/usage`). | ||
ardatan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
ardatan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### `sample_rate` | ||
|
|
||
| - **Type:** `number` | ||
| - **Default:** `1.0` | ||
|
|
||
| A value between `0.0` and `1.0` that indicates the percentage of requests to be reported. For | ||
| example, a value of `0.1` means that approximately 10% of requests will be reported, while a value | ||
| of `1.0` means that all requests will be reported. | ||
|
|
||
| ### `exclude` | ||
|
|
||
| - **Type:** `string[]` | ||
| - **Default:** `[]` | ||
|
|
||
| A list of operations (by name) to be ignored by Hive. For example, if you want to exclude | ||
| introspection queries, you can add `"IntrospectionQuery"` to this list. | ||
ardatan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### `client_name_header` | ||
|
|
||
| - **Type:** `string` | ||
| - **Default:** `graphql-client-name` | ||
|
|
||
| The name of the HTTP header from which to read the client name for usage reporting. This is useful | ||
| if you want to identify different clients consuming your GraphQL API. | ||
|
|
||
| ### `client_version_header` | ||
|
|
||
| - **Type:** `string` | ||
| - **Default:** `graphql-client-version` | ||
|
|
||
| The name of the HTTP header from which to read the client version for usage reporting. This is | ||
| useful if you want to identify different versions of clients consuming your GraphQL API. | ||
|
|
||
| ### `buffer_size` | ||
|
|
||
| - **Type:** `integer` | ||
| - **Default:** `1000` | ||
|
|
||
| A maximum number of operations to hold in a buffer before sending to Hive Console. When the buffer | ||
| reaches this size, it will be flushed and sent to Hive Console. | ||
|
|
||
| ### `accept_invalid_certs` | ||
|
|
||
| - **Type:** `boolean` | ||
| - **Default:** `false` | ||
|
|
||
| If set to `true`, the Hive Router will accept invalid SSL certificates when sending usage reports. | ||
| This can be useful for self-hosted Hive instances using self-signed certificates. | ||
|
|
||
| ### `connect_timeout` | ||
|
|
||
| - **Type:** `integer` | ||
| - **Default:** `5` | ||
|
|
||
| A timeout for only the connect phase of a request to Hive Console, in seconds. | ||
|
|
||
| ### `request_timeout` | ||
|
|
||
| - **Type:** `integer` | ||
| - **Default:** `15` | ||
|
|
||
| A timeout for the entire request to Hive Console, in seconds. | ||
|
|
||
| ### `flush_interval` | ||
|
|
||
| - **Type:** `integer` | ||
| - **Default:** `5` | ||
|
|
||
| The interval in seconds at which the usage report buffer is flushed and sent to Hive Console. | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.