EaseAgent is a Javaagent that can be integrated with the mainstream monitoring system, providing standard data formats that are fully compatible with OpenZipkin and Prometheus. EaseAgent is also very easy to extend through the Plugin Mechanism which only a minimum of three interfaces are required to be implemented to complete a plugin development.
EaseAgent
A lightweight & opening Java Agent for Cloud-Native and APM system
Purpose
Principles
Features
Easy to use. It is right out of the box for Metrics, Tracing and Logs collecting.
JDBC 4.0
HTTP Servlet
、HTTP Filter
Spring Boot 2.2.x
: WebClient
、 RestTemplate
、FeignClient
RabbitMQ Client 5.x
、 Kafka Client 2.4.x
Jedis 3.5.x
、 Lettuce 5.3.x (sync、async)
ElasticSearch Client >= 7.x (sync、async)
Mongodb Client >=4.0.x (sync、async)
Motan
Dubbo
SofaRpc >= 5.3.0
HTTP Servlet
、HTTP Filter
Spring Cloud Gateway
traceId
and spanId
into user application logging automaticallyhealth check
endpointreadiness check
endpoint for SpringBoot2.2.x
agent info
endpointData Reports
Easy to Extend
Tracing
and Metric
API, with a small amount of code to achieve business support.Standardization
Prometheus
.Opentelemetry
data format.Description
Plugin Framework in core
module is base on Byte buddy technology.
Points
and what to do at the point of enhancement by implementing the Interceptor
.unique index
(uid) owned by the method will be used as a parameter to call the common interface of Agent Common Method Advice
, which finds the Agent Interceptor Chain
by the Unique Index
and calls the before
method of each Interceptor in the chain in order of priority.Metric Interceptor
and the Tracing Interceptor
are in the agent interceptor chain and are called sequentially.Metric API
and Tracing API
in interceptors, the Metric
and Tracing
information will be stored in MetricRegistry
and Tracing
.Reporter
module will get information from MetricRegistry
and Tracing
and send it to Kafka
.after
method of each interceptor in the Agent Interceptor Chain
will be invoked in the reverse order of the before
invoked at last.tracing
data can be sent to kafka
server or zipkin
server, the metric
data can be sent to kafka
server and pull by Prometheus
server.QuickStart Get And Set Environment Variable
Setup Environment Variable and then download the latest release of easeagent.jar
or build it from the source.
Setup Environment Variable
$ cd ~/easeagent #[Replace with agent path]
$ export EASE_AGENT_PATH=pwd
# export EASE_AGENT_PATH=[Replace with agent path]
$ mkdir plugins
Download
Download easeagent.jar
from releases releases.
$ curl -Lk https://github.com/megaease/easeagent/releases/latest/download/easeagent.jar -O
Build From the Source
You need Java 1.8+ and git:
Download EaseAgent with git clone https://github.com/megaease/easeagent.git
.
$ cd easeagent
$ mvn clean package -Dmaven.test.skip
$ cp ./build/target/easeagent-dep.jar $EASE_AGENT_PATH/easeagent.jar
The ./build/target/easeagent-dep.jar
is the agent jar with all the dependencies.
For the Windows platform, please make sure git
core.autocrlf
is set to false before git clone. You can usegit config --global core.autocrlf false
to modifycore.autocrlf
.
How to use easeagent.jar on host?
How to use easeagent.jar in docker?
Get Configuration file
Extracting the default configuration file.
$ cd $EASE_AGENT_PATH
$ jar xf easeagent.jar agent.properties easeagent-log4j2.xml
By default, there is an agent.properties configuration file, which is configured to print all output data to the console.
Monitor Spring Petclinic Prerequisites
Initialize and Start the project
$ git clone https://github.com/megaease/easeagent-spring-petclinic.git
$ cd easeagent-spring-petclinic
$ git submodule update --init
$ ./spring-petclinic.sh start
The script will download the latest release of EaseAgent. If you want to use your own built EaseAgent, copy it to the directory:
easeagent/downloaded
$ cp $EASE_AGENT_PATH/easeagent.jar easeagent/downloaded/easeagent-latest.jar
It requires Docker
to pull images from the docker hub, be patient.
Open Browser to visit grafana UI: http://localhost:3000.
Metric
Click the search dashboards
, the first icon in the left menu bar. Choose the spring-petclinic-easeagent
to open the dashboard we prepare for you.
Prometheus Metric Schedule: Prometheus Metric
Tracing
If you want to check the tracing-data, you could click the explore in the left menu bar. Click the Search - beta to switch search mode. Click search query button in the right up corner, there is a list containing many tracing. Choose one to click.
Build Spring Petclinic
Add an Enhancement Plugin
Add a Demo Plugin to EaseAgent
User Manual
For more information, please refer to the User Manual.
Enhancement Plugin Development Guide
Refer to Plugin Development Guide.
Report Plugin Development Guide
Report plugin enables user report tracing/metric data to different kinds of the backend in a different format.
Refer to Report Plugin Development Guide
Community
If you have any questions, welcome to discuss them in our community. Welcome to join!
Licenses
EaseAgent is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
Twice a month we will interview people behind open source businesses. We will talk about how they are building a business on top of open source projects.
We'll never share your email with anyone else.