Skip to content

EKS demo: create-slo.sh fails, as no services available to cloudwatch  #65

@str3tch

Description

@str3tch

This is using the EKS demo version of the repo.

The setup fails at at the create-slo.sh stage.

The reason it fails is because there are no services available for the list-services command to list:

++ aws application-signals list-services --endpoint https://application-signals.ap-southeast-1.api.aws --region ap-southeast-1 --cli-input-json '{
  "StartTime": 1729037340,
  "EndTime": 1729123740
}' --output json --query '(ServiceSummaries[?KeyAttributes.Name=='\''pet-clinic-frontend-java'\''].KeyAttributes)[0]'
+ SERVICE_KEY_ATTRIBUTES=null
+ echo null
null

Here is the full output of the script.

Admin:~/environment/application-signals-demo/scripts/eks/appsignals/one-step (main) $ ../create-slo.sh unicorn-pet-rentals ap-southeast-1
++ dirname ../create-slo.sh
+ cd ..
+ CLUSTER_NAME=unicorn-pet-rentals
+ REGION=ap-southeast-1
+ SERVICE_NAME=pet-clinic-frontend-java
+ ENDPOINT=https://application-signals.ap-southeast-1.api.aws
+ echo 'Creating Service Level Objectives'
Creating Service Level Objectives
++ date +%s
+ end_time=1729123740
+ end_time_as_int=1729123740
+ start_time_as_int=1729037340
+ LIST_SERVICES_REQUEST=slo/inputRequest/ListServices/listServices.json
++ sed -e 's|"StartTime": .*|"StartTime": 1729037340,|' -e 's|"EndTime": .*|"EndTime": 1729123740|' slo/inputRequest/ListServices/listServices.json
+ LIST_SERVICES_REQUEST_WITH_CORRECT_INPUT='{
  "StartTime": 1729037340,
  "EndTime": 1729123740
}'
++ aws application-signals list-services --endpoint https://application-signals.ap-southeast-1.api.aws --region ap-southeast-1 --cli-input-json '{
  "StartTime": 1729037340,
  "EndTime": 1729123740
}' --output json --query '(ServiceSummaries[?KeyAttributes.Name=='\''pet-clinic-frontend-java'\''].KeyAttributes)[0]'
+ SERVICE_KEY_ATTRIBUTES=null
+ echo null
null
+ '[' null = '' ']'
+ KEY_ATTRIBUTES=null
+ CREATE_SLO_REQUEST_1=slo/inputRequest/CreateServiceLevelObjective/getOwner99Availability.json
++ sed 's|"KeyAttributes": .*|"KeyAttributes": null,|' slo/inputRequest/CreateServiceLevelObjective/getOwner99Availability.json
+ CREATE_SLO_REQUEST_WITH_CORRECT_SERVICE_ARN_1='{
  "Name": "Availability for Searching an Owner",
  "Description": "Availability larger than 99 for Get Owner operation",
  "SliConfig": {
    "SliMetricConfig": {
      "KeyAttributes": null,
      "OperationName": "GET /api/customer/owners",
      "MetricType": "AVAILABILITY",
      "PeriodSeconds": 60
    },
    "MetricThreshold": 99.0,
    "ComparisonOperator": "GreaterThan"
  },
  "Goal": {
    "Interval": {
      "RollingInterval": {
        "Duration": 1,
        "DurationUnit": "DAY"
      }
    },
    "AttainmentGoal": 99.9,
    "WarningThreshold": 60.0
  }
}'
+ err=0
+ for i in {1..5}
++ aws application-signals create-service-level-objective --endpoint https://application-signals.ap-southeast-1.api.aws --cli-input-json '{
  "Name": "Availability for Searching an Owner",
  "Description": "Availability larger than 99 for Get Owner operation",
  "SliConfig": {
    "SliMetricConfig": {
      "KeyAttributes": null,
      "OperationName": "GET /api/customer/owners",
      "MetricType": "AVAILABILITY",
      "PeriodSeconds": 60
    },
    "MetricThreshold": 99.0,
    "ComparisonOperator": "GreaterThan"
  },
  "Goal": {
    "Interval": {
      "RollingInterval": {
        "Duration": 1,
        "DurationUnit": "DAY"
      }
    },
    "AttainmentGoal": 99.9,
    "WarningThreshold": 60.0
  }
}' --no-cli-pager --region ap-southeast-1
+ output='
Parameter validation failed:
Invalid type for parameter SliConfig.SliMetricConfig.KeyAttributes, value: None, type: <class '\''NoneType'\''>, valid types: <class '\''dict'\''>'
+ err=252
+ grep InvalidParameterValue
+ echo '
Parameter validation failed:
Invalid type for parameter SliConfig.SliMetricConfig.KeyAttributes, value: None, type: <class '\''NoneType'\''>, valid types: <class '\''dict'\''>'
+ break
+ check_if_loop_failed_and_exit 252 'There was an error creating an SLO - GetOwner99Availability, exiting'
+ '[' 252 -ne 0 ']'
+ echo There was an error creating an SLO - GetOwner99Availability, exiting
There was an error creating an SLO - GetOwner99Availability, exiting
+ exit 1

For some reason, the CloudWatch SLO feature is not able to recognise the EKS cluster as a service.

EKS:
image

CloudWatch:

image

Someone else reported this issue back in April. Has this repo been tested recently?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions