Skip to content

Instantly share code, notes, and snippets.

@lioneltchami
Created June 3, 2025 16:30
Show Gist options
  • Save lioneltchami/d17f7ab9d4134d290751f8211777915c to your computer and use it in GitHub Desktop.
Save lioneltchami/d17f7ab9d4134d290751f8211777915c to your computer and use it in GitHub Desktop.
🧼 Metric #5: Custom App-Level Latency (e.g., /health route) If your app emits latency metrics via CloudWatch Embedded Metric Format (EMF):
resource "awscc_applicationsignals_service_level_objective" "custom_app_latency" {
name = "custom-app-latency-slo"
description = "Track app-reported latency (e.g., /health or critical path)"
sli = {
comparison_operator = "LessThan"
metric_threshold = 200 # 200ms
sli_metric = {
metric_data_queries = [{
id = "customlatency"
metric_stat = {
metric = {
namespace = "MyApp/Performance"
metric_name = "HealthEndpointLatency"
dimensions = [
{
name = "Service"
value = "MyFargateService"
}
]
}
period = 300
stat = "p95"
}
}]
}
}
goal = {
attainment_goal = 99.5
interval = {
rolling_interval = {
duration = 7
duration_unit = "DAY"
}
}
}
burn_rate_configurations = [
{ look_back_window_minutes = 60 },
{ look_back_window_minutes = 1440 }
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment