Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 29 additions & 9 deletions docs/add_new_configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,40 @@ In order to properly add a new configuration in the library, follow the below st
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).
5. Create a getter for the field in `Config.java` to allow other classes to access the value of the configuration.
6. Add the configuration to the `toString()` method of `Config.java` for logging purposes.
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`.
1. If there are aliases of the Environment Variable, add them to the `aliases` key of the file.
7. Add the Environment Variable name of the configuration to the `supportedConfigurations` key of `metadata/supported-configurations.json`.
1. The key is the Environment Variable name, and the value is an array of objects with the following fields:
1. Version.
1. If introducing a new configuration, provide a version of `A`.
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.
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.
3. Default. This is a _mandatory_ field and accepts null as a valid value.
4. Aliases. This is a _mandatory_ field. If there are no aliases for the configuration, use an empty array as the value.
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).

See below for the format of the `supported-configurations.json` file.
See below for an example of the `supported-configurations.json` file.
```
{
"supportedConfigurations": {
"DD_ENV_VAR": ["A"],
"DD_TEST_VAR": ["A"]
},
"aliases": {
"DD_ENV_VAR": ["DD_ENV_ALIAS"]
},
"DD_SERVICE": [
{
"version": "D", // Mandatory, generated by Feature Parity Dashboard
"type": "string", // Mandatory, choose from boolean, int, decimal, string, map, array
"default": null, // Mandatory, allows null values
"aliases": ["DD_SERVICE_NAME"] // Mandatory, allows empty array if no aliases exist
}
],
"DD_ENV_WITH_TELEMETRY_KEYS": [
{
"version": "A", // Mandatory, generated by Feature Parity Dashboard
"type": "boolean", // Mandatory, choose from boolean, int, decimal, string, map, array
"default": "true", // Mandatory, allows null values
"aliases": [], // Mandatory, allows empty array if no aliases exist
"propertyKeys": ["test.telemetry"] // Optional, If none exist, omit this key
}
],
}
"deprecations": {
"DD_LEGACY_SERVICE_NAME": "use DD_SERVICE instead"
}
}
```
Expand Down