• /
  • Log in

Java agent API: Custom instrumentation with annotation of an example app

The New Relic Java agent API lets you set up custom instrumentation for your Java application. This document shows an example of using custom instrumentation with annotation in an imaginary application.

Important

For best results when using the API, ensure you have the latest Java agent release.

Complete example app using API

Below is an example of an imaginary store app's servlet using the Java agent API.

Tip

If you copy and paste example code, be sure to use appropriate spacing on your command lines.

How the example uses the API

Here is the same example app divided into sections that describe how the API is used:

For more help

If you need more help, check out these support and learning resources:

Create issueEdit page
Copyright © 2021 New Relic Inc.