SkyWalking 动态配置

版本: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实现

configuration:
  selector: ${SW_CONFIGURATION:apollo}
  apollo:
    apolloMeta: <your apollo meta address>
    apolloCluster: default
    appId: skywalking
    period: 5

Nacos 实现(8.x版本因为安全问题移除了)

configuration:
  selector: ${SW_CONFIGURATION:nacos}
  nacos:
    serverAddr: 127.0.0.1
    port: 8848
    group: 'skywalking'
    namespace: ''
    period : 60
    clusterName: "default"
  # ... other configurations

Zookeeper 实现

configuration:
  selector: ${SW_CONFIGURATION:zookeeper}
  zookeeper:
    period : 60 # Unit seconds, sync period. Default fetch every 60 seconds.
    nameSpace: /default
    hostPort: localhost:2181
    baseSleepTimeMs: 1000 # initial amount of time to wait between retries
    maxRetries: 3 # max number of times to retry
  # ... other configurations

Etcd 实现

configuration:
  selector: ${SW_CONFIGURATION:etcd}
  etcd:
    period : 60 # Unit seconds, sync period. Default fetch every 60 seconds.
    group :  'skywalking'
    serverAddr: localhost:2379
    clusterName: "default"
  # ... other configurations

Consul 实现

configuration:
  selector: ${SW_CONFIGURATION:consul}
  consul:
    # Consul host and ports, separated by comma, e.g. 1.2.3.4:8500,2.3.4.5:8500
    hostAndPorts: 127.0.0.1:8500
    # Sync period in seconds. Defaults to 60 seconds.
    period: 60
    # aclToken of connection consul (optional)
    aclToken: ${consul.aclToken}
  # ... other configurations

评论

暂无评论