Skip to Content

usage_reporting

The usage configuration object allows you to control over how the Hive Router does usage reporting to Hive Console.

Options

token

  • Type: string

Your Registry Access Token with write permission.

Alternatively, you can set the HIVE__USAGE_REPORTING__TOKEN environment variable to provide the token.

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.

Alternatively, you can set the HIVE__USAGE_REPORTING__TARGET_ID environment variable to provide the target ID.

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).

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.

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.

Last updated on