# Monitoring REST APIs with Custom JDK Flight Recorder Events

DevFeed: [Monitoring REST APIs with Custom JDK Flight Recorder Events](<https://devfeed.tech/articles/monitoring-rest-apis-with-custom-jdk-flight-recorder-events-18864.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/rest-api-monitoring-with-custom-jdk-flight-recorder-events/>)

Published: 2020-01-29T14:30:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [Java](<https://devfeed.tech/topics/java.md>), [Grafana](<https://devfeed.tech/topics/grafana.md>), [Prometheus](<https://devfeed.tech/topics/prometheus.md>)

Tags: [grafana](<https://devfeed.tech/tags/grafana.md>), [java](<https://devfeed.tech/tags/java.md>), [jdk-flight-recorder](<https://devfeed.tech/tags/jdk-flight-recorder.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [prometheus](<https://devfeed.tech/tags/prometheus.md>), [rest](<https://devfeed.tech/tags/rest.md>), [rest-apis](<https://devfeed.tech/tags/rest-apis.md>)

## AI overview

This tutorial explains how custom JDK Flight Recorder events can monitor a REST API, including tracking request counts and identifying long-running requests. It also describes using the JFR Event Streaming API to export live events for monitoring and alerting with Prometheus and Grafana.

## Source excerpt

Table of Contents Custom Flight Recorder Events Creating JFR Recordings Event Settings JFR Event Streaming MicroProfile Metrics Summary and Related Work The JDK Flight Recorder (JFR) is an invaluable tool for gaining deep insights into the performance characteristics of Java applications. Open-sourced in JDK 11, JFR provides a low-overhead framework for collecting events from Java applications, the JVM and the operating system. In this blog post we're going to explore how custom, application-specific JFR events can be used to monitor a REST API, allowing to track request counts, identify long-running requests and more. We'll also discuss how the JFR Event Streaming API new in Java 14 can be used to export live events, making them available for monitoring and alerting via tools such as Prometheus and Grafana.