Commit c37932d
authored
docs: update environment variable tables for utilities (#1153)
* chore(docs): update environment variable table
* Correct the default value for the POWERTOOLS_METRICS_NAMESPACE env var
* Refer reader to utility page for further info on env vars
* chore(docs): add default, allowed and example values to utility docs
* Extract default and allowed values from description to their own cols
* Add allowed values, example and default columns
* Correct default value for metrics namespace
* refactor: set default service name in utility class
Previously the Metric and Tracer classes did not set a service name if
one was not provided. There was no default service name.
This commit sets a default service name in the Utility class, and
updates the Tracer, Metric and Logger classes to use it.
* test: fix Logger tests
Add missing `defaultServiceName` property to expected Logger object
Correct typo in test names
* test(tracer): remove invalid test
Remove a test that is no longer valid. As there is a default service
name, the tracer should not be enabled even if there is a service name
Update the `addServiceAnnotation` function to remove redundant check
* docs(metrics): correct default value
* test(metrics): update metric tests to account for default service dim
The `service_name` is now set by default. This means it is always
present in metric dimensions. This commit updates the tests to account
for this change
* test(tracer): add test for default service name
* test(utility): add test for new method
Add test for getDefaultServiceName method
* test(utility): fix getdefaultservicename test
* refactor: extract isvalidservicename method to utility class
This commit extracts the isValidServiceName method from the Tracer class
to the Utility class.
* test(utility): fix test description
* refactor: change utility class methods from public to protected
* test(utility): refactor tests to allow for protected methods
* docs(index): remove quotation marks from default values
* test(metrics): add comments to explain magic numbers
* doc(tracer): add explanation for definite assignment assertion operator
* test(tracer): refactor test to match project norms1 parent 664c4da commit c37932d
File tree
13 files changed
+128
-59
lines changed- docs
- core
- packages
- commons
- src
- tests/unit
- logger
- src
- tests/unit
- metrics
- src
- tests/unit
- tracer
- src
- tests/unit
13 files changed
+128
-59
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
289 | | - | |
| 288 | + | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
| 300 | + | |
299 | 301 | | |
300 | 302 | | |
301 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | 59 | | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
76 | 89 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
15 | 33 | | |
16 | 34 | | |
17 | 35 | | |
| |||
142 | 160 | | |
143 | 161 | | |
144 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
145 | 190 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | 122 | | |
125 | 123 | | |
126 | 124 | | |
| |||
803 | 801 | | |
804 | 802 | | |
805 | 803 | | |
806 | | - | |
| 804 | + | |
807 | 805 | | |
808 | 806 | | |
809 | 807 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
| 569 | + | |
569 | 570 | | |
570 | 571 | | |
571 | 572 | | |
| |||
1265 | 1266 | | |
1266 | 1267 | | |
1267 | 1268 | | |
| 1269 | + | |
1268 | 1270 | | |
1269 | 1271 | | |
1270 | 1272 | | |
| |||
1290 | 1292 | | |
1291 | 1293 | | |
1292 | 1294 | | |
| 1295 | + | |
1293 | 1296 | | |
1294 | 1297 | | |
1295 | 1298 | | |
| |||
1317 | 1320 | | |
1318 | 1321 | | |
1319 | 1322 | | |
| 1323 | + | |
1320 | 1324 | | |
1321 | 1325 | | |
1322 | 1326 | | |
| |||
1342 | 1346 | | |
1343 | 1347 | | |
1344 | 1348 | | |
| 1349 | + | |
1345 | 1350 | | |
1346 | 1351 | | |
1347 | 1352 | | |
| |||
0 commit comments