Skip to content

Commit 61a5ebf

Browse files
Khyathi Sri Dommetiashovlin
authored andcommitted
adding CLI examples for App signals
1 parent 76fdbe3 commit 61a5ebf

15 files changed

+712
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
**To retrieve one or more service level objective (SLO) budget reports.**
2+
3+
The following ``batch-get-service-level-objective-budget-report`` example retrieves one or more service level objective (SLO) budget reports. ::
4+
5+
aws application-signals batch-get-service-level-objective-budget-report \
6+
--timestamp 1735059869 \
7+
--slo-ids "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName1" "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName2"
8+
9+
Output::
10+
11+
{
12+
"Timestamp": "2024-12-24T22:34:29+05:30",
13+
"Reports": [{
14+
"Arn": "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName1",
15+
"Name": "Your SLO Name",
16+
"EvaluationType": "PeriodBased",
17+
"BudgetStatus": "OK",
18+
"Attainment": 100.0,
19+
"TotalBudgetSeconds": 6048,
20+
"BudgetSecondsRemaining": 6048,
21+
"Sli": {
22+
"SliMetric": {
23+
"MetricDataQueries": [{
24+
"Id": "m1",
25+
"MetricStat": {
26+
"Metric": {
27+
"Namespace": "AWS/EC2",
28+
"MetricName": "CPUUtilization",
29+
"Dimensions": [{
30+
"Name": "InstanceId",
31+
"Value": "i-0e098765432522"
32+
}]
33+
},
34+
"Period": 60,
35+
"Stat": "Average"
36+
},
37+
"ReturnData": true
38+
}]
39+
},
40+
"MetricThreshold": 200.0,
41+
"ComparisonOperator": "LessThanOrEqualTo"
42+
},
43+
"Goal": {
44+
"Interval": {
45+
"RollingInterval": {
46+
"DurationUnit": "DAY",
47+
"Duration": 7
48+
}
49+
},
50+
"AttainmentGoal": 99.0,
51+
"WarningThreshold": 50.0
52+
}
53+
},
54+
{
55+
"Arn": "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName2",
56+
"Name": "test",
57+
"EvaluationType": "PeriodBased",
58+
"BudgetStatus": "BREACHED",
59+
"Attainment": 97.39583275,
60+
"TotalBudgetSeconds": 86,
61+
"BudgetSecondsRemaining": -2154,
62+
"Sli": {
63+
"SliMetric": {
64+
"MetricDataQueries": [{
65+
"Id": "cwMetric",
66+
"MetricStat": {
67+
"Metric": {
68+
"Namespace": "AWS/EC2",
69+
"MetricName": "CPUUtilization",
70+
"Dimensions": [{
71+
"Name": "InstanceId",
72+
"Value": "i-0e12345678922"
73+
}]
74+
},
75+
"Period": 300,
76+
"Stat": "Average"
77+
},
78+
"ReturnData": true
79+
}]
80+
},
81+
"MetricThreshold": 5.0,
82+
"ComparisonOperator": "GreaterThan"
83+
},
84+
"Goal": {
85+
"Interval": {
86+
"RollingInterval": {
87+
"DurationUnit": "DAY",
88+
"Duration": 1
89+
}
90+
},
91+
"AttainmentGoal": 99.9,
92+
"WarningThreshold": 30.0
93+
}
94+
}
95+
],
96+
"Errors": []
97+
}
98+
99+
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*.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
**To create a service level objective (SLO)**
2+
3+
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. ::
4+
5+
aws application-signals create-service-level-objective \
6+
--name "SLOName" \
7+
--description "Description of your SLO" \
8+
--sli-config file://sli-config.json
9+
10+
Contents of ``sli-config.json``::
11+
12+
{
13+
"SliMetricConfig": {
14+
"MetricDataQueries": [
15+
{
16+
"Id": "m1",
17+
"MetricStat": {
18+
"Metric": {
19+
"Namespace": "AWS/EC2",
20+
"MetricName": "CPUUtilization",
21+
"Dimensions": [
22+
{
23+
"Name": "InstanceId",
24+
"Value": "i-0e5a1234561522"
25+
}
26+
]
27+
},
28+
"Period": 60,
29+
"Stat": "Average"
30+
},
31+
"ReturnData": true
32+
}
33+
]
34+
},
35+
"MetricThreshold": 200,
36+
"ComparisonOperator": "LessThanOrEqualTo"
37+
}
38+
39+
Output::
40+
41+
{
42+
"Slo": {
43+
"Arn": "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName",
44+
"Name": "SLOName",
45+
"Description": "Description of your SLO",
46+
"CreatedTime": "2024-12-27T08:16:09.032000+05:30",
47+
"LastUpdatedTime": "2024-12-27T08:16:09.032000+05:30",
48+
"Sli": {
49+
"SliMetric": {
50+
"MetricDataQueries": [
51+
{
52+
"Id": "m1",
53+
"MetricStat": {
54+
"Metric": {
55+
"Namespace": "AWS/EC2",
56+
"MetricName": "CPUUtilization",
57+
"Dimensions": [
58+
{
59+
"Name": "InstanceId",
60+
"Value": "i-0e59876543234522"
61+
}
62+
]
63+
},
64+
"Period": 60,
65+
"Stat": "Average"
66+
},
67+
"ReturnData": true
68+
}
69+
]
70+
},
71+
"MetricThreshold": 200.0,
72+
"ComparisonOperator": "LessThanOrEqualTo"
73+
},
74+
"EvaluationType": "PeriodBased",
75+
"Goal": {
76+
"Interval": {
77+
"RollingInterval": {
78+
"DurationUnit": "DAY",
79+
"Duration": 7
80+
}
81+
},
82+
"AttainmentGoal": 99.0,
83+
"WarningThreshold": 50.0
84+
}
85+
}
86+
}
87+
88+
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*.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
**To delete the specified service level objective.**
2+
3+
The following ``delete-service-level-objective`` example deletes the specified service level objective. ::
4+
5+
aws application-signals delete-service-level-objective \
6+
--id "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName"
7+
8+
This command produces no output.
9+
10+
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*.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
**To return information about one SLO created in the account**
2+
3+
The following ``get-service-level-objective`` example returns information about one SLO created in the account. ::
4+
5+
aws application-signals get-service-level-objective \
6+
--id "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName"
7+
8+
Output::
9+
10+
{
11+
"Slo": {
12+
"Arn": "arn:aws:application-signals:us-east-1:123456789101:slo/SLOName",
13+
"Name": "SLOName",
14+
"Description": "Description of your SLO",
15+
"CreatedTime": "2024-12-24T22:19:18.624000+05:30",
16+
"LastUpdatedTime": "2024-12-24T22:19:55.280000+05:30",
17+
"Sli": {
18+
"SliMetric": {
19+
"MetricDataQueries": [{
20+
"Id": "m1",
21+
"MetricStat": {
22+
"Metric": {
23+
"Namespace": "AWS/EC2",
24+
"MetricName": "CPUUtilization",
25+
"Dimensions": [{
26+
"Name": "InstanceId",
27+
"Value": "i-0e0987654321522"
28+
}]
29+
},
30+
"Period": 60,
31+
"Stat": "Average"
32+
},
33+
"ReturnData": true
34+
}]
35+
},
36+
"MetricThreshold": 200.0,
37+
"ComparisonOperator": "LessThanOrEqualTo"
38+
},
39+
"EvaluationType": "PeriodBased",
40+
"Goal": {
41+
"Interval": {
42+
"RollingInterval": {
43+
"DurationUnit": "DAY",
44+
"Duration": 7
45+
}
46+
},
47+
"AttainmentGoal": 99.0,
48+
"WarningThreshold": 50.0
49+
}
50+
}
51+
}
52+
53+
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*.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
**To return information about a service discovered by Application Signals**
2+
3+
The following ``get-service`` example returns information about a service discovered by Application Signals. ::
4+
5+
aws application-signals get-service \
6+
--start-time 1732704000 \
7+
--end-time 1732714500 \
8+
--key-attributes Environment=lambda:default,Name=hello-world-python,Type=Service
9+
10+
Output::
11+
12+
{
13+
"Service": {
14+
"KeyAttributes": {
15+
"Environment": "lambda:default",
16+
"Name": "hello-world-python",
17+
"Type": "Service"
18+
},
19+
"AttributeMaps": [{
20+
"Lambda.Function.Name": "hello-world-python",
21+
"PlatformType": "AWS::Lambda"
22+
}],
23+
"MetricReferences": [{
24+
"Namespace": "ApplicationSignals",
25+
"MetricType": "LATENCY",
26+
"Dimensions": [{
27+
"Name": "Environment",
28+
"Value": "lambda:default"
29+
}, {
30+
"Name": "Service",
31+
"Value": "hello-world-python"
32+
}],
33+
"MetricName": "Latency"
34+
}, {
35+
"Namespace": "ApplicationSignals",
36+
"MetricType": "FAULT",
37+
"Dimensions": [{
38+
"Name": "Environment",
39+
"Value": "lambda:default"
40+
}, {
41+
"Name": "Service",
42+
"Value": "hello-world-python"
43+
}],
44+
"MetricName": "Fault"
45+
}, {
46+
"Namespace": "ApplicationSignals",
47+
"MetricType": "ERROR",
48+
"Dimensions": [{
49+
"Name": "Environment",
50+
"Value": "lambda:default"
51+
}, {
52+
"Name": "Service",
53+
"Value": "hello-world-python"
54+
}],
55+
"MetricName": "Error"
56+
}],
57+
"LogGroupReferences": [{
58+
"Identifier": "/aws/lambda/hello-world-python",
59+
"ResourceType": "AWS::Logs::LogGroup",
60+
"Type": "AWS::Resource"
61+
}]
62+
},
63+
"StartTime": "2024-11-27T10:00:00+00:00",
64+
"EndTime": "2024-11-27T14:00:01+00:00",
65+
"LogGroupReferences": [{
66+
"Identifier": "/aws/lambda/hello-world-python",
67+
"ResourceType": "AWS::Logs::LogGroup",
68+
"Type": "AWS::Resource"
69+
}]
70+
}
71+
72+
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*.

0 commit comments

Comments
 (0)