actually the change needed would be to rewrite the provided uri in https://github.com/aerogear/keycloak-metrics-spi/blob/master/src/main/java/org/jboss/aerogear/keycloak/metrics/PrometheusExporter.java for 404 (and eventually 301) codes for responseTotal, requestDuration and responseError:
public void recordResponseTotal(int code, String method, String resource, String uri) { if(404 == code) {uri="NOT_FOUND";} responseTotal.labels(Integer.toString(code), method, resource, uri).inc(); pushAsync(); }