-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
adding CLI examples for App signals #9176
Open
khyathisri
wants to merge
1
commit into
aws:develop
Choose a base branch
from
khyathisri:app-signals-cli-docs
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
...xamples/application-signals/batch-get-service-level-objective-budget-report.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
**To retrieve one or more service level objective (SLO) budget reports.** | ||
|
||
The following ``batch-get-service-level-objective-budget-report`` example retrieves one or more service level objective (SLO) budget reports. :: | ||
|
||
aws application-signals batch-get-service-level-objective-budget-report \ | ||
--timestamp 1735059869 \ | ||
--slo-ids "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName1" "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName2" | ||
|
||
Output:: | ||
|
||
{ | ||
"Timestamp": "2024-12-24T22:34:29+05:30", | ||
"Reports": [{ | ||
"Arn": "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName1", | ||
"Name": "Your SLO Name", | ||
"EvaluationType": "PeriodBased", | ||
"BudgetStatus": "OK", | ||
"Attainment": 100.0, | ||
"TotalBudgetSeconds": 6048, | ||
"BudgetSecondsRemaining": 6048, | ||
"Sli": { | ||
"SliMetric": { | ||
"MetricDataQueries": [{ | ||
"Id": "m1", | ||
"MetricStat": { | ||
"Metric": { | ||
"Namespace": "AWS/EC2", | ||
"MetricName": "CPUUtilization", | ||
"Dimensions": [{ | ||
"Name": "InstanceId", | ||
"Value": "i-0e098765432522" | ||
}] | ||
}, | ||
"Period": 60, | ||
"Stat": "Average" | ||
}, | ||
"ReturnData": true | ||
}] | ||
}, | ||
"MetricThreshold": 200.0, | ||
"ComparisonOperator": "LessThanOrEqualTo" | ||
}, | ||
"Goal": { | ||
"Interval": { | ||
"RollingInterval": { | ||
"DurationUnit": "DAY", | ||
"Duration": 7 | ||
} | ||
}, | ||
"AttainmentGoal": 99.0, | ||
"WarningThreshold": 50.0 | ||
} | ||
}, | ||
{ | ||
"Arn": "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName2", | ||
"Name": "test", | ||
"EvaluationType": "PeriodBased", | ||
"BudgetStatus": "BREACHED", | ||
"Attainment": 97.39583275, | ||
"TotalBudgetSeconds": 86, | ||
"BudgetSecondsRemaining": -2154, | ||
"Sli": { | ||
"SliMetric": { | ||
"MetricDataQueries": [{ | ||
"Id": "cwMetric", | ||
"MetricStat": { | ||
"Metric": { | ||
"Namespace": "AWS/EC2", | ||
"MetricName": "CPUUtilization", | ||
"Dimensions": [{ | ||
"Name": "InstanceId", | ||
"Value": "i-0e12345678922" | ||
}] | ||
}, | ||
"Period": 300, | ||
"Stat": "Average" | ||
}, | ||
"ReturnData": true | ||
}] | ||
}, | ||
"MetricThreshold": 5.0, | ||
"ComparisonOperator": "GreaterThan" | ||
}, | ||
"Goal": { | ||
"Interval": { | ||
"RollingInterval": { | ||
"DurationUnit": "DAY", | ||
"Duration": 1 | ||
} | ||
}, | ||
"AttainmentGoal": 99.9, | ||
"WarningThreshold": 30.0 | ||
} | ||
} | ||
], | ||
"Errors": [] | ||
} | ||
|
||
For more information, see `Application Signals <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Monitoring-Sections.html>`__ in the *Amazon CloudWatch User Guide*. |
88 changes: 88 additions & 0 deletions
88
awscli/examples/application-signals/create-service-level-objective.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
**To create a service level objective (SLO)** | ||
|
||
The following ``create-service-level-objective`` example creates a service level objective (SLO), which can help you ensure that your critical business operations are meeting customer expectations. :: | ||
|
||
aws application-signals create-service-level-objective \ | ||
--name "SLOName" \ | ||
--description "Description of your SLO" \ | ||
--sli-config file://sli-config.json | ||
|
||
Contents of ``sli-config.json``:: | ||
|
||
{ | ||
"SliMetricConfig": { | ||
"MetricDataQueries": [ | ||
{ | ||
"Id": "m1", | ||
"MetricStat": { | ||
"Metric": { | ||
"Namespace": "AWS/EC2", | ||
"MetricName": "CPUUtilization", | ||
"Dimensions": [ | ||
{ | ||
"Name": "InstanceId", | ||
"Value": "i-0e5a1234561522" | ||
} | ||
] | ||
}, | ||
"Period": 60, | ||
"Stat": "Average" | ||
}, | ||
"ReturnData": true | ||
} | ||
] | ||
}, | ||
"MetricThreshold": 200, | ||
"ComparisonOperator": "LessThanOrEqualTo" | ||
} | ||
|
||
Output:: | ||
|
||
{ | ||
"Slo": { | ||
"Arn": "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName", | ||
"Name": "SLOName", | ||
"Description": "Description of your SLO", | ||
"CreatedTime": "2024-12-27T08:16:09.032000+05:30", | ||
"LastUpdatedTime": "2024-12-27T08:16:09.032000+05:30", | ||
"Sli": { | ||
"SliMetric": { | ||
"MetricDataQueries": [ | ||
{ | ||
"Id": "m1", | ||
"MetricStat": { | ||
"Metric": { | ||
"Namespace": "AWS/EC2", | ||
"MetricName": "CPUUtilization", | ||
"Dimensions": [ | ||
{ | ||
"Name": "InstanceId", | ||
"Value": "i-0e59876543234522" | ||
} | ||
] | ||
}, | ||
"Period": 60, | ||
"Stat": "Average" | ||
}, | ||
"ReturnData": true | ||
} | ||
] | ||
}, | ||
"MetricThreshold": 200.0, | ||
"ComparisonOperator": "LessThanOrEqualTo" | ||
}, | ||
"EvaluationType": "PeriodBased", | ||
"Goal": { | ||
"Interval": { | ||
"RollingInterval": { | ||
"DurationUnit": "DAY", | ||
"Duration": 7 | ||
} | ||
}, | ||
"AttainmentGoal": 99.0, | ||
"WarningThreshold": 50.0 | ||
} | ||
} | ||
} | ||
|
||
For more information, see `Application Signals <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Monitoring-Sections.html>`__ in the *Amazon CloudWatch User Guide*. |
12 changes: 12 additions & 0 deletions
12
awscli/examples/application-signals/delete-service-level-objective.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
**To delete the specified service level objective.** | ||
|
||
The following ``delete-service-level-objective`` example deletes the specified service level objective. :: | ||
|
||
aws application-signals delete-service-level-objective \ | ||
--id "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName" | ||
|
||
Output:: | ||
|
||
This command produces no output. | ||
|
||
For more information, see `Application Signals <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Monitoring-Sections.html>`__ in the *Amazon CloudWatch User Guide*. |
53 changes: 53 additions & 0 deletions
53
awscli/examples/application-signals/get-service-level-objective.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
**To return information about one SLO created in the account** | ||
|
||
The following ``get-service-level-objective`` example returns information about one SLO created in the account. :: | ||
|
||
aws application-signals get-service-level-objective \ | ||
--id "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName" | ||
|
||
Output:: | ||
|
||
{ | ||
"Slo": { | ||
"Arn": "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName", | ||
"Name": "SLOName", | ||
"Description": "Description of your SLO", | ||
"CreatedTime": "2024-12-24T22:19:18.624000+05:30", | ||
"LastUpdatedTime": "2024-12-24T22:19:55.280000+05:30", | ||
"Sli": { | ||
"SliMetric": { | ||
"MetricDataQueries": [{ | ||
"Id": "m1", | ||
"MetricStat": { | ||
"Metric": { | ||
"Namespace": "AWS/EC2", | ||
"MetricName": "CPUUtilization", | ||
"Dimensions": [{ | ||
"Name": "InstanceId", | ||
"Value": "i-0e0987654321522" | ||
}] | ||
}, | ||
"Period": 60, | ||
"Stat": "Average" | ||
}, | ||
"ReturnData": true | ||
}] | ||
}, | ||
"MetricThreshold": 200.0, | ||
"ComparisonOperator": "LessThanOrEqualTo" | ||
}, | ||
"EvaluationType": "PeriodBased", | ||
"Goal": { | ||
"Interval": { | ||
"RollingInterval": { | ||
"DurationUnit": "DAY", | ||
"Duration": 7 | ||
} | ||
}, | ||
"AttainmentGoal": 99.0, | ||
"WarningThreshold": 50.0 | ||
} | ||
} | ||
} | ||
|
||
For more information, see `Application Signals <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Monitoring-Sections.html>`__ in the *Amazon CloudWatch User Guide*. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
**To return information about a service discovered by Application Signals** | ||
|
||
The following ``get-service`` example returns information about a service discovered by Application Signals. :: | ||
|
||
aws application-signals get-service \ | ||
--start-time 1732704000 \ | ||
--end-time 1732714500 \ | ||
--key-attributes Environment=lambda:default,Name=hello-world-python,Type=Service | ||
|
||
Output:: | ||
|
||
{ | ||
"Service": { | ||
"KeyAttributes": { | ||
"Environment": "lambda:default", | ||
"Name": "hello-world-python", | ||
"Type": "Service" | ||
}, | ||
"AttributeMaps": [{ | ||
"Lambda.Function.Name": "hello-world-python", | ||
"PlatformType": "AWS::Lambda" | ||
}], | ||
"MetricReferences": [{ | ||
"Namespace": "ApplicationSignals", | ||
"MetricType": "LATENCY", | ||
"Dimensions": [{ | ||
"Name": "Environment", | ||
"Value": "lambda:default" | ||
}, { | ||
"Name": "Service", | ||
"Value": "hello-world-python" | ||
}], | ||
"MetricName": "Latency" | ||
}, { | ||
"Namespace": "ApplicationSignals", | ||
"MetricType": "FAULT", | ||
"Dimensions": [{ | ||
"Name": "Environment", | ||
"Value": "lambda:default" | ||
}, { | ||
"Name": "Service", | ||
"Value": "hello-world-python" | ||
}], | ||
"MetricName": "Fault" | ||
}, { | ||
"Namespace": "ApplicationSignals", | ||
"MetricType": "ERROR", | ||
"Dimensions": [{ | ||
"Name": "Environment", | ||
"Value": "lambda:default" | ||
}, { | ||
"Name": "Service", | ||
"Value": "hello-world-python" | ||
}], | ||
"MetricName": "Error" | ||
}], | ||
"LogGroupReferences": [{ | ||
"Identifier": "/aws/lambda/hello-world-python", | ||
"ResourceType": "AWS::Logs::LogGroup", | ||
"Type": "AWS::Resource" | ||
}] | ||
}, | ||
"StartTime": "2024-11-27T10:00:00+00:00", | ||
"EndTime": "2024-11-27T14:00:01+00:00", | ||
"LogGroupReferences": [{ | ||
"Identifier": "/aws/lambda/hello-world-python", | ||
"ResourceType": "AWS::Logs::LogGroup", | ||
"Type": "AWS::Resource" | ||
}] | ||
} | ||
|
||
For more information, see `Application Signals <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Monitoring-Sections.html>`__ in the *Amazon CloudWatch User Guide*. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.