---
title: Monitoring
description: IDM includes the following tools for monitoring metrics:
component: pingidm
version: 8.1
page_id: pingidm:monitoring-guide:monitoring
canonical_url: https://docs.pingidentity.com/pingidm/8.1/monitoring-guide/monitoring.html
keywords: ["Monitoring", "JSON"]
section_ids:
  enable-metrics: Enable metrics
  deprecated-metric-collection: Deprecated metric collection
  dropwizard: Dropwizard widget
  prometheus: Prometheus endpoint
  disable_prometheus: Disable Prometheus
  configure-prometheus: Configure Prometheus
  configure-grafana: Configure Grafana
  create_a_grafana_dashboard: Create a Grafana dashboard
---

# Monitoring

IDM includes the following tools for monitoring metrics:

* A Dropwizard dashboard widget, for viewing metrics within IDM.

  |   |                                                                                                                                                                                          |
  | - | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  |   | Widgets are deprecated and will be removed in a future release of IDM. For more information, refer to [Deprecation](../release-notes/deprecated-functionality.html#deprecation-widgets). |

* A Prometheus endpoint, for viewing metrics through external resources such as Prometheus and Grafana.

## Enable metrics

IDM does not collect metrics by default. To enable metrics collection, open `conf/metrics.json` and set the `enabled` property to `true`:

```json
{
    "enabled" : true
}
```

After you have enabled metrics, the following command returns all collected metrics:

Request

```
curl \
--header "X-OpenIDM-Username: openidm-admin" \
--header "X-OpenIDM-Password: openidm-admin" \
--header "Accept-API-Version: resource=1.0" \
--request GET \
'http://localhost:8080/openidm/metrics/api?_queryFilter=true'
```

> **Collapse: Show example response**
>
> Response
>
> ```json
> {
>   "result": [
>     {
>       "_id": "repo.ds.get-connection",
>       "count": 5,
>       "max": 0.033023,
>       "mean": 0.01632066766586218,
>       "min": 0.006605,
>       "p50": 0.007868,
>       "p75": 0.026865999999999998,
>       "p95": 0.033023,
>       "p98": 0.033023,
>       "p99": 0.033023,
>       "p999": 0.033023,
>       "stddev": 0.011254712526201813,
>       "m15_rate": 0.0,
>       "m1_rate": 0.0,
>       "m5_rate": 0.0,
>       "mean_rate": 1.5494157682573269,
>       "duration_units": "milliseconds",
>       "rate_units": "calls/second",
>       "total": 0.081915,
>       "_type": "timer"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Old-Gen.committed",
>       "value": 794820608,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.max-memory",
>       "value": 2147483648,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'non-profiled-nmethods'.init",
>       "value": 2555904.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Old-Gen.init",
>       "value": 2.03423744E+9,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.init_G1-Survivor-Space",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.total.max",
>       "value": 2147483647,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.total.committed",
>       "value": 2359099392,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.heap.init",
>       "value": 2147483648,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.init_heap",
>       "value": 2147483648,
>       "_type": "gauge"
>     },
>     {
>       "_id": "repo.ds.update.cluster",
>       "count": 1,
>       "max": 5.685331,
>       "mean": 5.685331,
>       "min": 5.685331,
>       "p50": 5.685331,
>       "p75": 5.685331,
>       "p95": 5.685331,
>       "p98": 5.685331,
>       "p99": 5.685331,
>       "p999": 5.685331,
>       "stddev": 0.0,
>       "m15_rate": 0.0,
>       "m1_rate": 0.0,
>       "m5_rate": 0.0,
>       "mean_rate": 0.548450244910786,
>       "duration_units": "milliseconds",
>       "rate_units": "calls/second",
>       "total": 5.685331,
>       "_type": "timer"
>     },
>     {
>       "_id": "jvm.thread-state_blocked",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "repo.ds.read.cluster",
>       "count": 1,
>       "max": 2.404851,
>       "mean": 2.404851,
>       "min": 2.404851,
>       "p50": 2.404851,
>       "p75": 2.404851,
>       "p95": 2.404851,
>       "p98": 2.404851,
>       "p99": 2.404851,
>       "p999": 2.404851,
>       "stddev": 0.0,
>       "m15_rate": 0.0,
>       "m1_rate": 0.0,
>       "m5_rate": 0.0,
>       "mean_rate": 0.5469820381458513,
>       "duration_units": "milliseconds",
>       "rate_units": "calls/second",
>       "total": 2.404851,
>       "_type": "timer"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.max_G1-Eden-Space",
>       "value": -1.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.free-memory",
>       "value": 1147588736,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'non-nmethods'.usage",
>       "value": 0.3304220516962843,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.init_non-heap",
>       "value": 7667712.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.used_G1-Old-Gen",
>       "value": 118043136,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.used_CodeHeap-'non-nmethods'",
>       "value": 2513280.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.Metaspace.init",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.class-loading.unloaded.total",
>       "count": 1,
>       "_type": "counter"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.committed_Metaspace",
>       "value": 145227776,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Survivor-Space.committed",
>       "value": 75497472,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.heap.usage",
>       "value": 0.46512436866760254,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.init_G1-Eden-Space",
>       "value": 113246208,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.garbage-collector.G1-Old-Generation.count",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state.waiting.count",
>       "value": 54.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.used_CodeHeap-'profiled-nmethods'",
>       "value": 30778496,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.class-loading.loaded",
>       "value": 22757.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.available-cpus",
>       "value": 16.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.max_G1-Old-Gen",
>       "value": 2147483648,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.max_Metaspace",
>       "value": -1.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'non-profiled-nmethods'.committed",
>       "value": 11730944,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.used-memory",
>       "value": 2147483648,
>       "_type": "gauge"
>     },
>     {
>       "_id": "scheduler.job-store.repo.query-list.triggers",
>       "count": 1,
>       "max": 3.064977,
>       "mean": 3.064977,
>       "min": 3.064977,
>       "p50": 3.064977,
>       "p75": 3.064977,
>       "p95": 3.064977,
>       "p98": 3.064977,
>       "p99": 3.064977,
>       "p999": 3.064977,
>       "stddev": 0.0,
>       "m15_rate": 0.0,
>       "m1_rate": 0.0,
>       "m5_rate": 0.0,
>       "mean_rate": 0.30915432245454577,
>       "duration_units": "milliseconds",
>       "rate_units": "calls/second",
>       "total": 3.064977,
>       "_type": "timer"
>     },
>     {
>       "_id": "jvm.memory-usage.total.init",
>       "value": 2.15515136E+9,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'non-nmethods'.used",
>       "value": 2513280.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Eden-Space.init",
>       "value": 113246208,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.Metaspace.usage",
>       "value": 0.9798155967078914,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Eden-Space.max",
>       "value": -1.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.init_Compressed-Class-Space",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Old-Gen.max",
>       "value": 2147483648,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.init_CodeHeap-'profiled-nmethods'",
>       "value": 2555904.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.total.used",
>       "value": 1202003416,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.used_Compressed-Class-Space",
>       "value": 1.63824E+7,
>       "_type": "gauge"
>     },
>     {
>       "_id": "authorization-check.full-check",
>       "count": 1,
>       "max": 1.8842489999999998,
>       "mean": 1.8842489999999998,
>       "min": 1.8842489999999998,
>       "p50": 1.8842489999999998,
>       "p75": 1.8842489999999998,
>       "p95": 1.8842489999999998,
>       "p98": 1.8842489999999998,
>       "p99": 1.8842489999999998,
>       "p999": 1.8842489999999998,
>       "stddev": 0.0,
>       "m15_rate": 0.0,
>       "m1_rate": 0.0,
>       "m5_rate": 0.0,
>       "mean_rate": 82.67584677222334,
>       "duration_units": "milliseconds",
>       "rate_units": "calls/second",
>       "total": 1.884249,
>       "_type": "timer"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.committed_G1-Eden-Space",
>       "value": 1277165568,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.used_Metaspace",
>       "value": 142296984,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'profiled-nmethods'.used",
>       "value": 30785408,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Survivor-Space.init",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.non-heap.max",
>       "value": -1.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Survivor-Space.max",
>       "value": -1.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'profiled-nmethods'.max",
>       "value": 122023936,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state.daemon.count",
>       "value": 66.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Eden-Space.used-after-gc",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state.new.count",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.max_G1-Survivor-Space",
>       "value": -1.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "repo.ds.query._adhoc-filter.cluster",
>       "count": 2,
>       "max": 2.625038,
>       "mean": 2.2533855,
>       "min": 1.8817329999999999,
>       "p50": 2.625038,
>       "p75": 2.625038,
>       "p95": 2.625038,
>       "p98": 2.625038,
>       "p99": 2.625038,
>       "p999": 2.625038,
>       "stddev": 0.3716525,
>       "m15_rate": 0.0,
>       "m1_rate": 0.0,
>       "m5_rate": 0.0,
>       "mean_rate": 1.096972198056336,
>       "duration_units": "milliseconds",
>       "rate_units": "calls/second",
>       "total": 4.506771,
>       "_type": "timer"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Eden-Space.used",
>       "value": 805306368,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.garbage-collector.G1-Young-Generation.time",
>       "value": 238.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'non-profiled-nmethods'.max",
>       "value": 122028032,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.heap.used",
>       "value": 998846976,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.max_Compressed-Class-Space",
>       "value": 1073741824,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.class-loading.unloaded",
>       "value": 1.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.init_CodeHeap-'non-profiled-nmethods'",
>       "value": 2555904.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Eden-Space.committed",
>       "value": 1277165568,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.used-after-gc_G1-Eden-Space",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.max_CodeHeap-'non-nmethods'",
>       "value": 7606272.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.class-loading.loaded.total",
>       "count": 22757,
>       "_type": "counter"
>     },
>     {
>       "_id": "jvm.memory-usage.heap.max",
>       "value": 2147483648,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.init_G1-Old-Gen",
>       "value": 2.03423744E+9,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.Metaspace.used",
>       "value": 142301024,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.non-heap.used",
>       "value": 203165728,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state_new",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "user.session.static-user",
>       "m15_rate": 0.0,
>       "m1_rate": 0.0,
>       "m5_rate": 0.0,
>       "mean_rate": 66.81303621219794,
>       "units": "events/second",
>       "total": 1.0,
>       "count": 1,
>       "_type": "summary"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.Compressed-Class-Space.usage",
>       "value": 0.015257298946380615,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.used_non-heap",
>       "value": 203165952,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.committed_G1-Old-Gen",
>       "value": 794820608,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.non-heap.usage",
>       "value": 0.9597728811919505,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state_waiting",
>       "value": 54.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.init_CodeHeap-'non-nmethods'",
>       "value": 2555904.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'profiled-nmethods'.init",
>       "value": 2555904.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.committed_CodeHeap-'non-nmethods'",
>       "value": 4390912.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.max_CodeHeap-'profiled-nmethods'",
>       "value": 122023936,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.Compressed-Class-Space.init",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state_runnable",
>       "value": 67.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Old-Gen.used",
>       "value": 118043136,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state.timed_waiting.count",
>       "value": 39.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Old-Gen.usage",
>       "value": 0.05496811866760254,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.garbage-collector.time.total_G1-Young-Generation",
>       "count": 238,
>       "_type": "counter"
>     },
>     {
>       "_id": "jvm.thread-state_terminated",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'non-profiled-nmethods'.usage",
>       "value": 0.09162589789205156,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.max_non-heap",
>       "value": -1.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.garbage-collector.G1-Young-Generation.count",
>       "value": 16.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state.terminated.count",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.garbage-collector.G1-Old-Generation.time",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.heap.committed",
>       "value": 2147483648,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.garbage-collector.time.total_G1-Old-Generation",
>       "count": 0,
>       "_type": "counter"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.Metaspace.committed",
>       "value": 145293312,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.init_Metaspace",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'non-nmethods'.committed",
>       "value": 4390912.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.non-heap.committed",
>       "value": 2.1168128E+8,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.max_heap",
>       "value": 2147483648,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Survivor-Space.usage",
>       "value": 1.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state_timed_waiting",
>       "value": 39.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.committed_heap",
>       "value": 2147483648,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.committed_non-heap",
>       "value": 2.1168128E+8,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.max_CodeHeap-'non-profiled-nmethods'",
>       "value": 122028032,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.committed_G1-Survivor-Space",
>       "value": 75497472,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state.blocked.count",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.used_heap",
>       "value": 998846976,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.garbage-collector.count.total_G1-Old-Generation",
>       "count": 0,
>       "_type": "counter"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.used_G1-Survivor-Space",
>       "value": 75497472,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Survivor-Space.used-after-gc",
>       "value": 6630416.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "authorization-check.router-authz",
>       "count": 1,
>       "max": 1.7509839999999999,
>       "mean": 1.7509839999999999,
>       "min": 1.7509839999999999,
>       "p50": 1.7509839999999999,
>       "p75": 1.7509839999999999,
>       "p95": 1.7509839999999999,
>       "p98": 1.7509839999999999,
>       "p99": 1.7509839999999999,
>       "p999": 1.7509839999999999,
>       "stddev": 0.0,
>       "m15_rate": 0.0,
>       "m1_rate": 0.0,
>       "m5_rate": 0.0,
>       "mean_rate": 61.599943968690965,
>       "duration_units": "milliseconds",
>       "rate_units": "calls/second",
>       "total": 1.750984,
>       "_type": "timer"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.committed_Compressed-Class-Space",
>       "value": 17629184,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Eden-Space.usage",
>       "value": 0.6305418719211823,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'non-profiled-nmethods'.used",
>       "value": 11180928,
>       "_type": "gauge"
>     },
>     {
>       "_id": "repo.ds.query._adhoc-filter.scheduler",
>       "count": 1,
>       "max": 2.687975,
>       "mean": 2.687975,
>       "min": 2.687975,
>       "p50": 2.687975,
>       "p75": 2.687975,
>       "p95": 2.687975,
>       "p98": 2.687975,
>       "p99": 2.687975,
>       "p999": 2.687975,
>       "stddev": 0.0,
>       "m15_rate": 0.0,
>       "m1_rate": 0.0,
>       "m5_rate": 0.0,
>       "mean_rate": 0.3087729850177765,
>       "duration_units": "milliseconds",
>       "rate_units": "calls/second",
>       "total": 2.687975,
>       "_type": "timer"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.committed_CodeHeap-'profiled-nmethods'",
>       "value": 32636928,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.used_CodeHeap-'non-profiled-nmethods'",
>       "value": 11180928,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.garbage-collector.count.total_G1-Young-Generation",
>       "count": 16,
>       "_type": "counter"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Survivor-Space.used",
>       "value": 75497472,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.committed_CodeHeap-'non-profiled-nmethods'",
>       "value": 11730944,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.used_G1-Eden-Space",
>       "value": 805306368,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state.daemon",
>       "value": 66.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.Compressed-Class-Space.committed",
>       "value": 17629184,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state.count",
>       "value": 160.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'non-nmethods'.init",
>       "value": 2555904.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "audit.authentication",
>       "m15_rate": 0.0,
>       "m1_rate": 0.0,
>       "m5_rate": 0.0,
>       "mean_rate": 57.05540262171857,
>       "units": "events/second",
>       "total": 1.0,
>       "count": 1,
>       "_type": "summary"
>     },
>     {
>       "_id": "jvm.memory-usage.non-heap.init",
>       "value": 7667712.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.thread-state.runnable.count",
>       "value": 67.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'profiled-nmethods'.committed",
>       "value": 32636928,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.Metaspace.max",
>       "value": -1.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.used-after-gc_G1-Old-Gen",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.used-after-gc_G1-Survivor-Space",
>       "value": 6630416.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.G1-Old-Gen.used-after-gc",
>       "value": 0.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.Compressed-Class-Space.max",
>       "value": 1073741824,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'non-nmethods'.max",
>       "value": 7606272.0,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.CodeHeap-'profiled-nmethods'.usage",
>       "value": 0.252550057064214,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.memory-usage.pools.Compressed-Class-Space.used",
>       "value": 1.63824E+7,
>       "_type": "gauge"
>     },
>     {
>       "_id": "jvm.free-used-memory",
>       "value": 1146838232,
>       "_type": "gauge"
>     }
>   ],
>   "resultCount": 142,
>   "pagedResultsCookie": null,
>   "totalPagedResultsPolicy": "EXACT",
>   "totalPagedResults": 142,
>   "remainingPagedResults": -1
> }
> ```
>
> |   |                                                                                                                                         |
> | - | --------------------------------------------------------------------------------------------------------------------------------------- |
> |   | Some metrics in the sample response are [deprecated](../release-notes/deprecated-functionality.html#deprecation-jvm-mem-usage-metrics). |

|   |                                                                                                                                                                                                                                                               |
| - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | IDM generates metrics only after a corresponding event occurs. For example, IDM doesn't create login-related metrics until a user logs in. If you're using a monitoring tool like Grafana, this may appear as missing data or empty panels on your dashboard. |

Learn more:

* [Metrics reference](metrics.html)

* [Load testing](load-testing.html)

## Deprecated metric collection

Deprecated metric names are still available until they're removed in a future release and generated only when the `deprecatedMetricsEnabled` property is set to `true` (default) in `conf/metrics.json`. The default preserves backward compatibility for existing dashboards and alerts.

To generate only the replacement metric names, set the property to `false`:

```json
{
    "enabled" : true,
    "deprecatedMetricsEnabled" : false
}
```

For example, if the property is set to `true`, both metric names are generated:

* `managed.managed-object.script.script-name` ([API deprecated metric](../release-notes/changed-functionality.html#managed-object-script-name-dep))

* `managed-script-hook.object.script-hook` ([API replacement metric](api-metrics.html#changed-managed-object-script-hook-metric))

* `idm_managed_seconds{managed_object="managed_object",operation="operation_name",script="script_name"}` ([Prometheus deprecated metric](../release-notes/changed-functionality.html#managed-seconds-managed-object-dep))

* `idm_managed_script_hook_seconds{object="object",script_hook="script_hook"}` ([Prometheus replacement metric](prometheus-metrics.html#changed-managed-object-script-hook-metric-prom))

## Dropwizard widget

|   |                                                                                                                                                                                          |
| - | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | Widgets are deprecated and will be removed in a future release of IDM. For more information, refer to [Deprecation](../release-notes/deprecated-functionality.html#deprecation-widgets). |

The Dropwizard widget creates a graph of metrics based on server activity and is useful for lightweight, live monitoring of IDM. The widget has the following limitations:

* The graph created by the widget does not persist. If you reload or navigate away from the page, the graph restarts.

* The widget only works with time-based metrics.

To add the Dropwizard widget:

1. From the navigation bar, click Dashboards > Dashboard Name.

2. On the Dashboard Name page, click Add Widget.

3. In the Add Widget window, from the Select a Widget drop-down list, select Dropwizard Table with Graph.

   ![Add widget window with dropwizard selected](_images/add-widget-window-dropwizard.png)

4. To preview any metric on the graph, click Add to Graph adjacent to any metric.

5. Click Add.

   The Dropwizard widget now displays on the dashboard.

## Prometheus endpoint

This topic describes how to configure Prometheus and Grafana to collect IDM metrics. These third-party tools are *not* supported by Ping. Refer to the [Prometheus documentation](https://prometheus.io/docs/introduction/overview/).

Prometheus is a third-party tool used for gathering and processing monitoring data. Prometheus uses the `openidm/metrics/prometheus` endpoint to gather information. This endpoint is protected by a basic authentication filter, using the following credentials, set in the `resolver/boot.properties` file:

```properties
openidm.prometheus.username=username
openidm.prometheus.password=password
```

|   |                                                                                                                                                                                                                                                                                         |
| - | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | Storing secrets and passwords directly in configuration and property files is [deprecated](../release-notes/deprecated-functionality.html#deprecation-secrets-in-config). The Prometheus endpoint supports [Secret stores](../security-guide/secret-stores.html) for secret resolution. |

### Disable Prometheus

To disable IDM's Prometheus handler:

1. Comment out or remove `openidm.prometheus.username` and `openidm.prometheus.password` from the `resolver/boot.properties` file.

2. Remove or don't define the `idm.prometheus.credentials` purpose.

   If these properties and purpose aren't set, IDM doesn't enable the Prometheus handler.

### Configure Prometheus

1. Download [Prometheus](https://prometheus.io/).

2. Create a `prometheus.yml` configuration file. For more information, refer to the [Prometheus configuration documentation](https://prometheus.io/docs/prometheus/latest/configuration/configuration/). An example `prometheus.yml` file:

   ```yaml
   global:
     scrape_interval: 15s
     external_labels:
       monitor: 'my_prometheus'

   # https://prometheus.io/docs/operating/configuration/#scrape_config
   scrape_configs:
     - job_name: 'openidm'
       scrape_interval: 15s
       scrape_timeout: 5s
       metrics_path: 'openidm/metrics/prometheus'
       scheme: http
       basic_auth:
         username: 'prometheus'
         password: 'prometheus'
       static_configs:
         - targets: ['localhost:8080']
   ```

   This example configures Prometheus to poll the `openidm/metrics/prometheus` endpoint every 5 seconds (`scrape_interval: 5s`), receiving metrics in a plain text format (`_fields: ['text']` and `_mimeType: ['text/plain;version=0.0.4']`). For more information about reporting formats, refer to the Prometheus documentation on [Exposition Formats](https://prometheus.io/docs/instrumenting/exposition_formats/).

3. Verify the configuration returns metric results:

   Request

   ```console
   curl \
   --user prometheus:prometheus \
   --header "Accept-API-Version: resource=1.0" \
   --request GET \
   'http://localhost:8080/openidm/metrics/prometheus'
   ```

   > **Collapse: Show example response**
   >
   > Response
   >
   > ```console
   > # HELP idm_jvm_available_cpus Automatically generated
   > # TYPE idm_jvm_available_cpus gauge
   > idm_jvm_available_cpus 10.0
   > # HELP idm_jvm_class_loading_loaded Automatically generated
   > # TYPE idm_jvm_class_loading_loaded gauge
   > idm_jvm_class_loading_loaded 24876.0
   > # HELP idm_jvm_class_loading_unloaded Automatically generated
   > # TYPE idm_jvm_class_loading_unloaded gauge
   > idm_jvm_class_loading_unloaded 1.0
   > # HELP idm_jvm_free_used_memory_bytes Automatically generated
   > # TYPE idm_jvm_free_used_memory_bytes gauge
   > idm_jvm_free_used_memory_bytes 9.77543264E8
   > # HELP idm_jvm_garbage_collector_g1_old_generation_count Automatically generated
   > # TYPE idm_jvm_garbage_collector_g1_old_generation_count gauge
   > idm_jvm_garbage_collector_g1_old_generation_count 0.0
   > # HELP idm_jvm_garbage_collector_g1_old_generation_time Automatically generated
   > # TYPE idm_jvm_garbage_collector_g1_old_generation_time gauge
   > idm_jvm_garbage_collector_g1_old_generation_time 0.0
   > # HELP idm_jvm_garbage_collector_g1_young_generation_count Automatically generated
   > # TYPE idm_jvm_garbage_collector_g1_young_generation_count gauge
   > idm_jvm_garbage_collector_g1_young_generation_count 82.0
   > # HELP idm_jvm_garbage_collector_g1_young_generation_time Automatically generated
   > # TYPE idm_jvm_garbage_collector_g1_young_generation_time gauge
   > idm_jvm_garbage_collector_g1_young_generation_time 2127.0
   > # HELP idm_jvm_max_memory_bytes Automatically generated
   > # TYPE idm_jvm_max_memory_bytes gauge
   > idm_jvm_max_memory_bytes 2.147483648E9
   > ...
   > ```

4. Start Prometheus with the `prometheus.yml` configuration file:

   ```console
   prometheus --config.file=/path/to/prometheus.yml
   ```

5. To confirm that Prometheus is gathering data from IDM, go to the Prometheus monitoring page (default `http://localhost:9090`).

   ![prometheus main page](_images/prometheus-main-page.png)

You can store your Prometheus credentials in the `idm.prometheus.credentials` well-defined purpose. This can allow for zero-downtime credentials rotation. For more information, refer to [Store Prometheus credentials as a secret](../security-guide/secret-stores.html#secret-rotation-prometheus).

### Configure Grafana

|   |                                                                                                                                                                                                                                                               |
| - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | IDM generates metrics only after a corresponding event occurs. For example, IDM doesn't create login-related metrics until a user logs in. If you're using a monitoring tool like Grafana, this may appear as missing data or empty panels on your dashboard. |

Prometheus lets you monitor and process information provided by IDM. If you need deeper analytics, you can use tools such as Grafana to create customized charts and graphs based on Prometheus data. For information on installing and running Grafana, refer to the [Grafana website](https://grafana.com).

You can also monitor aspects of IDM's performance using Prometheus to plug JVM metrics into a Grafana dashboard. For more information on using metrics to observe the system under load, refer to [Load testing](load-testing.html).

|   |                                                                                                                                                                                                                                                                      |
| - | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | Before you get started, download the *Monitoring Dashboard Samples* from the [Backstage download site](https://backstage.forgerock.com/downloads). Open `monitoring.dashboard.json` from the downloaded .zip file, as you'll need it during the following procedure. |

To set up a Grafana dashboard with IDM metrics using Prometheus:

1. In a browser, go to the main Grafana page (default `http://localhost:3000`) and log in.

   |   |                                                           |
   | - | --------------------------------------------------------- |
   |   | The default username and password for Grafana is `admin`. |

2. To add your Prometheus installation to Grafana as a data source, click the toggle menu button ![grafana toggle menu](_images/grafana-toggle-menu.svg), and click Connections > Data sources.

3. On the Data sources page, click Add data source.

4. On the Add data source page, select Prometheus.

   ![grafana add prometheus source](_images/grafana-add-prometheus-source.png)

5. Enter information and select options, as needed. The information you enter here should match the settings in the `monitoring.dashboard.json` file:

   1. Give your data source a name; for example, `PingIDM`.

   2. Set the URL (default `http://localhost:9090`).

   3. Enable Basic auth.

      1. Enter the User (default `prometheus`).

      2. Enter the Password (default `prometheus`).

6. Click Save & test.

   If the test succeeds, Grafana displays Data source is working.

### Create a Grafana dashboard

After Prometheus has been configured as a data source in Grafana, you can create a dashboard with IDM metrics:

1. In Grafana, click the toggle menu button ![grafana toggle menu](_images/grafana-toggle-menu.svg), and click Dashboards.

2. Click New, and do one of the following:

   * Select Import.

     1. On the Import dashboard page, drag the `monitoring.dashboard.json` file from its location on your system to the Upload dashboard JSON file area.

     2. Enter information in the Options area, and select the Prometheus data source you previously created.

     3. Click Import.

   * Select New dashboard.

     1. Click Add visualization.

     2. Select the Prometheus data source you previously created.

     3. Configure the panel.

        |   |                                                                                                                                                                                                                                              |
        | - | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
        |   | For more information, refer to:- [Prometheus query language](https://prometheus.io/docs/prometheus/latest/querying/basics/)

        - [Panel editor overview](https://grafana.com/docs/grafana/latest/panels-visualizations/panel-editor-overview/) |
