skywalking集成nacos动态配置
修改config/application.yml
configuration:
selector: ${
SW_CONFIGURATION:nacos}
nacos:
# Nacos Server Host
serverAddr: ${
SW_CONFIG_NACOS_SERVER_ADDR:192.168.229.130}
# Nacos Server Port
port: ${
SW_CONFIG_NACOS_SERVER_PORT:8848}
# Nacos Configuration Group
group: ${
SW_CONFIG_NACOS_SERVER_GROUP:skywalking}
# Nacos Configuration namespace
namespace: ${
SW_CONFIG_NACOS_SERVER_NAMESPACE:db20ccfd-db01-47bd-a4d3-393b4e7df260}
# Unit seconds, sync period. Default fetch every 60 seconds.
period: ${
SW_CONFIG_NACOS_PERIOD:10}
# Nacos auth username
username: ${
SW_CONFIG_NACOS_USERNAME:"nacos"}
password: ${
SW_CONFIG_NACOS_PASSWORD:"nacos"}
添加nacos配置
比如: dataid = configuration-discovery.default.agentConfigurations group = skywalking 内容:
configurations:
demo-application:
agent.trace.ignore_path: "**/actuator/**"
保存以后,在skywalking的控制台会打印如下输出:
Nacos config changed: configuration-discovery.default.agentConfigurations: configurations:
demo-application:
agent.trace.ignore_path: "**/actuator/**"
支持的配置项
configuration-discovery.default.agentConfigurations
配置内容的格式
configurations:
//service name
serviceA:
// Configurations of service A
// Key and Value are determined by the agent side.
// Check the agent setup doc for all available configurations.
key1: value1
key2: value2
...
serviceB:
支持的key
动态配置的用处
比如:可以动态调整需要ignore的endpoint
