APM

Background

APM is the abbreviation of Application Performance Monitoring. Currently its core function is the performance diagnosis of distributed system, including call chain demonstration, application topology analysis, etc.

Sharding-Sphere Team work with SkyWalking Team to introduce an automatic monitor agent of Sharding-Sphere to send tracing data of Sharding-Sphere to SkyWalking.

Usage

Using OpenTracing

  • Inject the Tracer implementation class through System.properties

    System.Properties:-Dio.shardingsphere.opentracing.tracer.class=org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer
    mehtod:ShardingTracer.init()                          
    
  • Inject the Tracer implementation class through method parameter

    shardingTracer.init(new SkywalkingTracer())   
    

Notices: When using SkyWalking’s OpenTracing monitor agent, disabling the original Sharding-Sphere monitor agent plugin is necessary to avoid conflicting with each other.

Using SkyWalking

Please refer to SkyWalking Manual.

UI

Application schema

Using Sharding-Proxy to access two databases of 192.168.0.1:3306 and 192.168.0.2:3306, each owns two tables in database.

Topology diagram

The topology diagram

User accesses the Sharding-Proxy 18 times, each database is accessed twice each time. This is because one access involves two splitting tables in each database, four tables in total.

Tracking diagram

The tracking diagram

You can see SQL parsing and execution in this figure.

/Sharding-Sphere/parseSQL/: Represents the parsing performance of this SQL.

The parsing node

/Sharding-Sphere/executeSQL/: Represents the performance of the actual SQL.

The actual access node

Exception diagram

Exception tracking diagram

You can see Exceptions in this figure.

/Sharding-Sphere/executeSQL/ : Represents the Exceptions of the actual SQL.

Exception node

/Sharding-Sphere/executeSQL/ : Represents the Exception logs of the actual SQL.

Exception log