Guide · AWS Application Signals · Service Level Objectives
Service Level Objectives for MCP Servers with AWS Application Signals
A Service Level Objective (SLO) answers one question: is this operation meeting its reliability target? AWS Application Signals surfaces SLO attainment natively in CloudWatch, using the latency, error, and fault metrics collected by ADOT auto-instrumentation. For MCP server operators, SLOs translate vague reliability goals into measurable commitments: 99.9% of tool call responses should succeed within 2 seconds, over a 30-day rolling window. This guide covers defining SLOs with CreateServiceLevelObjectiveCommand, tracking error budgets, setting burn-rate alarms, and reading attainment reports.
TL;DR
Use CreateServiceLevelObjectiveCommand from @aws-sdk/client-application-signals to define SLOs on Application Signals service operations. Each SLO has an SLI (the metric and threshold defining "good"), a goal (target attainment percentage over a rolling window), and a warning threshold. Use BatchGetServiceLevelObjectiveBudgetReportCommand to read current error budget burn. Set CloudWatch alarms on the AWS/ApplicationSignals SLO attainment metrics to get paged when burn rate is too fast. This requires Application Signals to be enabled and emitting data for your MCP server first.
SLO concepts for MCP server operations
An SLO is a reliability target scoped to a specific service operation over a defined time window. The three components of every SLO are:
- Service Level Indicator (SLI) — the metric that measures whether a request was "good." For MCP servers, the most common SLIs are success rate (the fraction of
tools/callrequests that did not result in a 5xx fault) and latency (the fraction of requests that completed within a threshold like 2000ms). - Attainment goal — the target percentage of good requests. 99.9% means at most 1 in 1000 requests can be bad within the window.
- Window — the period over which attainment is measured. Application Signals supports 7-day, 14-day, or 30-day rolling windows, or calendar month intervals.
The error budget is the quantity of bad requests you are allowed before breaching the SLO. For a 99.9% SLO over 30 days with 1 million requests per month, your error budget is 1,000 requests. When the error budget is depleted, the SLO is in breach. When the budget burns down faster than expected, a burn-rate alarm fires.
For MCP servers, the most useful SLOs are:
- Success rate SLO — 99.9% of
tools/callrequests succeed (no 5xx faults). This is the primary reliability SLO. - Latency SLO — 95% of requests complete in under 2 seconds (a "good" request is defined as one with latency ≤ 2000ms). This catches gradual degradation before it becomes a hard error.
- Per-tool SLOs — if specific tools have distinct latency profiles (e.g., a "generate-document" tool has a 10-second budget vs a "search" tool at 500ms), define separate SLOs per operation.
Creating SLOs with the Application Signals API
The CreateServiceLevelObjectiveCommand takes a service identifier (key attributes), an SLI configuration, and a goal definition. For request-based SLIs — the most common type — you define the metric type (success rate or latency) and the threshold:
import {
ApplicationSignalsClient,
CreateServiceLevelObjectiveCommand
} from "@aws-sdk/client-application-signals";
const client = new ApplicationSignalsClient({ region: process.env.AWS_REGION });
// SLO 1: 99.9% success rate on all MCP tool calls
async function createSuccessRateSlo() {
const response = await client.send(new CreateServiceLevelObjectiveCommand({
Name: "mcp-server-tools-call-success-rate",
Description: "99.9% of tools/call requests must succeed (no 5xx faults) over 30 days",
SliConfig: {
SliMetricConfig: {
KeyAttributes: {
"Type": "Service",
"Name": "mcp-server",
"Environment": "production"
},
OperationName: "POST /mcp",
MetricType: "AVAILABILITY"
},
MetricThreshold: 99.9,
ComparisonOperator: "GreaterThanOrEqualTo"
},
Goal: {
Interval: {
RollingInterval: {
DurationUnit: "DAY",
Duration: 30
}
},
AttainmentGoal: 99.9,
WarningThreshold: 99.5
}
}));
console.log("Created SLO:", response.Slo?.Arn);
return response.Slo;
}
// SLO 2: 95% of requests complete under 2 seconds
async function createLatencySlo() {
const response = await client.send(new CreateServiceLevelObjectiveCommand({
Name: "mcp-server-latency-p95-2s",
Description: "95% of tool call requests must complete within 2000ms",
SliConfig: {
SliMetricConfig: {
KeyAttributes: {
"Type": "Service",
"Name": "mcp-server",
"Environment": "production"
},
OperationName: "POST /mcp",
MetricType: "LATENCY"
},
MetricThreshold: 2000, // milliseconds
ComparisonOperator: "LessThan"
},
Goal: {
Interval: {
RollingInterval: {
DurationUnit: "DAY",
Duration: 30
}
},
AttainmentGoal: 95.0,
WarningThreshold: 94.0
}
}));
return response.Slo;
}
The MetricType field controls how Application Signals computes "good requests." AVAILABILITY counts a request as good if it did not fault (no 5xx). LATENCY counts a request as good if its duration was below the MetricThreshold in milliseconds. The ComparisonOperator for AVAILABILITY is always GreaterThanOrEqualTo (attainment should be above the goal); for LATENCY it is LessThan (latency should be below the threshold).
The WarningThreshold in the goal is a secondary alert level — Application Signals surfaces a warning state when attainment drops below this value but has not yet reached breach. For a 99.9% goal with a 99.5% warning, you have early notice before the breach.
Reading SLO status and error budget
The BatchGetServiceLevelObjectiveBudgetReportCommand returns the current attainment and remaining error budget for one or more SLOs. Use this to build a reliability dashboard or health check endpoint for your MCP server:
import {
ApplicationSignalsClient,
BatchGetServiceLevelObjectiveBudgetReportCommand,
ListServiceLevelObjectivesCommand
} from "@aws-sdk/client-application-signals";
const client = new ApplicationSignalsClient({ region: process.env.AWS_REGION });
async function getMcpServerSloHealth() {
const now = new Date();
// 1. List all SLOs for the mcp-server service
const listResponse = await client.send(new ListServiceLevelObjectivesCommand({
KeyAttributes: {
"Type": "Service",
"Name": "mcp-server",
"Environment": "production"
}
}));
if (!listResponse.SloSummaries?.length) {
return { status: "no_slos_defined", slos: [] };
}
const sloIds = listResponse.SloSummaries.map(s => s.Id!);
// 2. Get budget report for all SLOs
const budgetResponse = await client.send(new BatchGetServiceLevelObjectiveBudgetReportCommand({
Timestamp: now,
SloIds: sloIds
}));
const reports = budgetResponse.Reports?.map(report => ({
name: report.Name,
arn: report.Arn,
attainment: report.Attainment,
totalRequestCount: report.TotalRequestCount,
missedRequestCount: report.MissedRequestCount,
remainingBudget: report.BudgetSecondsRemaining,
budgetStatus: report.BudgetStatus, // "OK" | "WARNING" | "BREACHED" | "INSUFFICIENT_DATA"
sloStatus: report.SloClassification // "BREACHED" | "NEARLY_BREACHED" | "ACHIEVED" | "INSUFFICIENT_DATA"
}));
const breached = reports?.filter(r => r.sloStatus === "BREACHED") ?? [];
const warning = reports?.filter(r => r.sloStatus === "NEARLY_BREACHED") ?? [];
return {
status: breached.length > 0 ? "breach" : warning.length > 0 ? "warning" : "ok",
breached: breached.map(r => r.name),
warning: warning.map(r => r.name),
slos: reports
};
}
// Use this in a /health endpoint or monitoring tool:
const health = await getMcpServerSloHealth();
console.log("SLO health:", health.status);
// { status: "ok", breached: [], warning: [], slos: [...] }
The BudgetSecondsRemaining field tells you how many seconds of remaining error budget you have in the current window. For a 30-day window, this is on the scale of hours to days — when it drops below, say, 24 hours (86400 seconds), you should stop risky deployments and investigate. The BudgetStatus and SloClassification fields give you the state machine summary without arithmetic.
Burn-rate alarms for fast error budget consumption
An SLO breach alert fires too late — by the time attainment drops below the goal, the error budget is already gone. Burn-rate alarms fire when error budget is burning faster than sustainable. The concept: if your 30-day budget is burning at 14× the normal rate, you will exhaust it in 2 days. Alert at 14× burn rate before that happens.
Application Signals does not create burn-rate alarms automatically. You create them manually using CloudWatch alarms on the SLO-related metrics. The metric AWSApplicationSignals/SLOs/AttainmentGoalBudgetConsumedPercent is not a standard Application Signals metric — instead, construct burn-rate alarms from the base metrics that the SLO is built on:
import { CloudWatchClient, PutMetricAlarmCommand } from "@aws-sdk/client-cloudwatch";
import { SNSClient, CreateTopicCommand } from "@aws-sdk/client-sns";
const cw = new CloudWatchClient({ region: process.env.AWS_REGION });
// Burn-rate alarm: alert if fault rate exceeds 1% over 5 minutes
// (1% fault rate = 10x burn rate on a 99.9% SLO)
async function createBurnRateAlarm(snsTopicArn: string) {
await cw.send(new PutMetricAlarmCommand({
AlarmName: "mcp-server-slo-burn-rate-fast",
AlarmDescription: "MCP server fault rate above 1% — error budget burning at 10x rate",
ComparisonOperator: "GreaterThanThreshold",
EvaluationPeriods: 2, // Must exceed threshold for 2 consecutive periods
Period: 300, // 5-minute evaluation window
Threshold: 10, // Fault count threshold
TreatMissingData: "notBreaching",
Metrics: [
{
Id: "faults",
MetricStat: {
Metric: {
Namespace: "AWS/ApplicationSignals",
MetricName: "Fault",
Dimensions: [
{ Name: "Service", Value: "mcp-server" },
{ Name: "Environment", Value: "production" },
{ Name: "Operation", Value: "POST /mcp" }
]
},
Period: 300,
Stat: "Sum"
}
},
{
Id: "total",
MetricStat: {
Metric: {
Namespace: "AWS/ApplicationSignals",
MetricName: "Latency",
Dimensions: [
{ Name: "Service", Value: "mcp-server" },
{ Name: "Environment", Value: "production" },
{ Name: "Operation", Value: "POST /mcp" }
]
},
Period: 300,
Stat: "SampleCount"
}
},
{
Id: "fault_rate",
Expression: "(faults / total) * 100",
Label: "FaultRatePercent"
}
],
AlarmActions: [snsTopicArn],
OKActions: [snsTopicArn]
}));
}
// Slow burn alarm: alert if fault rate exceeds 0.1% over 1 hour
// This catches gradual budget erosion that the fast alarm misses
async function createSlowBurnRateAlarm(snsTopicArn: string) {
await cw.send(new PutMetricAlarmCommand({
AlarmName: "mcp-server-slo-burn-rate-slow",
AlarmDescription: "MCP server fault rate above 0.1% over 1h — slow error budget burn",
ComparisonOperator: "GreaterThanThreshold",
EvaluationPeriods: 3,
Period: 1200, // 20-minute evaluation window
Threshold: 0.1,
TreatMissingData: "notBreaching",
Metrics: [
{
Id: "faults",
MetricStat: {
Metric: {
Namespace: "AWS/ApplicationSignals",
MetricName: "Fault",
Dimensions: [
{ Name: "Service", Value: "mcp-server" },
{ Name: "Environment", Value: "production" },
{ Name: "Operation", Value: "POST /mcp" }
]
},
Period: 1200,
Stat: "Sum"
}
},
{
Id: "total",
MetricStat: {
Metric: {
Namespace: "AWS/ApplicationSignals",
MetricName: "Latency",
Dimensions: [
{ Name: "Service", Value: "mcp-server" },
{ Name: "Environment", Value: "production" },
{ Name: "Operation", Value: "POST /mcp" }
]
},
Period: 1200,
Stat: "SampleCount"
}
},
{
Id: "fault_rate",
Expression: "(faults / total) * 100",
Label: "FaultRatePercent"
}
],
AlarmActions: [snsTopicArn],
OKActions: [snsTopicArn]
}));
}
The two-alarm pattern — a fast alarm (5-minute window, high threshold) and a slow alarm (1-hour window, low threshold) — covers both sudden incidents and gradual degradation. The fast alarm catches a deployment that starts throwing errors immediately; the slow alarm catches a memory leak or connection pool exhaustion that slowly increases error rate over hours.
Per-tool SLOs for heterogeneous workloads
Not all MCP tools have the same latency budget. A "search" tool that queries a DynamoDB index should complete in 200ms; a "generate-report" tool that calls a document rendering pipeline can take 30 seconds. A single SLO across all operations conflates these — a slow report generation should not pollute the success rate SLO for fast search operations.
The challenge with per-operation SLOs in Application Signals is that the ADOT auto-instrumentation groups all requests by their HTTP path. For MCP servers using a single POST /mcp endpoint (as the standard Streamable HTTP transport does), all tool calls arrive at the same path. Application Signals sees one operation, not one per tool name.
There are three approaches to get per-tool SLO tracking:
- Custom spans with operation override — Add a manual OpenTelemetry span for each tool call with a custom
aws.local.operationattribute. Application Signals uses this attribute to synthesize per-operation metrics:
import { trace, context } from "@opentelemetry/api";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
const server = new McpServer({ name: "mcp-server", version: "1.0.0" });
const tracer = trace.getTracer("mcp-server");
function withToolSpan(toolName: string, fn: () => Promise): Promise {
return tracer.startActiveSpan(toolName, (span) => {
// Application Signals uses aws.local.operation to group metrics
span.setAttributes({
"aws.local.operation": toolName,
"mcp.tool.name": toolName
});
return fn()
.then(result => { span.end(); return result; })
.catch(err => { span.recordException(err); span.setStatus({ code: 2 }); span.end(); throw err; });
});
}
server.tool("search", { query: z.string() }, async ({ query }) => {
return withToolSpan("search", async () => {
const results = await searchIndex(query);
return { content: [{ type: "text", text: JSON.stringify(results) }] };
});
});
server.tool("generate-report", { reportId: z.string() }, async ({ reportId }) => {
return withToolSpan("generate-report", async () => {
const report = await buildReport(reportId);
return { content: [{ type: "text", text: report }] };
});
});
Once custom spans are emitting with aws.local.operation set to the tool name, Application Signals surfaces them as separate operations in the service map. You can then create individual SLOs for "search" (200ms latency target, 99.9% success rate) and "generate-report" (30s latency target, 95% success rate) independently.
Programmatic SLO management and reporting
Use the Application Signals SDK to list, update, and delete SLOs as part of your deployment pipeline. This keeps SLO definitions in source control alongside your infrastructure code:
import {
ApplicationSignalsClient,
ListServiceLevelObjectivesCommand,
UpdateServiceLevelObjectiveCommand,
DeleteServiceLevelObjectiveCommand,
GetServiceLevelObjectiveCommand
} from "@aws-sdk/client-application-signals";
const client = new ApplicationSignalsClient({ region: process.env.AWS_REGION });
async function upsertSlo(name: string, config: {
operationName: string;
metricType: "AVAILABILITY" | "LATENCY";
threshold: number;
goalPercent: number;
warningPercent: number;
windowDays: 7 | 14 | 30;
}) {
// Check if SLO already exists
const existing = await client.send(new ListServiceLevelObjectivesCommand({
KeyAttributes: { "Type": "Service", "Name": "mcp-server", "Environment": "production" }
}));
const existingSlo = existing.SloSummaries?.find(s => s.Name === name);
const sloConfig = {
SliConfig: {
SliMetricConfig: {
KeyAttributes: { "Type": "Service", "Name": "mcp-server", "Environment": "production" },
OperationName: config.operationName,
MetricType: config.metricType
},
MetricThreshold: config.threshold,
ComparisonOperator: config.metricType === "AVAILABILITY"
? "GreaterThanOrEqualTo" as const
: "LessThan" as const
},
Goal: {
Interval: {
RollingInterval: { DurationUnit: "DAY" as const, Duration: config.windowDays }
},
AttainmentGoal: config.goalPercent,
WarningThreshold: config.warningPercent
}
};
if (existingSlo?.Id) {
await client.send(new UpdateServiceLevelObjectiveCommand({
Id: existingSlo.Id,
...sloConfig
}));
console.log(`Updated SLO: ${name}`);
} else {
await client.send(new CreateServiceLevelObjectiveCommand({
Name: name,
...sloConfig
}));
console.log(`Created SLO: ${name}`);
}
}
// Define SLOs in code — commit these alongside your infrastructure:
await upsertSlo("mcp-search-availability", {
operationName: "search",
metricType: "AVAILABILITY",
threshold: 99.9,
goalPercent: 99.9,
warningPercent: 99.5,
windowDays: 30
});
await upsertSlo("mcp-search-latency", {
operationName: "search",
metricType: "LATENCY",
threshold: 200,
goalPercent: 95,
warningPercent: 93,
windowDays: 7
});
Common SLO configuration mistakes and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| SLO shows "INSUFFICIENT_DATA" immediately after creation | No Application Signals metrics exist yet, or OperationName does not match a discovered operation | Use ListServiceOperationsCommand to get exact operation names from Application Signals before creating the SLO; operation names are case-sensitive and must match exactly what ADOT detected |
| SLO attainment always shows 100% despite known errors | MetricType set to LATENCY but errors that exceed latency are not counted, or ComparisonOperator inverted | For success rate tracking, use MetricType: "AVAILABILITY"; for latency, use LATENCY with ComparisonOperator: "LessThan" and MetricThreshold in milliseconds |
| Error budget depletes instantly at start of a new 30-day window | Carryover from prior period; rolling windows recalculate continuously — a brief spike at the window boundary is normal | Rolling windows always reflect the last N days, so a spike 29 days ago still counts. Consider a 7-day window for more responsive tracking; use calendar-month intervals if you want hard monthly resets |
CreateServiceLevelObjectiveCommand throws validation error on OperationName |
Service has not emitted any telemetry for that operation yet | Send traffic through the MCP server for at least 5 minutes before creating per-operation SLOs; Application Signals must discover the operation before you can reference it in an SLO |
| Burn-rate alarms fire constantly even when overall error rate is low | Low traffic volume causes small absolute fault counts to trigger high percentage thresholds | Add a minimum request count condition: use TreatMissingData: "notBreaching" and add a secondary alarm that suppresses the fault rate alarm when total request count is below a floor (e.g., 10 requests per period) |
Application Signals arc — related guides
This guide covers SLO creation, error budget tracking, and burn-rate alarm patterns for MCP servers. The arc also includes:
- AWS Application Signals overview — auto-instrumentation model, service topology, IAM permissions, and the core SDK APIs
- Application Signals for ECS Fargate MCP servers — ADOT sidecar container configuration, task definition environment variables, and ECS-specific IAM setup
- Application Signals for Lambda-based MCP servers — Lambda layer ARN, handler wrapping, and Lambda function URL patterns
SLOs track reliability over time, but they cannot replace uptime monitoring — a completely unreachable MCP server generates no metrics and no SLO data. AliveMCP provides active probe-based uptime monitoring that fires immediately when your server is unreachable, complementing your SLO tracking with real-time incident detection.