Catalog

TIPS

This article is based on Skywalking 6.6.0, theoretical support Skywalking 6.5.0 And higher .

from Skywalking 6.5.0 Start , part Skywalking Configuration item support “ Dynamic configuration ”—— After modifying the configuration in this way , There's no need to restart Skywalking La .

The configuration items that support dynamic configuration are as follows :

To configure Key describe Format of value
receiver-trace.default.slowDBAccessThreshold Threshold of slow access to database , This value will override applciation.yml In the document receiver-trace/default/slowDBAccessThreshold attribute for example :default:200,mongodb:50
receiver-trace.default.uninstrumentedGateways Non instrument gateway Related configuration , This value will override gateways.yml Same format gateways.yml
alarm.default.alarm-settings The alarm Related configuration , This value will override alarm-settings.yml. Same format alarm-settings.yml
core.default.apdexThreshold apdex threshold Related configuration , This value will override service-apdex-threshold.yml Same format service-apdex-threshold.yml

To achieve dynamic configuration , You need an additional configuration server . After introducing the configuration server , The architecture is as follows :

Skywalking Support the following configuration server :

For now , except Dynamic Configuration Service It's not complete yet , The rest can be used directly in production .

below , With Nacos For example , Explain how to use Nacos Realize dynamic configuration , For other configuration servers, click on the link above , Check out the official documents .

build Nacos Server

install

  • Go to https://github.com/alibaba/nacos/releases Download the appropriate version , This article USES Nacos 1.1.4

  • According to your operating system , To bin The directory executes the corresponding command , You can start Nacos.

    1
    2
    3
    4
    5
    # Linux/Unix/Mac
    sh startup.sh -m standalone

    # Windows
    cmd startup.cmd
  • After starting , visit http://127.0.0.1:8848/nacos You can see an interface similar to the following :

    Nacos The login page

  • Enter the account and password :nacos/nacos , You can go to the home page .

stop it

According to your operating system , To bin The directory executes the corresponding command , Just stop Nacos:

1
2
3
4
5
# Linux/Unix/Mac
sh shutdown.sh

# Windows
cmd shutdown.cmd

Skywalking Use Nacos Configuration management

  • modify Skywalking Of application.yml, find :

    1
    2
    3
    4
    configuration:
    none:
    Comment out none This business , Change to :
    # none

    Untie Nacos Related configuration :

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    configuration:
    nacos:
    # Nacos Server IP
    serverAddr: 127.0.0.1
    # Nacos Server port
    port: 8848
    # Nacos Group
    group: 'skywalking'
    # Nacos namespace
    namespace: ''
    # How long from Nacos Server Last synchronization configuration , Unit second
    period : 60
    # Cluster name
    clusterName: "default"
  • Take the example of managing alarm rules , stay Nacos Server To create a DataId by alarm.default.alarm-settings ( Other configurations are similar to , Refer to the table at the top of this article ), Configured values refer to alarm-settings.yml Writing . for example :

    1
    2
    3
    4
    5
    6
    7
    8
    9
    rules:
    service_resp_time_rule:
    metrics-name: service_resp_time
    op: ">"
    threshold: 1
    period: 2
    count: 1
    silence-period: 5
    message: Response time of service {name} is more than 1ms in 1 minutes of last 2 minutes.

Related articles