栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

skywalking集成nacos动态配置

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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"}

参考:https://skywalking.apache.org/docs/main/v9.1.0/en/setup/backend/dynamic-config-nacos/

添加nacos配置

比如:
dataid = configuration-discovery.default.agentConfigurations
group = skywalking
内容:

configurations:
  demo-application:
    agent.trace.ignore_path: "**/actuatoractuator/**"
支持的配置项

参考:https://skywalking.apache.org/docs/main/v9.1.0/en/setup/backend/dynamic-config/

keyValue DescriptionValue Format Example
agent-analyzer.default.slowDBAccessThresholdThresholds of slow Database statement. Overrides agent-analyzer/default/slowDBAccessThreshold of application.yml.default:200,mongodb:50
agent-analyzer.default.uninstrumentedGatewaysThe uninstrumented gateways. Overrides gateways.ymlSame as gateways.yml
alarm.default.alarm-settingsThe alarm settings. Overrides alarm-settings.ymlSame as alarm-settings.yml
core.default.apdexThresholdThe apdex threshold settings. Overrides service-apdex-threshold.ymlSame as service-apdex-threshold.yml
core.default.endpoint-name-groupingThe endpoint name grouping setting. Overrides endpoint-name-grouping.ymlSame as endpoint-name-grouping.yml
core.default.log4j-xmlThe log4j xml configuration. Overrides log4j2.xmlSame as log4j2.xml
agent-analyzer.default.traceSamplingPolicyThe sampling policy for default and service dimension, override trace-sampling-policy-settings.ymlsame as trace-sampling-policy-settings.yml
configuration-discovery.default.agentConfigurationsThe ConfigurationDiscovery settings.See configuration-discovery.md
configuration-discovery.default.agentConfigurations

参考:https://github.com/apache/skywalking-java/blob/20fb8c81b3da76ba6628d34c12d23d3d45c973ef/docs/en/setup/service-agent/java-agent/configuration-discovery.md

配置内容的格式
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
Key
agent.sample_n_per_3_secs
agent.ignore_suffix
agent.trace.ignore_path
agent.span_limit_per_segment
动态配置的用处

比如:可以动态调整需要ignore的endpoint

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/998882.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号