Skip to content

Latest commit

 

History

History
72 lines (52 loc) · 3.85 KB

spaceport.mdx

File metadata and controls

72 lines (52 loc) · 3.85 KB
title description
Apollo Router usage reporting
Send usage data to Apollo Studio

The Apollo Router can transmit usage data to Apollo Studio via a reporting agent called spaceport. By default, spaceport runs automatically as a component within the Apollo Router. Additional details on its modes of operation are provided below.

Note: As with the rest of the Apollo Router, spaceport is in active development. Its behavior and functionality might change before general availability release. We welcome user feedback both during and after this preview period.

Enabling usage reporting

You can enable usage reporting in the Apollo Router by setting the following environment variables:

APOLLO_KEY=<YOUR_GRAPH_API_KEY>
APOLLO_GRAPH_REF=<YOUR_GRAPH_ID>@<VARIANT>

More information on usage reporting is available in the Studio documentation.

Advanced configuration

Spaceport can run either as an internal component of a single Apollo Router instance, or as an external resource shared by multiple router instances.

telemetry:
  # Spaceport configuration. These values are the default values if not specified
  spaceport:
    # By default, Apollo Router runs an internal collector. You can override
    # this default behavior by setting `external: true`. If `true`, no reporting
    # agent spawns, and the router instead communicates with `collector` below.
    external: false

Internal spaceport (recommended)

By default, spaceport runs within a single Apollo Router instance. It requires no additional configuration beyond the setup in Enabling usage reporting.

You can optionally configure which address the internal spaceport listens on by setting the listener property. This should only be necessary if there's a conflict on the default port that Router chooses (e.g., if running multiple routers or other applications using the same port on the same host), or if it's desirable to change the bind address.

telemetry:
  # Spaceport configuration. These values are the default values if not specified
  spaceport:
    # If `external` is `false`, this is the interface and port to listen on.
    # Omit otherwise.
    listener: 127.0.0.1:50051

External spaceport (advanced)

Running an external spaceport is not necessary in most cases. However, it might be desirable in certain production environments where configuration of sensitive key data or allocation of reporting resources needs to be operated centrally. Under heavier workloads, it can also be beneficial to externalize trace processing to reduce the amount of work that individiual router instances perform.

To enable the external spaceport, you run an additional Router instance with the exclusive role of collecting and processing Studio data. To configure this, the "collector" should set external to false and an appropriate listener address and port combination.

Router instances besides the "collector" should set external to true, omit listener, and configure the collector property to point to the collector router.

For help with this feature, please open a discussion.

telemetry:
  # Spaceport configuration. These values are the default values if not specified
  spaceport:
    # By default, Apollo Router runs an internal collector. You can override
    # this default behavior by setting `external: true`. If `true`, no reporting
    # agent spawns, and the router instead communicates with `collector` below.
    external: true

    # If `external` is `true`, this should be the location of a spaceport
    # that's running external from the Router. Omit otherwise.
    collector: https://127.0.0.1:50051