Skip to content

Commit 33839e9

Browse files
committed
update config docs with v2 format
1 parent 1ad22e7 commit 33839e9

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

docs/add_new_configurations.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,40 @@ In order to properly add a new configuration in the library, follow the below st
3232
1. This field should be final and not changed during runtime. If the value of a configuration needs to be changed, it can be done through a Snapshot with Dynamic Configuration. See [DynamicConfig.java](../internal-api/src/main/java/datadog/trace/api/DynamicConfig.java).
3333
5. Create a getter for the field in `Config.java` to allow other classes to access the value of the configuration.
3434
6. Add the configuration to the `toString()` method of `Config.java` for logging purposes.
35-
7. Add the Environment Variable name of the configuration to the `supportedConfigurations` key of `metadata/supported-configurations.json` in the format of `ENV_VAR: ["VERSION", ...]`. If the configuration already existed in another library, add the version listed on the Feature Parity Dashboard. If introducing a new configuration, provide a version of `A`.
36-
1. If there are aliases of the Environment Variable, add them to the `aliases` key of the file.
35+
7. Add the Environment Variable name of the configuration to the `supportedConfigurations` key of `metadata/supported-configurations.json`.
36+
1. The key is the Environment Variable name, and the value is an array of objects with the following fields:
37+
1. Version.
38+
1. If introducing a new configuration, provide a version of `A`.
39+
2. If the configuration already exists in the Feature Parity Dashboard and has the same implementation details as an existing Configuration Version, add the version listed on the Feature Parity Dashboard. Else, introduce a new Configuration Version, fill in the proper documentation, and use the version provided.
40+
2. Type. This is a _mandatory_ field and has the options of boolean, int, decimal, string, map, array. If the configuration is eventually converted to an Enum or other class, use type String.
41+
3. Default. This is a _mandatory_ field and accepts null as a valid value.
42+
4. Aliases. This is a _mandatory_ field. If there are no aliases for the configuration, use an empty array as the value.
43+
5. PropertyKeys. This is an _optional_ field that should only be used if there are additional telemetry keys being sent from the tracer (that are not the environment variable itself).
3744

38-
See below for the format of the `supported-configurations.json` file.
45+
See below for an example of the `supported-configurations.json` file.
3946
```
4047
{
4148
"supportedConfigurations": {
42-
"DD_ENV_VAR": ["A"],
43-
"DD_TEST_VAR": ["A"]
44-
},
45-
"aliases": {
46-
"DD_ENV_VAR": ["DD_ENV_ALIAS"]
47-
},
49+
"DD_SERVICE": [
50+
{
51+
"version": "D", // Mandatory, generated by Feature Parity Dashboard
52+
"type": "string", // Mandatory, choose from boolean, int, decimal, string, map, array
53+
"default": null, // Mandatory, allows null values
54+
"aliases": ["DD_SERVICE_NAME"] // Mandatory, allows empty array if no aliases exist
55+
}
56+
],
57+
"DD_ENV_WITH_TELEMETRY_KEYS": [
58+
{
59+
"version": "A", // Mandatory, generated by Feature Parity Dashboard
60+
"type": "boolean", // Mandatory, choose from boolean, int, decimal, string, map, array
61+
"default": "true", // Mandatory, allows null values
62+
"aliases": [], // Mandatory, allows empty array if no aliases exist
63+
"propertyKeys": ["test.telemetry"] // Optional, If none exist, omit this key
64+
}
65+
],
66+
}
4867
"deprecations": {
68+
"DD_LEGACY_SERVICE_NAME": "use DD_SERVICE instead"
4969
}
5070
}
5171
```

0 commit comments

Comments
 (0)