Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ai-validator/libs/tests/test-14.script.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Steps

### 1. Click 'Application Map'

In the left panel, under Application Signals, click 'Application Map'.

### 2. Open dropdown named 'Related Services'
Click to the dropdown box in the 'Group By' section and click on it with lable 'Related Services'

**Constraints:**
- You MUST ensure not to click on 'Manage groups'

### 3. Select 'Tier' from dropdown

From the dropdown list, select_dropdown option 'Tier'

### 4. Look 'Tier' in the container

Look for 'Tier-1 ', 'Tier-2','Tier-3' and 'Tier-4'
27 changes: 27 additions & 0 deletions ai-validator/libs/tests/test-15.script.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Steps

### 1. Click 'Services'

In the left panel, under Application Signals, click 'Services'.

### 2. Search for 'audit-service'

In the search field with placeholder text 'Search and filter', type 'audit-service' and press Enter.

**Constraints:**
- You MUST press Enter after entering this text

### 3. Click 'audit-service'

Click the hyperlink 'audit-service' in the 'Services' list in the main panel.

### 4. Verify 'Changes' section

Verify that the 'Changes' section is non empty and has 'Last Deployment' populated

### 5. Check the deployment

Click on the hyperlink 'View Details' next to the 'Latest Deployment' in the 'Changes' section, this should be on 'CloudTrail' page

### 6. Verify the 'UpdateFunctionCode20150331v2' event
Veify the event name is 'UpdateFunctionCode20150331v2' from the 'Details' section
20 changes: 20 additions & 0 deletions ai-validator/libs/tests/test-16.script.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Steps

### 1. Click 'Services'

In the left panel, under Application Signals, click 'Services'.

### 2. Search for 'Application = Audit' services

In the search field with placeholder text 'Search and filter', type 'Application = Audit' and press Enter.

**Constraints:**
- You MUST press Enter after entering this text


### 3. Verify services in the main panel

Verify the services with names 'audit-service' present in table

**Constraints:**
- You must verify that there are 1 service is present with the list provided above.
38 changes: 38 additions & 0 deletions ai-validator/libs/tests/test-17.script.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Steps

### 1. Click 'Application Map'

In the left panel, under Application Signals, click 'Application Map'.

### 2. Open dropdown named 'Related Services'
Click to the dropdown box in the 'Group By' section and click on it with lable 'Related Services'

**Constraints:**
- You MUST ensure not to click on 'Manage groups'

### 3. Select 'Tier' from dropdown

From the dropdown list, select_dropdown option 'Tier'

### 4. Look 'Tier' in the container

Look for 'Tier-1 ', 'Tier-2','Tier-3' and 'Tier-4' these are Tier tiles REMEMBER it.

### 5. Click on breaching Tier with Priority
Click on Tier tile which has 'SLI breach' or is 'Red in color'

**Constraints:**
- You MUST ensure to keep the Priority in mind ie. Tier-1 >Tier-2 >Tier-3 >Tier-4
- You MUST ensure to Click on the hyperlink of Tier


### 6. Filter Breaching Services using 'Group and filter' panel
Click on the 'Breaching SLI' checkbox from the panel

### 7. View the Insights for the failures
- Identify the tile with the text in upper right corner of 'SLI Breach'
- Click on the hyperlink on the text 'View Insights' of that tile
- Navigate to the drawer opened on the right hand side which MUST have the same service details as that of on the tile

### 8. Check the Operational Audit for more information
Look for section 'Operational Audit' in the drawer
2 changes: 2 additions & 0 deletions cdk/eks/lib/manifests/sample-app/api-gateway-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@ spec:
value: "${APP_MONITOR_IDENTITY_POOL_ID}"
- name: APP_MONITOR_ID
value: "${APP_MONITOR_ID}"
- name: OTEL_RESOURCE_ATTRIBUTES
value: Application=PetClinic,Team=PlatformTeam,Tier=Tier-1 ,aws.application_signals.metric_resource_keys=Application&Team&Tier
restartPolicy: Always
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ spec:
value: <HOST>
- name: DB_SERVICE_PORT
value: '5432'
- name: OTEL_RESOURCE_ATTRIBUTES
value: Application=Payment,Team=RevenueTeam,Tier=Tier-1 ,aws.application_signals.metric_resource_keys=Application&Team&Tier
# command: ["sh", "-c"]
# args: ['manage.py', 'runserver', '0.0.0.0:8000']
command: ['sh', '-c']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ spec:
name: customers-service-java
ports:
- containerPort: 8081
env:
- name: OTEL_RESOURCE_ATTRIBUTES
value: Application=PetClinic,Team=PlatformTeam,Tier=Tier-1 ,aws.application_signals.metric_resource_keys=Application&Team&Tier
restartPolicy: Always
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ spec:
value: <HOST>
- name: DB_SERVICE_PORT
value: '5432'
- name: OTEL_RESOURCE_ATTRIBUTES
value: Application=Payment,Team=RevenueTeam,Tier=Tier-1 ,aws.application_signals.metric_resource_keys=Application&Team&Tier
# command: ["sh", "-c"]
# args: ['manage.py', 'runserver', '0.0.0.0:8000']
command: ['sh', '-c']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ spec:
value: http://discovery-server:8761/eureka
- name: MONGO_URI
value: mongodb://admin:admin@mongodb:27017/
- name: OTEL_RESOURCE_ATTRIBUTES
value: Application=PetClinic,Team=AnalyticsTeam,Tier=Tier-1 ,aws.application_signals.metric_resource_keys=Application&Team&Tier
ports:
- containerPort: 3000
imagePullPolicy: Always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ spec:
value: "30"
- name: eureka__client__registryFetchIntervalSeconds
value: "30"
- name: OTEL_RESOURCE_ATTRIBUTES
value: Application=Payment,Team=RevenueTeam,Tier=Tier-1 ,aws.application_signals.metric_resource_keys=Application&Team&Tier

