Profile Data Collection
Profile Data
Also refered to as the static data that is generated when a process starts. Profile data includes the information related to the operation system and processes as well as the initializtion information after the process starts.
Start InterceptFrameworkSupportor with the start method. Add listener to the listener property of the InterceptSupportor instance first, traverse listeners of InterceptSupporter with JavaAgent tracking and invoke the doIntercept method. In the doIntercept method, invoke the handleEvent method of InterceptEventListener. InterceptEventListener is the parent class of all listeners, which enables different subclasses to process different profile collections.
Service Profile Collection
The service profile describes information about the service itself, including AppID, Service ID, URI of the service instance, and the metadata (class, method, input and output parameters, annotation and deployment descriptor) of the service interface.
The AppProfilingListener collects the service profile. The handleEvent method invokes the startProfiling method to start the profile and completes the collection with StandardProfile.doProfiling.
Please refer to com.creditease.uav.profiling.handlers.ComponentProfileHandler for detailed codes of the service profile.
Provenance Data Collection
Fields in the header of the Http protocol can help with the provenance. Data collected can be classified as below:
- Client address: IP of the directly connected client
- X-Forwarded-For: address chain of the proxy routing if any and the directly connected client would be the proxy service
- Host: display the remote host, even the port information. The host shall be the proxy IP address and the port if the directly connected client is the proxy service
- User-Agent: agent description that distinguishes browsers from clients and abstracts the terminal information of browsers
- UAV-Client-Src: header fields added during Http client hooking, which is used for invocation fitting among applications
Client Profile Collection
The client profile is implemented by hooking the clients of multiple frequently used middleware. It supports synchronous / asynchronous Http, jdbc, Redis(jedis,aredis,lettuce), MongoDB and RocketMQ/rabbitmq.
Build the UAV processing logic into the codes invoked from the clients with AOP technologies (such as javassist bytecode rewriting and dynamic proxy) and obtain relevant invocation information, including the invocation address, invocation protocol and invocation results.
The profile data determines the target service based on the invocation address, access protocol and characteristics of the invocation result. 1) Invocation address: in the format similar to URI
- http/https service (business / proxy service): http://<IP>:<port>/<service path>
- Relational database (data source service):jdbc:<database type>://<IP>:<port>,<IP>:<port>/<database name>
- Non-relational database or cache (data source service):jdbc:<data source type>://<IP>:<port>,<IP>:<port>/<name of the database set>
- Message queue (message service): mq:<message middleware type>://<IP>:<port>/<queue name>
2) Access protocol: an access action, such as Http POST, SQL insertion, information delivering/subscribing, hgethashall of Redis and collection of Mongo
3) Characteristics of access results: types of basic stacks of a service; cluster (such as Ngnix, Tomcat and Apache) or not
Please refer to com.creditease.uav.profiling.handlers. ClientRespTimeCapHandler for detailed codes of the profile