Skip to content

Commit bfa5f18

Browse files
mx-psipellared
andauthored
[configuration] Add example using hexadecimal notation (open-telemetry#3975)
Updates open-telemetry#3959 ## Changes Adds example for using an integer in hexadecimal notation. The intention is to show the difference when quoting vs not quoting and make explicit that quoting means keeping the original representation (we already have the `true` example but this one has two different representations). I think this is already implied by the text so this is only a change in the example. * [x] Related issues open-telemetry#3959, part of open-telemetry#3963 --------- Co-authored-by: Robert Pająk <[email protected]>
1 parent 78d00a3 commit bfa5f18

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

specification/configuration/file-configuration.md

+18-13
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export STRING_VALUE="value"
120120
export BOOL_VALUE="true"
121121
export INT_VALUE="1"
122122
export FLOAT_VALUE="1.1"
123+
export HEX_VALUE="0xdeadbeef" # A valid integer value written in hexadecimal
123124
export INVALID_MAP_VALUE="value\nkey:value" # An invalid attempt to inject a map key into the YAML
124125
export DO_NOT_REPLACE_ME="Never use this value" # An unused environment variable
125126
export REPLACE_ME='${DO_NOT_REPLACE_ME}' # A valid replacement text, used verbatim, not replaced with "Never use this value"
@@ -130,9 +131,11 @@ string_key: ${STRING_VALUE} # Valid reference to STRIN
130131
env_string_key: ${env:STRING_VALUE} # Valid reference to STRING_VALUE
131132
other_string_key: "${STRING_VALUE}" # Valid reference to STRING_VALUE inside double quotes
132133
another_string_key: "${BOOL_VALUE}" # Valid reference to BOOL_VALUE inside double quotes
134+
string_key_with_quoted_hex_value: "${HEX_VALUE}" # Valid reference to HEX_VALUE inside double quotes
133135
yet_another_string_key: ${INVALID_MAP_VALUE} # Valid reference to INVALID_MAP_VALUE, but YAML structure from INVALID_MAP_VALUE MUST NOT be injected
134136
bool_key: ${BOOL_VALUE} # Valid reference to BOOL_VALUE
135137
int_key: ${INT_VALUE} # Valid reference to INT_VALUE
138+
int_key_with_unquoted_hex_value: ${HEX_VALUE} # Valid reference to HEX_VALUE without quotes
136139
float_key: ${FLOAT_VALUE} # Valid reference to FLOAT_VALUE
137140
combo_string_key: foo ${STRING_VALUE} ${FLOAT_VALUE} # Valid reference to STRING_VALUE and FLOAT_VALUE
138141
string_key_with_default: ${UNDEFINED_KEY:-fallback} # UNDEFINED_KEY is not defined but a default value is included
@@ -145,19 +148,21 @@ recursive_key: ${REPLACE_ME} # Valid reference to REPLA
145148
Environment variable substitution results in the following YAML:
146149

147150
```yaml
148-
string_key: value # Interpreted as type string, tag URI tag:yaml.org,2002:str
149-
env_string_key: value # Interpreted as type string, tag URI tag:yaml.org,2002:str
150-
other_string_key: "value" # Interpreted as type string, tag URI tag:yaml.org,2002:str
151-
another_string_key: "true" # Interpreted as type string, tag URI tag:yaml.org,2002:str
152-
yet_another_string_key: "value\nkey:value" # Interpreted as type string, tag URI tag:yaml.org,2002:str
153-
bool_key: true # Interpreted as type bool, tag URI tag:yaml.org,2002:bool
154-
int_key: 1 # Interpreted as type int, tag URI tag:yaml.org,2002:int
155-
float_key: 1.1 # Interpreted as type float, tag URI tag:yaml.org,2002:float
156-
combo_string_key: foo value 1.1 # Interpreted as type string, tag URI tag:yaml.org,2002:str
157-
string_key_with_default: fallback # Interpreted as type string, tag URI tag:yaml.org,2002:str
158-
undefined_key: # Interpreted as type null, tag URI tag:yaml.org,2002:null
159-
${STRING_VALUE}: value # Interpreted as type string, tag URI tag:yaml.org,2002:str
160-
recursive_key: ${DO_NOT_REPLACE_ME} # Interpreted as type string, tag URI tag:yaml.org,2002:str
151+
string_key: value # Interpreted as type string, tag URI tag:yaml.org,2002:str
152+
env_string_key: value # Interpreted as type string, tag URI tag:yaml.org,2002:str
153+
other_string_key: "value" # Interpreted as type string, tag URI tag:yaml.org,2002:str
154+
another_string_key: "true" # Interpreted as type string, tag URI tag:yaml.org,2002:str
155+
string_key_with_quoted_hex_value: "0xdeadbeef" # Interpreted as type string, tag URI tag:yaml.org,2002:str
156+
yet_another_string_key: "value\nkey:value" # Interpreted as type string, tag URI tag:yaml.org,2002:str
157+
bool_key: true # Interpreted as type bool, tag URI tag:yaml.org,2002:bool
158+
int_key: 1 # Interpreted as type int, tag URI tag:yaml.org,2002:int
159+
int_key_with_unquoted_hex_value: 3735928559 # Interpreted as type int, tag URI tag:yaml.org,2002:int
160+
float_key: 1.1 # Interpreted as type float, tag URI tag:yaml.org,2002:float
161+
combo_string_key: foo value 1.1 # Interpreted as type string, tag URI tag:yaml.org,2002:str
162+
string_key_with_default: fallback # Interpreted as type string, tag URI tag:yaml.org,2002:str
163+
undefined_key: # Interpreted as type null, tag URI tag:yaml.org,2002:null
164+
${STRING_VALUE}: value # Interpreted as type string, tag URI tag:yaml.org,2002:str
165+
recursive_key: ${DO_NOT_REPLACE_ME} # Interpreted as type string, tag URI tag:yaml.org,2002:str
161166
```
162167
163168
## SDK Configuration

0 commit comments

Comments
 (0)