Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Status Subcommand Design #746

Closed
iamhopaul123 opened this issue Mar 16, 2020 · 0 comments
Closed

App Status Subcommand Design #746

iamhopaul123 opened this issue Mar 16, 2020 · 0 comments
Labels
type/design Issues that are design proposals.

Comments

@iamhopaul123
Copy link
Contributor

iamhopaul123 commented Mar 16, 2020

Motivation

Currently developers are not able to check their application running status using ECS-CLI-v2. Instead, in order to check for their service/task status, users need to use AWS-CLI or ECS console to get those info. Plus, it would also be helpful for users to be able to check the metrics at a glance by using ECS-CLI-v2.

Thus, we propose a new subcommand app status which shows not only the status of their ECS service and running tasks for a deployed application, but also CloudWatch metrics of the application.

Help Menu

$ ecs-preview app status -h
Show health status of your application.

Usage
  ecs-preview app status [flags]

Flags
  -a,  --app string              Name of the application.
  -e,  --env string              Name of the environment.
       --follow string           Optional. Specify the polling frequency like 5s, 2m, or 3h.
       --json                    Optional. Output in JSON format.
  -h,  --help                    Help for command.

Examples
  $ ecs-preview app status -a my-app -e test

And for the output can be divided into three parts:

  • Service Status
  • Task Status
  • Metrics

Service Status

Service Status shows the running status of the ECS service, which includes:

  • status - The status of the service.
  • desiredCount - Desired number of tasks in the cluster.
  • runningCount - The number of tasks in the cluster that are in the RUNNING state.

Task Status

Task Status section displays the running status for each ECS task of the application service, including:

  • id - The task id.
  • lastStatus - The last known status of the task.
  • desiredStatus - The desired status of the task.
  • imageDigest - The container image manifest digest.
  • image - The image used for the service. (Only shown in JSON format)
  • startedAt - When the task started.
  • stoppedAt - When the task stopped (if exists).
  • stoppedReason - The reason that the task was stopped (if exists).

Metrics

Metrics section shows the metric of any CloudWatch alarm with our project/env/app tags. Fields include:

  • Name - The name of the alarm
  • Status - The state value for the alarm.
  • Reason - An explanation for the alarm state, in text format.
  • UpdatedTimes - The time of the last update to the alarm state.

Output Examples

With Human Format

Service Status

  Status           ACTIVE
  DesiredCount     10
  RunningCount     10

Task Status

  ID            ImageDigest       LastStatus      DesiredStatus    StartedAt        StoppedAt      
  a5e62a5       af65d63b          RUNNING         RUNNING          17 seconds ago   -              

Metrics

  Name                             Health               UpdatedTimes      Reason
  CPUUtilization-gt-70-5m-average  INSUFFICIENT_DATA    1 minute ago      Insufficient Data: 1 datapoint was unknown.
  RequestCount-gt-70-5m-maximum    ALARM                10 seconds ago    Threshold Crossed: 1 out of the last 1 datapoints [1.0800386754501805 (09/03/20 18:20:00)] was greater than the threshold (1.0) (minimum 1 datapoint for OK -> ALARM transition).

With JSON Format

{
  "status: "ACTIVE",
   "desiredCount": 10,
   "runningCount": 10,
  "tasks":  [
    {
      "id": "a5e62a53e1db4a7bb622a5507e871785",
      "lastStatus": "RUNNING",
      "desiredStatus": "RUNNING",
      "imageDigest": "sha256:af65d63b2575dddd089a37c5b061d6fc2e141225aa0a65281ff3fc8880975f52",
      "1234567890.dkr.ecr.us-west-2.amazonaws.com/archer-bot-project/project-bot:project-bot",
      "startedAt": "2006-01-02T15:05:05+00:00"
    }
  ],
  "metrics":  [
    {
      "name": "CPUUtilization-gt-70-5m-average",
      "health": "INSUFFICIENT_DATA",
      "reason": "Insufficient Data: 1 datapoint was unknown.",
      "updatedTimes": "2006-01-02T15:05:05+00:00"
    },
    {
      "name": "RequestCount-gt-70-5m-maximum",
      "health": "ALARM",
      "reason": "Threshold Crossed: 1 out of the last 1 datapoints [1.0800386754501805 (09/03/20 18:20:00)] was greater than the threshold (1.0) (minimum 1 datapoint for OK -> ALARM transition).",
      "updatedTimes": "2006-01-02T15:05:05+00:00"
    }
  ]
}
@iamhopaul123 iamhopaul123 added the type/design Issues that are design proposals. label Mar 16, 2020
@iamhopaul123 iamhopaul123 added the WIP Pull requests that are being modified now. label Mar 17, 2020
@iamhopaul123 iamhopaul123 removed the WIP Pull requests that are being modified now. label Mar 18, 2020
@efekarakus efekarakus moved this to Complete in Copilot Roadmap 🗺️ Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/design Issues that are design proposals.
Projects
Status: Complete
Development

No branches or pull requests

2 participants