Skip to content

Instantly share code, notes, and snippets.

@lioneltchami
Created June 3, 2025 16:22
Show Gist options
  • Save lioneltchami/76c6e2a745ef0feca5dec13efc1c3f13 to your computer and use it in GitHub Desktop.
Save lioneltchami/76c6e2a745ef0feca5dec13efc1c3f13 to your computer and use it in GitHub Desktop.
πŸ” Metric #2: Application Error Rate via X-Ray Traces. Use X-Ray segment annotations for a custom error rate metric (you would emit this yourself via PutMetricData):
resource "awscc_applicationsignals_service_level_objective" "app_error_rate" {
name = "app-error-rate-slo"
description = "Application error rate derived from X-Ray segments"
sli = {
comparison_operator = "LessThan"
metric_threshold = 1.0 # <1% errors
sli_metric = {
metric_data_queries = [{
id = "errorrate"
metric_stat = {
metric = {
namespace = "MyApp/XRay"
metric_name = "ErrorRate"
dimensions = [
{
name = "ServiceName"
value = "MyFargateService"
}
]
}
period = 300
stat = "Average"
}
}]
}
}
goal = {
attainment_goal = 99.0
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