版本:7.0.0
描述
SkyWalking的配置大多数是通过config/application.yml和环境变量来实现。
但是其中有一部分支持通过配置中心动态配置。
目前动态配置的有:
配置key
描述
示例
receiver-trace.default.slowDBAccessThreshold
慢SQL阈值,覆盖application.yml里面receiver-trace/default/slowDBAccessThreshold
default:200,mongodb:50
receiver-trace.default.uninstrumentedGateways
覆盖gateway.yml
详情见gateway.yml
alarm.default.alarm-settings
告警配置,覆盖alarm-settings.yml
详情见alarm-settings.yml
core.default.apdexThreshold
满意阈值配置,覆盖service-apdex-threshold.yml
详情见service-apdex-threshold.yml
动态配置默认是关闭。支持的配置中心有apollo, nacos, zookeeper, etcd, consul。
配置
在application.yml文件下,configuration模块,8.x版本貌似因为安全问题移除了nacos。
Apollo实现
1configuration: 2 selector: ${SW_CONFIGURATION:apollo} 3 apollo: 4 apolloMeta: <your apollo meta address> 5 apolloCluster: default 6 appId: skywalking 7 period: 5
Nacos 实现(8.x版本因为安全问题移除了)
1configuration: 2 selector: ${SW_CONFIGURATION:nacos} 3 nacos: 4 serverAddr: 127.0.0.1 5 port: 8848 6 group: 'skywalking' 7 namespace: '' 8 period : 60 9 clusterName: "default" 10 # ... other configurations
Zookeeper 实现
1configuration: 2 selector: ${SW_CONFIGURATION:zookeeper} 3 zookeeper: 4 period : 60 # Unit seconds, sync period. Default fetch every 60 seconds. 5 nameSpace: /default 6 hostPort: localhost:2181 7 baseSleepTimeMs: 1000 # initial amount of time to wait between retries 8 maxRetries: 3 # max number of times to retry 9 # ... other configurations
Etcd 实现
1configuration: 2 selector: ${SW_CONFIGURATION:etcd} 3 etcd: 4 period : 60 # Unit seconds, sync period. Default fetch every 60 seconds. 5 group : 'skywalking' 6 serverAddr: localhost:2379 7 clusterName: "default" 8 # ... other configurations
Consul 实现
1configuration: 2 selector: ${SW_CONFIGURATION:consul} 3 consul: 4 # Consul host and ports, separated by comma, e.g. 1.2.3.4:8500,2.3.4.5:8500 5 hostAndPorts: 127.0.0.1:8500 6 # Sync period in seconds. Defaults to 60 seconds. 7 period: 60 8 # aclToken of connection consul (optional) 9 aclToken: ${consul.aclToken} 10 # ... other configurations