Skip to content

Commit 0e9a0fe

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

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ 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 }",
241-
context.getServiceName()
240+
"{ ($.attributes.otelServiceName = \"%s\") }",
241+
context.getServiceName(),
242242
);
243243
log.info("Filter Pattern for OTLP SigV4 Log Search: " + filterPattern);
244244

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)