You are viewing documentation for GraphOS Router v1.x

Switch to the latest version.

Router Instruments

Standard metric instruments for the router's request lifecycle


Standard metric instruments

GraphOS Router and Apollo Router Core provide a set of standard router instruments that expose detailed information about the router's request lifecycle. You can consume the metrics they capture by configuring a metrics exporter.

Standard router instruments are different than OpenTelemetry (OTel) instruments or custom instruments:

  • Router instruments provide standard metrics about the router request lifeycle and have names starting with apollo.router or apollo_router.

  • OTel instruments provide metrics about the HTTP lifecycle and have names starting with http.

  • Custom instruments provide customized metrics about the router request lifecycle.

The rest of this reference lists the available standard router instruments.

GraphQL

  • apollo.router.graphql_error - counts GraphQL errors in responses, attributes:

    • code: error code

Cache

  • apollo_router_cache_size — Number of entries in the cache

  • apollo_router_cache_hit_count - Number of cache hits

  • apollo_router_cache_miss_count - Number of cache misses

  • apollo_router_cache_hit_time - Time to hit the cache in seconds

  • apollo_router_cache_miss_time - Time to miss the cache in seconds

  • apollo.router.cache.storage.estimated_size - The estimated storage size of the cache in bytes (query planner in memory only).

All cache metrics listed above have the following attributes:

  • kind: the cache being queried (apq, query planner, introspection)

  • storage: The backend storage of the cache (memory, redis)

Coprocessor

  • apollo_router_operations_coprocessor_total - Total operations with coprocessors enabled.

  • apollo.router.operations.coprocessor.duration - Time spent waiting for the coprocessor to answer, in seconds.

The coprocessor operations metric has the following attributes:

  • coprocessor.stage: string (RouterRequest, RouterResponse, SubgraphRequest, SubgraphResponse)

  • coprocessor.succeeded: bool

Performance

  • apollo_router_processing_time - Time spent processing a request (outside of waiting for external or subgraph requests) in seconds.

  • apollo_router_schema_load_duration - Time spent loading the schema in seconds.

Query planning

  • apollo_router.query_planning.warmup.duration - Time spent warming up the query planner queries in seconds.

  • apollo.router.query_planning.plan.duration - Histogram of plan durations isolated to query planning time only.

  • apollo.router.query_planning.total.duration - Histogram of plan durations including queue time.

  • apollo.router.query_planning.queued - When the legacy planner is used, a gauge of the number of queued plans requests.

  • apollo.router.query_planning.plan.evaluated_plans - Histogram of the number of evaluated query plans.

  • apollo.router.v8.heap.used - heap memory used by V8, in bytes.

  • apollo.router.v8.heap.total - total heap allocated by V8, in bytes.

Compute jobs

  • apollo.router.compute_jobs.queued - A gauge of the number of jobs queued for the thread pool dedicated to CPU-heavy components like GraphQL parsing and validation, and the (new) query planner.

  • apollo_router_uplink_fetch_duration_seconds - Uplink request duration, attributes:

    • url: The Uplink URL that was polled

    • query: The query that the router sent to Uplink (SupergraphSdl or License)

    • kind: (new, unchanged, http_error, uplink_error)

    • code: The error code depending on type (if an error occurred)

    • error: The error message (if an error occurred)

  • apollo_router_uplink_fetch_count_total

    • status: (success, failure)

    • query: The query that the router sent to Uplink (SupergraphSdl or License)

note
The initial call to Uplink during router startup is not reflected in metrics.

Subscriptions

  • apollo_router_opened_subscriptions - Number of different opened subscriptions (not the number of clients with an opened subscriptions in case it's deduplicated)

  • apollo_router_deduplicated_subscriptions_total - Number of subscriptions that has been deduplicated

  • apollo_router_skipped_event_count - Number of subscription events that has been skipped because too many events have been received from the subgraph but not yet sent to the client.

Batching

  • apollo.router.operations.batching - A counter of the number of query batches received by the router.

  • apollo.router.operations.batching.size - A histogram tracking the number of queries contained within a query batch.

GraphOS Studio

  • apollo.router.telemetry.studio.reports - The number of reports submitted to GraphOS Studio by the router.

    • report.type: The type of report submitted: "traces" or "metrics"

    • report.protocol: Either "apollo" or "otlp", depending on the otlp_tracing_sampler configuration.

Telemetry

  • apollo.router.telemetry.batch_processor.errors - The number of errors encountered by exporter batch processors.

    • name: One of apollo-tracing, datadog-tracing, jaeger-collector, otlp-tracing, zipkin-tracing.

    • error = One of channel closed, channel full.

Internals

  • apollo.router.pipelines - The number of request pipelines active in the router

    • schema.id - The Apollo Studio schema hash associated with the pipeline.

    • launch.id - The Apollo Studio launch id associated with the pipeline (optional).

    • config.hash - The hash of the configuration

Server

  • apollo.router.open_connections - The number of open connections to the Router.

    • schema.id - The Apollo Studio schema hash associated with the pipeline.

    • launch.id - The Apollo Studio launch id associated with the pipeline (optional).

    • config.hash - The hash of the configuration.

    • server.address - The address that the router is listening on.

    • server.port - The port that the router is listening on if not a unix socket.

    • http.connection.state - Either active or terminating.

Deprecated

The following metrics have been deprecated and should not be used.

  • apollo_router_span - Deprecated: use apollo_router_processing_time instead.

  • apollo_router_deduplicated_subscriptions_total - Deprecated: use the apollo.router.operations.subscriptions metric's subscriptions.deduplicated attribute.

  • apollo_authentication_failure_count - Deprecated: use the apollo.router.operations.authentication.jwt metric's authentication.jwt.failed attribute.

  • apollo_authentication_success_count - Deprecated: use the apollo.router.operations.authentication.jwt metric instead. If the authentication.jwt.failed attribute is absent or false, the authentication succeeded.

  • apollo_require_authentication_failure_count - Deprecated: use the http.server.request.duration metric's http.response.status_code attribute. Requests with authentication failures have HTTP status code 401.

  • apollo_router_timeout - Deprecated: this metric conflates timed-out requests from client to the router, and requests from the router to subgraphs. Timed-out requests have HTTP status code 504. Use the http.response.status_code attribute on the http.server.request.duration metric to identify timed-out router requests, and the same attribute on the http.client.request.duration metric to identify timed-out subgraph requests.

  • apollo_router_session_count_active - Deprecated: Number of in-flight GraphQL requests. It is replaced by http.server.active_requests metric configured in instruments.

  • apollo_router_http_requests_total - Deprecated: Total number of HTTP requests by HTTP status. It is replaced by http.server.request.duration metric configured in instruments.

  • apollo_router_http_request_duration_seconds_bucket - Deprecated: HTTP router request duration. It is replaced by http.server.request.duration metric configured in instruments.

  • apollo_router_http_request_duration_seconds_bucket - Deprecated: HTTP subgraph request duration (replaced by http.client.request.duration metric configured in instruments), attributes:

    • subgraph: (Optional) The subgraph being queried

Feedback

Edit on GitHub

Forums