Home / Companies / Elastic / Blog / Post Details
Content Deep Dive

Create your own instrumentation with the Java Agent Plugin

Blog post from Elastic

Post Details
Company
Date Published
Author
-
Word Count
2,813
Language
-
Hacker News Points
-
Summary

Jack Shirazi's article outlines the process of creating custom instrumentation using the Elastic APM Java Agent Plugin API to monitor Java applications that are not automatically supported by Elastic APM. By leveraging the OpenTelemetry API, developers can add tracing capabilities without modifying the application code directly. The article provides a detailed walkthrough using a simple web server as an example, explaining how to select methods for instrumentation, create spans for tracing, and implement the necessary plugin class by extending the ElasticApmInstrumentation abstract class. The use of the Byte Buddy library for byte-code instrumentation is highlighted, along with practical advice on managing dependencies and ensuring the plugin jar is correctly configured. The article concludes with troubleshooting tips and emphasizes the benefits of running the system on Elastic Cloud.