dynamic-config.md 3.9 KB
Newer Older
1
# Dynamic Configuration
W
Wing 已提交
2 3
SkyWalking Configurations are mostly set through `application.yml` and OS system environment variables.
At the same time, some of them support dynamic settings from upstream management system.
4

5
Currently, SkyWalking supports the 2 types of dynamic configurations: Single and Group.
6

7 8
This feature depends on upstream service, so it is **DISABLED** by default.

9 10
```yaml
configuration:
11
  selector: ${SW_CONFIGURATION:none}
12
  none:
13 14 15 16 17
  grpc:
    host: ${SW_DCS_SERVER_HOST:""}
    port: ${SW_DCS_SERVER_PORT:80}
    clusterName: ${SW_DCS_CLUSTER_NAME:SkyWalking}
    period: ${SW_DCS_PERIOD:20}
18
  # ... other implementations
19
```
20 21
## Single Configuration
Single Configuration is a config key that corresponds to a specific config value. The logic structure is:
22
```
23
{configKey}:{configVaule}
24
```
25
For example:
A
Alan Lau 已提交
26
```
27
{agent-analyzer.default.slowDBAccessThreshold}:{default:200,mongodb:50}
28
```
29
Supported configurations are as follows:
30

31 32 33 34 35 36 37 38 39 40
| Config Key | Value Description | Value Format Example |
|:----:|:----:|:----:|
|agent-analyzer.default.slowDBAccessThreshold| Thresholds of slow Database statement. Overrides `receiver-trace/default/slowDBAccessThreshold` of `application.yml`. | default:200,mongodb:50|
|agent-analyzer.default.uninstrumentedGateways| The uninstrumented gateways. Overrides `gateways.yml`. | Same as [`gateways.yml`](uninstrumented-gateways.md#configuration-format). |
|alarm.default.alarm-settings| The alarm settings. Overrides `alarm-settings.yml`. | Same as [`alarm-settings.yml`](backend-alarm.md). |
|core.default.apdexThreshold| The apdex threshold settings. Overrides `service-apdex-threshold.yml`. | Same as [`service-apdex-threshold.yml`](apdex-threshold.md). |
|core.default.endpoint-name-grouping| The endpoint name grouping setting. Overrides `endpoint-name-grouping.yml`. | Same as [`endpoint-name-grouping.yml`](endpoint-grouping-rules.md). |
|core.default.log4j-xml| The log4j xml configuration. Overrides `log4j2.xml`. | Same as [`log4j2.xml`](dynamical-logging.md). |
|agent-analyzer.default.sampleRate| Trace sampling. Overrides `receiver-trace/default/sampleRate` of `application.yml`. | 10000 |
|agent-analyzer.default.slowTraceSegmentThreshold| Setting this threshold on latency (in milliseconds) would cause slow trace segments to be sampled if they use up more time, even if the sampling mechanism is activated. The default value is `-1`, which means slow traces will not be sampled. Overrides `receiver-trace/default/slowTraceSegmentThreshold` of `application.yml`. | -1 |
41
|configuration-discovery.default.agentConfigurations| The ConfigurationDiscovery settings. | See [`configuration-discovery.md`](https://github.com/apache/skywalking-java/blob/20fb8c81b3da76ba6628d34c12d23d3d45c973ef/docs/en/setup/service-agent/java-agent/configuration-discovery.md). |
42

43 44
## Group Configuration
Single Configuration is a config key that corresponds to a group sub config items. A sub config item is a key value pair. The logic structure is:
45
```
46 47 48 49 50 51 52 53 54 55 56
{configKey}: |{subItemkey1}:{subItemValue1}
             |{subItemkey2}:{subItemValue2}
             |{subItemkey3}:{subItemValue3}
             ...      
```
For example:
```
{core.default.endpoint-name-grouping-openapi}:|{customerAPI-v1}:{value of customerAPI-v1}
                                              |{productAPI-v1}:{value of productAPI-v1}
                                              |{productAPI-v2}:{value of productAPI-v2}
                                              
57
```
58
Supported configurations are as follows:
59

60 61 62 63 64 65 66 67
## Dynamic Configuration Implementations
- [Dynamic Configuration Service, DCS](./dynamic-config-service.md)
- [Zookeeper Implementation](./dynamic-config-zookeeper.md)
- [Etcd Implementation](./dynamic-config-etcd.md)
- [Consul Implementation](./dynamic-config-consul.md)
- [Apollo Implementation](./dynamic-config-apollo.md)
- [Kuberbetes Configmap Implementation](./dynamic-config-configmap.md)
- [Nacos Implementation](./dynamic-config-nacos.md)
68