Skip to content

Commit 1f06797

Browse files
committed
test
1 parent df3c994 commit 1f06797

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,20 @@ public void validate() throws Exception {
9191
RetryHelper.retry(
9292
maxRetryCount,
9393
() -> {
94+
95+
// Special handling for Genesis path - just check if any metrics exist in namespace
96+
// since ADOT will just capture any OTel Metrics emitted and convert them into EMF metrics, it's impossible to create
97+
// a validation template for this.
98+
if (validationConfig.getHttpPath().contains("ai-chat")) {
99+
100+
List<Metric> allMetricsInNamespace = cloudWatchService.listMetrics(context.getMetricNamespace(), null, null, null);
101+
log.info("Found {} metrics in namespace {}", allMetricsInNamespace.size(), context.getMetricNamespace());
102+
if (allMetricsInNamespace.isEmpty()) {
103+
throw new BaseException(ExceptionCode.EXPECTED_METRIC_NOT_FOUND, "No metrics found in namespace: " + context.getMetricNamespace());
104+
}
105+
log.info("validation is passed for path {}", validationConfig.getHttpPath());
106+
return;
107+
}
94108
// We will query the Service, RemoteService, and RemoteTarget dimensions to ensure we
95109
// get all metrics from all aggregations, specifically the [RemoteService] aggregation.
96110
List<String> serviceNames =

0 commit comments

Comments
 (0)