Retrieve System Metrics Using Prometheus

This page contains the API that is used for retrieving FusionAuth application metrics to be used with Prometheus. Please refer to the Prometheus setup guide to understand how to set up Prometheus with the FusionAuth metrics endpoint.

By default, this API requires authentication. If you prefer to allow unauthenticated access to this endpoint from local scrapers, you may set fusionauth-app.local-metrics.enabled=true. See the configuration reference for more info.

Global API Key AuthenticationBasic Authentication using an API KeyLocalhost Authentication Bypass
Retrieve FusionAuth application metrics to use with Prometheus
GET/api/prometheus/metrics

Request#

Request Parameters#

There are no request parameters required with this API.

Response#

The response to this API call contains currently available metrics. The metrics in this response are subject to change.

The following types of gauges are currently available.

  • JVM Buffers - A set of gauges for the count, usage, and capacity of the JVM's direct and mapped buffer pools.
  • JVM class loading - A set of gauges for JVM classloader usage.
  • JVM garbage collection - A set of gauges for the counts and elapsed times of garbage collections.
  • JVM memory - A set of gauges for JVM memory usage, including stats on heap vs non-heap memory.
  • JVM threads - A set of gauges for the number of threads in their various states and deadlock detection.
  • Other JVM attributes - A Gauge implementation which queries an MBeanServerConnection for an attribute of an object.

Example Prometheus Response

  # HELP jvm_memory_heap_committed Generated from Dropwizard metric import (metric=jvm.memory.heap.committed, type=com.codahale.metrics.jvm.MemoryUsageGaugeSet$8)
# TYPE jvm_memory_heap_committed gauge
jvm_memory_heap_committed 5.36870912E8
# HELP jvm_memory_non_heap_used Generated from Dropwizard metric import (metric=jvm.memory.non-heap.used, type=com.codahale.metrics.jvm.MemoryUsageGaugeSet$11)
# TYPE jvm_memory_non_heap_used gauge
jvm_memory_non_heap_used 1.66423384E8
# HELP jvm_memory_pools_CodeHeap__non_profiled_nmethods__used Generated from Dropwizard metric import (metric=jvm.memory.pools.CodeHeap-'non-profiled-nmethods'.used, type=com.codahale.metrics.jvm.MemoryUsageGaugeSet$17)
# TYPE jvm_memory_pools_CodeHeap__non_profiled_nmethods__used gauge
jvm_memory_pools_CodeHeap__non_profiled_nmethods__used 3.0334336E7
# HELP prime_mvc___admin_group_index__requests Generated from Dropwizard metric import (metric=prime-mvc.[/admin/group/index].requests, type=com.codahale.metrics.Timer)
# TYPE prime_mvc___admin_group_index__requests summary
prime_mvc___admin_group_index__requests{quantile="0.5",} 0.0
prime_mvc___admin_group_index__requests{quantile="0.75",} 0.0
prime_mvc___admin_group_index__requests{quantile="0.95",} 0.0
prime_mvc___admin_group_index__requests{quantile="0.98",} 0.0
prime_mvc___admin_group_index__requests{quantile="0.99",} 0.0
prime_mvc___admin_group_index__requests{quantile="0.999",} 0.0
prime_mvc___admin_group_index__requests_count 1.0