liveBook · Manning

Aggregate metric

As explained in Designing AI Systems

An aggregate metric is a system-level measurement computed by summarizing observations across multiple events, requests, or components.

An aggregate metric summarizes numeric observations across many requests, events, or components over time. Counters and histograms expose system-wide patterns that an individual trace cannot: rising p99 latency, a sudden error-rate spike, or other trends across thousands of requests. section 7.2.3

Record metrics independently as requests flow through each service rather than deriving them from traces afterward. Store the resulting time series for dashboards and alerting, while using structured logs for event detail and distributed tracing for an individual request’s path. section 7.2.3 section 7.4

A production observability interface typically supports:

  • Recording metrics from platform services. section 7.3
  • Querying metrics for dashboards and operational analysis. section 7.3
  • Computing session-level views such as total cost or turn count by grouping traces through session identifiers. section 7.3

Operational trend detection

A trace can reveal unusually high latency for one request, but an aggregate metric can show p99 latency climbing for three hours or error rates spiking at 3 a.m. section 7.2.3

Listing 7.1 Observability Service gRPC definition
syntax = "proto3";
package ai.platform.observability.v1;
 
service ObservabilityService {
  rpc IngestLogs(IngestLogsRequest) 
➥returns (IngestLogsResponse);    #A
  rpc QueryLogs(QueryLogsRequest) returns 
➥(QueryLogsResponse);    #A
 
  rpc RecordMetrics(RecordMetricsRequest) 
➥returns (RecordMetricsResponse);    #B
  rpc QueryMetrics(QueryMetricsRequest) returns 
➥(QueryMetricsResponse);    #B
 
  rpc RecordSpan(RecordSpanRequest) returns 
➥(RecordSpanResponse);    #C
  rpc RecordGeneration(RecordGenerationRequest)
      returns (RecordGenerationResponse);    #D
  rpc GetTrace(GetTraceRequest) returns (Trace);    #E
  rpc QueryTraces(QueryTracesRequest) 
➥returns (QueryTracesResponse);    #E
 
  rpc RecordScore(RecordScoreRequest) 
➥returns (RecordScoreResponse);    #F
  rpc QueryScores(QueryScoresRequest) 
➥returns (QueryScoresResponse);    #F
 
  rpc GetCostReport(CostReportRequest) 
➥returns (CostReport);    #G
  rpc SetBudgetAlert(SetBudgetAlertRequest)
      returns (SetBudgetAlertResponse);    #G
  rpc GetBudgetStatus(GetBudgetStatusRequest) 
➥returns (BudgetStatus);    #G
 
  rpc GetServiceHealth(ServiceHealthRequest)
      returns (ServiceHealthResponse);    #H
}

The service definition shows the metric boundary explicitly: RecordMetrics ingests measurements and QueryMetrics retrieves them alongside separate logging and tracing operations. section 7.3

How Designing AI Systems covers it

How deep it goes
Explains time-series aggregation and telemetry boundaries, but stops short of metric schemas, aggregation algorithms, or storage implementation.
Examples
Uses p99 latency trends, error-rate spikes, session cost, and turn count as concrete aggregate views.
What you can do after
Operate/configure metric ingestion and querying through a gRPC observability service.
How it connects
Connects aggregate metrics with structured logging, distributed tracing, dashboards, alerting, sessions, and cost management.

Also explained in

Compare how 2 books explain aggregate metric →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Designing AI Systems. The section links point to the parts of the book it draws on.