Skip to content

Commit 02c0c14

Browse files
committed
doc wip
1 parent 5c31e43 commit 02c0c14

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

docs/AccessEnvironmentVariables.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ The configuration inversion system works as follows:
6363

6464
To add support for a new environment variable:
6565

66-
### Step 1: Add to supported-configurations.json
66+
### Step 1: Add to supported-configurations.json & central registry
67+
68+
If the configuration key has never been registered by any tracer it needs to be added to the [Configuration Registry](https://feature-parity.us1.prod.dog/#/configurations?viewType=configurations) (available only for internal contributors) with proper documentation. In the case of an already existing key the behavior needs to be verified in order to know if a new version of the same key needs to be created on the registry.
6769

6870
Edit the `supported-configurations.json` file and add your variable (Please keep any new keys in the file sorted!):
6971

@@ -80,18 +82,20 @@ Edit the `supported-configurations.json` file and add your variable (Please keep
8082
#### Configuration Structure
8183

8284
- **supportedConfigurations**: Maps variable names to configuration metadata
83-
- `version`: (Currently always set to `["A"]`) Array indicating which implementations the tracer supports. Implementations are defined in the Feature Parity Dashboard and multiple implementations could be set for a single environment variable (e.g. the base one `A`, and an extra one `B` that adds new possible values). Versions are non-numeric to avoid confusion with library versions.
85+
- `version`: (Defaults to `["A"]`) Array indicating which implementations the tracer supports. Implementations are defined in the Configuration Registry and multiple implementations could be set for a single environment variable (e.g. the base one `A`, and an extra one `B` that adds new possible values). Versions are non-numeric to avoid confusion with library versions.
8486

8587
In the future, the structure will also contain more information such as the type, the default value...
8688

8789
- **aliases**: Maps canonical variable names to arrays of alias names
90+
8891
```json
8992
"aliases": {
9093
"DD_SERVICE": ["OTEL_SERVICE_NAME"]
9194
}
9295
```
9396

9497
- **deprecations**: Adds a log message to deprecated environment variables.
98+
9599
```json
96100
"deprecations": {
97101
"DD_OLD_VARIABLE": "Please use DD_NEW_VARIABLE",
@@ -151,6 +155,10 @@ rescue RuntimeError => e
151155
end
152156
```
153157

158+
### CI jobs
159+
160+
The `validate_supported_configurations_local_file` CI job in charge of validating the content of the `supported-configurations.json` file against the central Configuration Registry runs on GitLab. This job verifies that all configuration keys present in the local file are correctly registered on the central registry. When a new key is introduced it has to be registered in order to pass this job.
161+
154162
## Validation
155163

156164
To ensure your configuration changes are valid:
@@ -159,6 +167,7 @@ To ensure your configuration changes are valid:
159167
# Validate that generated assets match the JSON file
160168
bundle exec rspec spec/datadog/core/configuration/supported_configurations_spec.rb
161169
```
170+
162171
This will also be run by the main RSpec rake task.
163172

164173
This task will exit with an error if there's a mismatch between `supported-configurations.json` and the generated assets. It is run by the CI, thus a mismatch will make the CI fail.

0 commit comments

Comments
 (0)