# Adding metrics from custom RealmResourceProvider

**URL:** <https://forum.keycloak.org/t/adding-metrics-from-custom-realmresourceprovider/9069>\
**Category:** Extending the server\
**Created:** [May 13, 2021, 9:05pm UTC](https://forum.keycloak.org/t/adding-metrics-from-custom-realmresourceprovider/9069 "2021-05-13T21:05:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flintholm](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/flintholm/32/3136_2.png) [@Flintholm](https://forum.keycloak.org/u/Flintholm)\
**Post date:** [May 13, 2021, 9:05pm UTC](https://forum.keycloak.org/t/adding-metrics-from-custom-realmresourceprovider/9069/1 "2021-05-13T21:05:56Z")

</div>

I’m trying to add some metrics to my custom RealmResourceProvider and would like the metrics to show up in the /metrics endpoint.

I have tried this in my RealmResourceProvider

```auto
@Timed(name = "work-time",
       description = "Metrics to monitor time to do work",
       unit = MetricUnits.MINUTES,
       absolute = true)
@GET
@Path("/dowork")
public String doWork() {
    try {
        Thread.sleep(1000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    return "work done!";
}

```

But the metric does not show up in the /metrics result.

Im running on Keycloak 13.0.0 using the docker image and have enabled metrics using the KEYCLOAK\_STATISTICS environment variable.

Have i completely misunderstod how to add metrics in a Wildfly application or is there some special Keycloak trickery that needs to be done?