ports:
- containerPort: 8089
Expand Down
3 changes: 3 additions & 0 deletions cdk/eks/lib/manifests/sample-app/vets-service-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ spec:
name: vets-service-java
ports:
- containerPort: 8083
env:
- name: OTEL_RESOURCE_ATTRIBUTES
value: Application=PetClinic,Team=WorkflowTeam,Tier=Tier-1 ,aws.application_signals.metric_resource_keys=Application&Team&Tier
restartPolicy: Always
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ spec:
env:
- name: OTEL_INSTRUMENTATION_AWS_SDK_EXPERIMENTAL_SPAN_ATTRIBUTES
value: "true"
- name: OTEL_RESOURCE_ATTRIBUTES
value: Application=PetClinic,Team=WorkflowTeam,Tier=Tier-2,aws.application_signals.metric_resource_keys=Application&Team&Tier
image: 111122223333.dkr.ecr.us-west-2.amazonaws.com/springcommunity/spring-petclinic-visits-service:latest
securityContext:
runAsNonRoot: true
Expand Down
19 changes: 15 additions & 4 deletions cdk/eks/lib/stacks/slo-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,28 @@ export class SloStack extends Stack {
//exclusionWindows
undefined
));
const appointmentServiceAvailabilitySlo = new applicationsignals.CfnServiceLevelObjective(this, 'appointmentServiceAvailabilitySLO', this.getAppointmentSloProp(

const appointmentServiceAvailabilitySlo = new applicationsignals.CfnServiceLevelObjective(this, 'appointmentServiceAvailabilitySLO', this.getLambdaServiceSloProp(
"appointment service availability",
"Availability for appointment-service-get/FunctionHandler operation",
awsApplicationTag
));

const auditServiceAvailabilitySlo = new applicationsignals.CfnServiceLevelObjective(this, 'auditServiceAvailabilitySLO', this.getLambdaServiceSloProp(
"audit service availability",
"Availability for audit-service/FunctionHandler operation",
awsApplicationTag,
"audit-service"
));

getOwner99AvailabilitySlo.node.addDependency(enableTopologyDiscovery);
getOwner99LatencySlo.node.addDependency(enableTopologyDiscovery);
postOwner99AvailabilitySlo.node.addDependency(enableTopologyDiscovery);
postOwner99LatencySlo.node.addDependency(enableTopologyDiscovery);
billingActivitiesLatencySlo.node.addDependency(enableTopologyDiscovery);
getPaymentAvailabilitySlo.node.addDependency(enableTopologyDiscovery);
appointmentServiceAvailabilitySlo.node.addDependency(enableTopologyDiscovery);
auditServiceAvailabilitySlo.node.addDependency(enableTopologyDiscovery);
}

getSloProp(name: string, description: string, requestType: string, metricType: string, metricThreshold: number, comparisonOperator: string, awsApplicationTag: string, statistic?: string, operationPath?: string, serviceName?: string, serviceType?: string, exclusionWindows?: ExclusionWindowProperty[]) {
Expand Down Expand Up @@ -181,18 +190,18 @@ export class SloStack extends Stack {
return sloProp
}

getAppointmentSloProp(name: string, description: string, awsApplicationTag: string) {
getLambdaServiceSloProp(name: string, description: string, awsApplicationTag: string, serviceName: string = "appointment-service-get") {
const sloProp: applicationsignals.CfnServiceLevelObjectiveProps = {
name: name,
description: description,
sli: {
sliMetric: {
keyAttributes: {
"Name": "appointment-service-get",
"Name": serviceName,
"Type": "Service",
"Environment": "lambda:default"
},
operationName: "appointment-service-get/FunctionHandler",
operationName: `${serviceName}/FunctionHandler`,
metricType: "AVAILABILITY",
periodSeconds: 60
},
Expand All @@ -215,4 +224,6 @@ export class SloStack extends Stack {
}
return sloProp
}


}
9 changes: 9 additions & 0 deletions data_test/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ python3 run_metrics_tests.py <path_to_test_cases.json>

# For Trace Testing
python3 run_trace_tests.py <path_to_test_cases.json>

## For Tags Testing
python3 run_tag_tests.py <path_to_test_cases.json>

## For Cloudtrail Events Testing
python3 run_cloudtrail_test.py <path_to_test_cases.json>

## For OTEL Resource Attribute Testing
python3 run_otel_resource_attributes_tests.py <path_to_test_cases.json>
```

## Test Case Format
Expand Down
35 changes: 35 additions & 0 deletions data_test/run_cloudtrail_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python3
import boto3
from datetime import datetime, timedelta, timezone

def run_cloudtrail_test():
client = boto3.client('cloudtrail')

end_time = datetime.now(timezone.utc)
start_time = end_time - timedelta(minutes=30)

response = client.lookup_events(
LookupAttributes=[
{
'AttributeKey': 'EventName',
'AttributeValue': 'UpdateFunctionCode20150331v2'
}
],
StartTime=start_time,
EndTime=end_time
)

events = response.get('Events', [])
audit_service_events = [e for e in events if 'audit-service' in str(e)]

print(f"Found {len(audit_service_events)} UpdateFunctionCode20150331v2 events for audit-service")

if len(audit_service_events) >= 1:
print("✅ PASS: At least one audit-service UpdateFunctionCode event found")
return True
else:
print("❌ FAIL: No audit-service UpdateFunctionCode events found")
return False

if __name__ == "__main__":
run_cloudtrail_test()
Loading