使用探针

如何获取

本地构建

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

远程下载(暂未发布)

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

配置

找到 agent.yaml 文件:

  1. applicationName: shardingsphere-agent
  2. ignoredPluginNames: # 忽略的插件集合
  3. - Opentracing
  4. - Jaeger
  5. - Zipkin
  6. - Prometheus
  7. - OpenTelemetry
  8. - Logging
  9. plugins:
  10. Prometheus:
  11. host: "localhost"
  12. port: 9090
  13. props:
  14. JVM_INFORMATION_COLLECTOR_ENABLED : "true"
  15. Jaeger:
  16. host: "localhost"
  17. port: 5775
  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"
  26. port: 9411
  27. props:
  28. SERVICE_NAME: "shardingsphere-agent"
  29. URL_VERSION: "/api/v2/spans"
  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" # 多个配置用','分隔
  36. otel.traces.exporter: "zipkin"
  37. Logging:
  38. props:
  39. LEVEL: "INFO"

启动

在启动脚本中添加参数:

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