private void incrementAcceptedMetrics(DiscFilterRequest request, boolean authzRequired, Optional<Result> result) {
        String hostHeader = request.getHeader("Host");
        Metric.Context context = metric.createContext(Map.of(
                "endpoint", hostHeader != null ? hostHeader : "",
                "authz-required", Boolean.toString(authzRequired),
                "httpMethod", HttpRequest.Method.valueOf(request.getMethod()).name(),
                "requestPrivileges", result.map(r -> String.join(",", r.requestPrivileges)).orElse(""),
                "requestMapping", result.map(r -> r.action).orElse("")
        ));
        metric.add(ACCEPTED_METRIC_NAME, 1L, context);
    }
An Athenz security filter that uses a configured action and resource name to control access.

@author bjorncs
jdisc-security-filters/src/main/java/com/yahoo/jdisc/http/filter/security/athenz/AthenzAuthorizationFilter.java