Skip to content

marschall/jfr-resttemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JfrRestTemplate Maven Central Javadocs

An implementation of Spring RestTemplate that generates Flight Recorder events.

Flight Recording of some HTTP requests

Versions 2.x are for Spring 6, versions 1.x are for Spring 5.

<dependency>
  <groupId>com.github.marschall</groupId>
  <artifactId>jfr-resttemplate</artifactId>
  <version>2.0.0</version>
</dependency>

This project requires Java 11 based on OpenJDK or later.

Overhead

We try to keep overhead to a minimum and the only additional allocations besides the JFR events are URI#toString().

Usage

@Configuration
public class RestConfiguration {

   @Bean
   public RestOperations restOperations() {
     ClientHttpRequestFactory requestFactory = ...;
     RestOperations restOperations = new RestTemplate(requestFactory);
     return new JfrRestOperations(restOperations);
   }

}