Agent Integration

Background

ShardingSphere-Agent is an independent and independently designed project based on ByteBuddy bytecode increase. Based on plugin design, it can integrate seamlessly with ShardingSphere. There are currently Log, metrics, APM and other observability capabilities available.

Usage

Local build

  1. > cd shardingsphere/shardingsphere-agent
  2. > mvn clean install

Remote download(No release)

  1. > weget http://xxxxx/shardingsphere-agent.tar.gz
  2. > tar -zxvcf shardingsphere-agent.tar.gz

Add startup arguments

  1. -javaagent:\absolute path\shardingsphere-agent.jar

Agent Configuration

It is found under the local package directory and unzip directory : agent.yaml

  1. applicationName: shardingsphere-agent # application name
  2. ignoredPluginNames: # A collection of ignored plugins, indicating that the plugins in the collection are not active
  3. - Opentracing
  4. - Jaeger
  5. - Zipkin
  6. - Prometheus
  7. - OpenTelemetry
  8. - Logging
  9. plugins:
  10. Prometheus:
  11. host: "localhost" #prometheus host
  12. port: 9090 #prometheus port
  13. props:
  14. JVM_INFORMATION_COLLECTOR_ENABLED : "true"
  15. Jaeger:
  16. host: "localhost" #jaeger host
  17. port: 5775 #jaeger prot
  18. props:
  19. SERVICE_NAME: "shardingsphere-agent"
  20. JAEGER_SAMPLER_TYPE: "const"
  21. JAEGER_SAMPLER_PARAM: "1"
  22. JAEGER_REPORTER_LOG_SPANS: "true"
  23. JAEGER_REPORTER_FLUSH_INTERVAL: "1"
  24. Zipkin:
  25. host: "localhost" #zipkin host
  26. port: 9411 #zipkin prot
  27. props:
  28. SERVICE_NAME: "shardingsphere-agent"
  29. URL_VERSION: "/api/v2/spans" #zipkin uri
  30. Opentracing:
  31. props:
  32. OPENTRACING_TRACER_CLASS_NAME: "org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer"
  33. OpenTelemetry:
  34. props:
  35. otel.resource.attributes: "service.name=shardingsphere-agent" #Resource information of opentelemetry, multiple configurations can be separated by ','
  36. otel.traces.exporter: "zipkin" #the exporter of traces
  37. Logging:
  38. props:
  39. LEVEL: "INFO" #log level

When ignoredPluginNames is configured, plugins in the collection are ignored!