Skip to content

Commit 16c08bf

Browse files
author
Jeel Mehta
committed
Changing the filter pattern for validating logs
1 parent f5eddea commit 16c08bf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

validator/src/main/java/com/amazon/aoc/validators/CWLogValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ private Map<String, Object> getActualOtelSpanLog(String operation, String remote
237237
private Map<String, Object> getActualOtlpSigV4Log() throws Exception {
238238
// Filter pattern to match OTLP SigV4 logs
239239
String filterPattern = String.format(
240-
"{ ($.resource.attributes.service.name = \"%s\") && $.body EXISTS && $.severityNumber EXISTS && $.severityText EXISTS }",
240+
"{ ($.attributes.otelServiceName = \"%s\") }",
241241
context.getServiceName()
242242
);
243243
log.info("Filter Pattern for OTLP SigV4 Log Search: " + filterPattern);

validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/logs/log.mustache

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
"severityText": "{{severityText}}",
1414
"body": "{{body}}",
1515
"traceId": "{{traceId}}",
16-
"spanId": "{{spanId}}"
16+
"spanId": "{{spanId}}",
17+
"attributes": {
18+
"otelServiceName": "{{serviceName}}"
19+
}
1720
}]

0 commit comments

Comments
 (0)