Skip to content

docs: update usage reporting docs for dynamic exclusions via VRL expressions#104

Open
Copilot wants to merge 11 commits intomainfrom
copilot/update-documentation-for-changes
Open

docs: update usage reporting docs for dynamic exclusions via VRL expressions#104
Copilot wants to merge 11 commits intomainfrom
copilot/update-documentation-for-changes

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

Documents the changes from graphql-hive/router#932, which adds dynamic exclusions to the exclude field in telemetry.hive.usage_reporting.

Copilot AI and others added 2 commits May 5, 2026 14:56
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Hive Router documentation to describe excluding operations from usage reporting, including a new dynamic exclusion mechanism via VRL expressions, and refreshes related telemetry/expression references.

Changes:

  • Added an “Excluding Operations” section to usage reporting docs, documenting both legacy operation-name lists and a VRL expression-based format.
  • Expanded the telemetry configuration reference to document the exclude field’s supported formats, with examples (operation name and header-based exclusions).
  • Updated the Expressions overview page to include usage-reporting exclusion as a documented use case.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/documentation/content/docs/router/observability/usage_reporting.mdx Adds a new section explaining how to exclude operations (legacy list vs VRL expression) with examples.
packages/documentation/content/docs/router/configuration/telemetry.mdx Updates the usage_reporting reference to describe/exemplify the new exclude formats.
packages/documentation/content/docs/router/configuration/expressions.mdx Adds a new bullet linking expressions to usage-reporting exclusions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

| `enabled` | `boolean` | `false` | Explicitly enable or disable usage reporting. |
| `endpoint` | `string` | `https://app.graphql-hive.com/usage` | Override for self-hosted Hive. |
| `sample_rate` | `string` | `100%` | Percentage between `0%` and `100%`. |
| `exclude` | `string[] \| { expression: string }` | - | Operations to exclude. Accepts a list of operation names or a VRL expression object. See details below. |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot addressed

Comment on lines +101 to +112
You can also exclude based on request headers — for example, checking a custom `x-graphql-client-name` header:

```yaml title="router.config.yaml"
telemetry:
hive:
usage_reporting:
enabled: true
exclude:
expression: '.request.headers."x-graphql-client-name" == "my-internal-tool"'
```

Expressions can use any fields available under `.request` (see [Expressions](/docs/router/configuration/expressions#request) for the full list of variables). For more examples, see [Excluding Operations](/docs/router/observability/usage_reporting#excluding-operations).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot addressed

Comment on lines +86 to +90
**Exclude traffic from a specific client identified via a request header:**

You can check any request header — for example, a custom `x-graphql-client-name` header sent by your clients:

```yaml title="router.config.yaml"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot addressed

@ardatan
Copy link
Copy Markdown
Member

ardatan commented May 5, 2026

@copilot apply changes based on the comments in this thread and fix lint errors

…metry/usage_reporting docs

Agent-Logs-Url: https://github.com/graphql-hive/docs/sessions/be1c26d6-1f65-4536-bd88-a13dd4ea6c54

Co-authored-by: ardatan <20847995+ardatan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 5, 2026

@copilot apply changes based on the comments in this thread and fix lint errors

Done in 10075ef. Applied all three reviewer suggestions:

  1. exclude Default: restored from - to [] to clearly indicate opt-in behavior.
  2. telemetry.mdx client_identification example: updated graphql-client-name/versionx-graphql-client-name/version.
  3. usage_reporting.mdx client_identification section: same header rename.

Also fixed the oxfmt lint failure — the Type column separator was 27 dashes but the string[] \| { expression: string } content is 36 chars, so all Type column cells have been re-padded to 36 chars.

Copilot finished work on behalf of ardatan May 5, 2026 16:10
Copilot AI requested a review from ardatan May 5, 2026 16:10
@ardatan
Copy link
Copy Markdown
Member

ardatan commented May 5, 2026

@copilot resolve the merge conflicts in this pull request

…n, add ip_header

Co-authored-by: ardatan <20847995+ardatan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 5, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in a432e08. The only conflict was in telemetry.mdx — main added ip_header: null # default to the client_identification YAML example while our branch renamed the headers. The resolution keeps both: x-graphql-client-name/version headers and the new ip_header: null # default line.

client_identification:
name_header: "graphql-client-name" # default value
version_header: "graphql-client-version" # default value
name_header: "x-graphql-client-name" # default value
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's graphql-client-name and not x-*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kamilkisiela fixed!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in efa69ad — reverted the header-based exclude example in telemetry.mdx from x-graphql-client-name back to graphql-client-name.

… exclude example

Agent-Logs-Url: https://github.com/graphql-hive/docs/sessions/261dd532-74f5-4d19-939b-eaf83497ca2b

Co-authored-by: ardatan <20847995+ardatan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants