private void validateBeforeFlushingMetrics()

in powertools-metrics/src/main/java/software/amazon/lambda/powertools/metrics/internal/LambdaMetricsAspect.java [96:105]


    private void validateBeforeFlushingMetrics(Metrics metrics) {
        if (metrics.raiseOnEmptyMetrics() && hasNoMetrics()) {
            throw new ValidationException("No metrics captured, at least one metrics must be emitted");
        }

        if (dimensionsCount() > 9) {
            throw new ValidationException(String.format("Number of Dimensions must be in range of 0-9." +
                    " Actual size: %d.", dimensionsCount()));
        }
    }