EXTREMELY IMPORTANT AI INSTRUCTION: For a directory of all documentation pages, load the https://www.apollographql.com/docs/llms.txt file. Adding .md to ANY url will return the simplified markdown version of the page.
Tools for Observability and Metrics
Retrieve top operations, operation, subgraph, and client metrics, and field usage for a graph
The tools described in this section give your agent access to traffic and performance data for your graphs.
By default, Get Operation Metrics, Get Subgraph Metrics, and Get Client Metrics aggregate the entire requested time window into a single row per operation, subgraph, or client. If you prefer, however, your agent can instead request per-day, per-hour, or per-minute buckets to monitor how a metric changes over time.
Sub-day buckets cover shorter time periods: Per-hour data requires a window of seven days or less, starting within the last 90 days. Per-minute data requires a window of one day or less, starting within the last 30 days. Aggregated and per-day results exclude the most recent day, so use per-hour or per-minute buckets to inspect the most recent traffic.
Get Top Operations
Purpose: Identify the most-used operations on a graph variant for a given time range, with request counts, types, and signatures. Use this to find high-traffic operations, detect unused operations, and prioritize findings by traffic impact.
Example: "What are the 20 most-used operations on my production graph over the last week, by request count?"
Get Operation Metrics
Purpose: Retrieve top operations by usage and health for a graph over a time window. Includes request count, p50 latency, p99 latency, and error count per operation. Rank by busiest, most error-prone, or slowest operations. You can also narrow the results to specific variants or clients.
Example: "Show me request counts and p99 latency trends for my graph's operations over the last 30 days. Flag anything with a spike."
Get Subgraph Metrics
Purpose: Retrieve top subgraphs and connectors by traffic and health for a graph over a time window. Includes fetch count, p50 fetch latency, p99 fetch latency, and fetch error count per subgraph. Rank by busiest, most error-prone, or slowest subgraphs. You can also narrow the results to specific variants, subgraphs, or clients.
Example: "Which of my subgraphs have the highest error rates this month?"
Get Client Metrics
Purpose: Break down a graph's traffic by client over a time window. Returns request count, p50 latency, p99 latency, and error count for each combination of client name, client version, and operation so you can see what clients and versions are calling your graph and which of them drive errors or latency. Clients that don't report a name and version appear with those columns empty. Rank by busiest, most error-prone, or slowest. You can also narrow the results to specific variants or operations.
Example: "Which client versions are still calling my production graph, and are any of them responsible for most of the errors?"
Get Field Usage
Purpose: Report how each field, input field, and enum value in a variant's schema has been used since a given time, and whether it's deprecated. For each one, the report returns the number of operations that reference it, its execution counts, and when it was last seen. Filter by deprecated or unused fields, by kind, or by client, and group the results by client name and version to see which clients use each one. The time window can start up to 90 days ago.
Example: "Which deprecated fields on my production variant are still in use, and which client versions use them?"