@opentelemetry/configuration 0.215.0 → 0.217.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +122 -13
  2. package/build/src/ConfigFactory.js +3 -1
  3. package/build/src/ConfigFactory.js.map +1 -1
  4. package/build/src/EnvironmentConfigFactory.d.ts +1 -1
  5. package/build/src/EnvironmentConfigFactory.js +195 -307
  6. package/build/src/EnvironmentConfigFactory.js.map +1 -1
  7. package/build/src/FileConfigFactory.d.ts +2 -17
  8. package/build/src/FileConfigFactory.js +269 -1054
  9. package/build/src/FileConfigFactory.js.map +1 -1
  10. package/build/src/IConfigFactory.d.ts +2 -2
  11. package/build/src/IConfigFactory.js.map +1 -1
  12. package/build/src/generated/types.d.ts +1652 -0
  13. package/build/src/generated/types.js +13 -0
  14. package/build/src/generated/types.js.map +1 -0
  15. package/build/src/generated/validator.d.ts +17 -0
  16. package/build/src/generated/validator.js +8412 -0
  17. package/build/src/generated/validator.js.map +1 -0
  18. package/build/src/index.d.ts +1 -4
  19. package/build/src/index.js.map +1 -1
  20. package/build/src/utils.d.ts +6 -66
  21. package/build/src/utils.js +68 -151
  22. package/build/src/utils.js.map +1 -1
  23. package/build/src/version.d.ts +1 -1
  24. package/build/src/version.js +1 -1
  25. package/build/src/version.js.map +1 -1
  26. package/package.json +6 -3
  27. package/build/src/models/commonModel.d.ts +0 -183
  28. package/build/src/models/commonModel.js +0 -40
  29. package/build/src/models/commonModel.js.map +0 -1
  30. package/build/src/models/configModel.d.ts +0 -77
  31. package/build/src/models/configModel.js +0 -21
  32. package/build/src/models/configModel.js.map +0 -1
  33. package/build/src/models/loggerProviderModel.d.ts +0 -134
  34. package/build/src/models/loggerProviderModel.js +0 -18
  35. package/build/src/models/loggerProviderModel.js.map +0 -1
  36. package/build/src/models/meterProviderModel.d.ts +0 -459
  37. package/build/src/models/meterProviderModel.js +0 -50
  38. package/build/src/models/meterProviderModel.js.map +0 -1
  39. package/build/src/models/resourceModel.d.ts +0 -72
  40. package/build/src/models/resourceModel.js +0 -7
  41. package/build/src/models/resourceModel.js.map +0 -1
  42. package/build/src/models/tracerProviderModel.d.ts +0 -256
  43. package/build/src/models/tracerProviderModel.js +0 -30
  44. package/build/src/models/tracerProviderModel.js.map +0 -1
@@ -1,7 +1,4 @@
1
1
  export type { ConfigFactory } from './IConfigFactory';
2
- export type { ConfigurationModel } from './models/configModel';
3
- export type { LogRecordExporter as LogRecordExporterConfigModel } from './models/loggerProviderModel';
4
- export type { PushMetricExporter as PushMetricExporterConfigModel, InstrumentType as InstrumentTypeConfigModel, Aggregation as AggregationConfigModel, PeriodicMetricReader as PeriodicMetricReaderConfigModel, } from './models/meterProviderModel';
5
- export type { SpanExporter as SpanExporterConfigModel, SpanProcessor as SpanProcessorConfigModel, } from './models/tracerProviderModel';
2
+ export type { ConfigurationModel, LogRecordExporter as LogRecordExporterConfigModel, PushMetricExporter as PushMetricExporterConfigModel, InstrumentType as InstrumentTypeConfigModel, Aggregation as AggregationConfigModel, PeriodicMetricReader as PeriodicMetricReaderConfigModel, Sampler as SamplerConfigModel, SpanExporter as SpanExporterConfigModel, SpanProcessor as SpanProcessorConfigModel, NameStringValuePair as NameStringValuePairConfigModel, HttpTls as HttpTlsConfigModel, SeverityNumber as SeverityNumberConfigModel, } from './generated/types';
6
3
  export { createConfigFactory } from './ConfigFactory';
7
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type { ConfigFactory } from './IConfigFactory';\nexport type { ConfigurationModel } from './models/configModel';\nexport type { LogRecordExporter as LogRecordExporterConfigModel } from './models/loggerProviderModel';\nexport type {\n PushMetricExporter as PushMetricExporterConfigModel,\n InstrumentType as InstrumentTypeConfigModel,\n Aggregation as AggregationConfigModel,\n PeriodicMetricReader as PeriodicMetricReaderConfigModel,\n} from './models/meterProviderModel';\nexport type {\n SpanExporter as SpanExporterConfigModel,\n SpanProcessor as SpanProcessorConfigModel,\n} from './models/tracerProviderModel';\nexport { createConfigFactory } from './ConfigFactory';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiBH,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type { ConfigFactory } from './IConfigFactory';\nexport type {\n ConfigurationModel,\n LogRecordExporter as LogRecordExporterConfigModel,\n PushMetricExporter as PushMetricExporterConfigModel,\n InstrumentType as InstrumentTypeConfigModel,\n Aggregation as AggregationConfigModel,\n PeriodicMetricReader as PeriodicMetricReaderConfigModel,\n Sampler as SamplerConfigModel,\n SpanExporter as SpanExporterConfigModel,\n SpanProcessor as SpanProcessorConfigModel,\n NameStringValuePair as NameStringValuePairConfigModel,\n HttpTls as HttpTlsConfigModel,\n SeverityNumber as SeverityNumberConfigModel,\n} from './generated/types';\nexport { createConfigFactory } from './ConfigFactory';\n"]}
@@ -1,69 +1,9 @@
1
- import type { GrpcTls, HttpTls } from './models/commonModel';
2
- /**
3
- * Retrieves a boolean value from a configuration file parameter.
4
- * - Trims leading and trailing whitespace and ignores casing.
5
- * - Returns `undefined` if the value is empty, unset, or contains only whitespace.
6
- * - Returns `undefined` and a warning for values that cannot be mapped to a boolean.
7
- *
8
- * @param {unknown} value - The value from the config file.
9
- * @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace.
10
- */
11
- export declare function getBooleanFromConfigFile(value: unknown): boolean | undefined;
12
- /**
13
- * Retrieves a list of booleans from a configuration file parameter.
14
- * - Uses ',' as the delimiter.
15
- * - Trims leading and trailing whitespace from each entry.
16
- * - Excludes empty entries.
17
- * - Returns `undefined` if the variable is empty or contains only whitespace.
18
- * - Returns an empty array if all entries are empty or whitespace.
19
- *
20
- * @param {unknown} value - The value from the config file.
21
- * @returns {boolean[] | undefined} - The list of strings or `undefined`.
22
- */
23
- export declare function getBooleanListFromConfigFile(value: unknown): boolean[] | undefined;
24
- /**
25
- * Retrieves a number from a configuration file parameter.
26
- * - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace.
27
- * - Returns `undefined` and a warning if is not a number.
28
- * - Returns a number in all other cases.
29
- *
30
- * @param {unknown} value - The value from the config file.
31
- * @returns {number | undefined} - The number value or `undefined`.
32
- */
33
- export declare function getNumberFromConfigFile(value: unknown): number | undefined;
34
- /**
35
- * Retrieves a list of numbers from a configuration file parameter.
36
- * - Uses ',' as the delimiter.
37
- * - Trims leading and trailing whitespace from each entry.
38
- * - Excludes empty entries.
39
- * - Returns `undefined` if the variable is empty or contains only whitespace.
40
- * - Returns an empty array if all entries are empty or whitespace.
41
- *
42
- * @param {unknown} value - The value from the config file.
43
- * @returns {number[] | undefined} - The list of numbers or `undefined`.
44
- */
45
- export declare function getNumberListFromConfigFile(value: unknown): number[] | undefined;
46
- /**
47
- * Retrieves a string from a configuration file parameter.
48
- * - Returns `undefined` if the variable is empty, unset, or contains only whitespace.
49
- *
50
- * @param {unknown} value - The value from the config file.
51
- * @returns {string | undefined} - The string value or `undefined`.
52
- */
53
- export declare function getStringFromConfigFile(value: unknown): string | undefined;
54
- /**
55
- * Retrieves a list of strings from a configuration file parameter.
56
- * - Uses ',' as the delimiter.
57
- * - Trims leading and trailing whitespace from each entry.
58
- * - Excludes empty entries.
59
- * - Returns `undefined` if the variable is empty or contains only whitespace.
60
- * - Returns an empty array if all entries are empty or whitespace.
61
- *
62
- * @param {unknown} value - The value from the config file.
63
- * @returns {string[] | undefined} - The list of strings or `undefined`.
64
- */
65
- export declare function getStringListFromConfigFile(value: unknown): string[] | undefined;
66
- export declare function envVariableSubstitution(value: unknown): string | undefined;
1
+ import type { ConfigurationModel, GrpcTls, HttpTls } from './generated/types';
2
+ export declare function envVariableSubstitution(value: string): string;
67
3
  export declare function getGrpcTlsConfig(certificateFile?: string, clientKeyFile?: string, clientCertificateFile?: string, insecure?: boolean): GrpcTls | undefined;
4
+ export declare function initializeDefaultConfiguration(): ConfigurationModel;
5
+ export declare function initializeDefaultTracerProviderConfiguration(): NonNullable<ConfigurationModel['tracer_provider']>;
6
+ export declare function initializeDefaultMeterProviderConfiguration(): NonNullable<ConfigurationModel['meter_provider']>;
7
+ export declare function initializeDefaultLoggerProviderConfiguration(): NonNullable<ConfigurationModel['logger_provider']>;
68
8
  export declare function getHttpTlsConfig(certificateFile?: string, clientKeyFile?: string, clientCertificateFile?: string): HttpTls | undefined;
69
9
  //# sourceMappingURL=utils.d.ts.map
@@ -1,163 +1,32 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getHttpTlsConfig = exports.getGrpcTlsConfig = exports.envVariableSubstitution = exports.getStringListFromConfigFile = exports.getStringFromConfigFile = exports.getNumberListFromConfigFile = exports.getNumberFromConfigFile = exports.getBooleanListFromConfigFile = exports.getBooleanFromConfigFile = void 0;
4
2
  /*
5
3
  * Copyright The OpenTelemetry Authors
6
4
  * SPDX-License-Identifier: Apache-2.0
7
5
  */
8
- const api_1 = require("@opentelemetry/api");
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.getHttpTlsConfig = exports.initializeDefaultLoggerProviderConfiguration = exports.initializeDefaultMeterProviderConfiguration = exports.initializeDefaultTracerProviderConfiguration = exports.initializeDefaultConfiguration = exports.getGrpcTlsConfig = exports.envVariableSubstitution = void 0;
9
8
  const core_1 = require("@opentelemetry/core");
10
- const util_1 = require("util");
11
- /**
12
- * Retrieves a boolean value from a configuration file parameter.
13
- * - Trims leading and trailing whitespace and ignores casing.
14
- * - Returns `undefined` if the value is empty, unset, or contains only whitespace.
15
- * - Returns `undefined` and a warning for values that cannot be mapped to a boolean.
16
- *
17
- * @param {unknown} value - The value from the config file.
18
- * @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace.
19
- */
20
- function getBooleanFromConfigFile(value) {
21
- const raw = envVariableSubstitution(value)?.trim().toLowerCase();
22
- if (raw === 'true') {
23
- return true;
24
- }
25
- else if (raw === 'false') {
26
- return false;
27
- }
28
- else if (raw == null || raw === '') {
29
- return undefined;
30
- }
31
- else {
32
- api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)}, expected 'true' or 'false'`);
33
- return undefined;
34
- }
35
- }
36
- exports.getBooleanFromConfigFile = getBooleanFromConfigFile;
37
- /**
38
- * Retrieves a list of booleans from a configuration file parameter.
39
- * - Uses ',' as the delimiter.
40
- * - Trims leading and trailing whitespace from each entry.
41
- * - Excludes empty entries.
42
- * - Returns `undefined` if the variable is empty or contains only whitespace.
43
- * - Returns an empty array if all entries are empty or whitespace.
44
- *
45
- * @param {unknown} value - The value from the config file.
46
- * @returns {boolean[] | undefined} - The list of strings or `undefined`.
47
- */
48
- function getBooleanListFromConfigFile(value) {
49
- const list = getStringFromConfigFile(value)?.split(',');
50
- if (list) {
51
- const filteredList = [];
52
- for (let i = 0; i < list.length; i++) {
53
- const element = getBooleanFromConfigFile(list[i]);
54
- if (element != null) {
55
- filteredList.push(element);
56
- }
57
- }
58
- return filteredList;
59
- }
60
- return list;
61
- }
62
- exports.getBooleanListFromConfigFile = getBooleanListFromConfigFile;
63
- /**
64
- * Retrieves a number from a configuration file parameter.
65
- * - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace.
66
- * - Returns `undefined` and a warning if is not a number.
67
- * - Returns a number in all other cases.
68
- *
69
- * @param {unknown} value - The value from the config file.
70
- * @returns {number | undefined} - The number value or `undefined`.
71
- */
72
- function getNumberFromConfigFile(value) {
73
- const raw = envVariableSubstitution(value)?.trim();
74
- if (raw == null || raw.trim() === '') {
75
- return undefined;
76
- }
77
- const n = Number(raw);
78
- if (isNaN(n)) {
79
- api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)}, expected a number`);
80
- return undefined;
81
- }
82
- return n;
83
- }
84
- exports.getNumberFromConfigFile = getNumberFromConfigFile;
85
- /**
86
- * Retrieves a list of numbers from a configuration file parameter.
87
- * - Uses ',' as the delimiter.
88
- * - Trims leading and trailing whitespace from each entry.
89
- * - Excludes empty entries.
90
- * - Returns `undefined` if the variable is empty or contains only whitespace.
91
- * - Returns an empty array if all entries are empty or whitespace.
92
- *
93
- * @param {unknown} value - The value from the config file.
94
- * @returns {number[] | undefined} - The list of numbers or `undefined`.
95
- */
96
- function getNumberListFromConfigFile(value) {
97
- const list = getStringFromConfigFile(value)?.split(',');
98
- if (list) {
99
- const filteredList = [];
100
- for (let i = 0; i < list.length; i++) {
101
- const element = getNumberFromConfigFile(list[i]);
102
- if (element || element === 0) {
103
- filteredList.push(element);
104
- }
105
- }
106
- return filteredList;
107
- }
108
- return list;
109
- }
110
- exports.getNumberListFromConfigFile = getNumberListFromConfigFile;
111
- /**
112
- * Retrieves a string from a configuration file parameter.
113
- * - Returns `undefined` if the variable is empty, unset, or contains only whitespace.
114
- *
115
- * @param {unknown} value - The value from the config file.
116
- * @returns {string | undefined} - The string value or `undefined`.
117
- */
118
- function getStringFromConfigFile(value) {
119
- const raw = envVariableSubstitution(value)?.trim();
120
- if (value == null || raw === '') {
121
- return undefined;
122
- }
123
- return raw;
124
- }
125
- exports.getStringFromConfigFile = getStringFromConfigFile;
126
- /**
127
- * Retrieves a list of strings from a configuration file parameter.
128
- * - Uses ',' as the delimiter.
129
- * - Trims leading and trailing whitespace from each entry.
130
- * - Excludes empty entries.
131
- * - Returns `undefined` if the variable is empty or contains only whitespace.
132
- * - Returns an empty array if all entries are empty or whitespace.
133
- *
134
- * @param {unknown} value - The value from the config file.
135
- * @returns {string[] | undefined} - The list of strings or `undefined`.
136
- */
137
- function getStringListFromConfigFile(value) {
138
- value = envVariableSubstitution(value);
139
- return getStringFromConfigFile(value)
140
- ?.split(',')
141
- .map(v => v.trim())
142
- .filter(s => s !== '');
143
- }
144
- exports.getStringListFromConfigFile = getStringListFromConfigFile;
145
9
  function envVariableSubstitution(value) {
146
- if (value == null) {
147
- return undefined;
148
- }
149
- const matches = String(value).match(/\$\{[a-zA-Z0-9,=/_:.-]*\}/g);
150
- if (matches) {
151
- let stringValue = String(value);
152
- for (const match of matches) {
153
- const v = match.substring(2, match.length - 1).split(':-');
154
- const defaultValue = v.length === 2 ? v[1] : '';
155
- const replacement = (0, core_1.getStringFromEnv)(v[0]) || defaultValue;
156
- stringValue = stringValue.replace(match, replacement);
10
+ const str = String(value);
11
+ // Spec ABNF: $$ is a literal $; ${VAR}, ${VAR:-default}, ${env:VAR}, ${env:VAR:-default}
12
+ const TOKEN_RE = /\$\$|\$\{(?:env:)?([a-zA-Z_][a-zA-Z0-9_]*)(?::-(.*?))?\}/g;
13
+ let result = '';
14
+ let lastIndex = 0;
15
+ let match;
16
+ while ((match = TOKEN_RE.exec(str)) !== null) {
17
+ result += str.slice(lastIndex, match.index);
18
+ if (match[0] === '$$') {
19
+ result += '$';
157
20
  }
158
- return stringValue;
21
+ else {
22
+ const varName = match[1];
23
+ const defaultValue = match[2] ?? '';
24
+ result += (0, core_1.getStringFromEnv)(varName) || defaultValue;
25
+ }
26
+ lastIndex = TOKEN_RE.lastIndex;
159
27
  }
160
- return String(value);
28
+ result += str.slice(lastIndex);
29
+ return result;
161
30
  }
162
31
  exports.envVariableSubstitution = envVariableSubstitution;
163
32
  function getGrpcTlsConfig(certificateFile, clientKeyFile, clientCertificateFile, insecure) {
@@ -180,6 +49,54 @@ function getGrpcTlsConfig(certificateFile, clientKeyFile, clientCertificateFile,
180
49
  return undefined;
181
50
  }
182
51
  exports.getGrpcTlsConfig = getGrpcTlsConfig;
52
+ function initializeDefaultConfiguration() {
53
+ return {
54
+ disabled: false,
55
+ resource: {},
56
+ attribute_limits: {
57
+ attribute_count_limit: 128,
58
+ },
59
+ };
60
+ }
61
+ exports.initializeDefaultConfiguration = initializeDefaultConfiguration;
62
+ function initializeDefaultTracerProviderConfiguration() {
63
+ return {
64
+ processors: [],
65
+ limits: {
66
+ attribute_count_limit: 128,
67
+ event_count_limit: 128,
68
+ link_count_limit: 128,
69
+ event_attribute_count_limit: 128,
70
+ link_attribute_count_limit: 128,
71
+ },
72
+ sampler: {
73
+ parent_based: {
74
+ root: { always_on: undefined },
75
+ remote_parent_sampled: { always_on: undefined },
76
+ remote_parent_not_sampled: { always_off: undefined },
77
+ local_parent_sampled: { always_on: undefined },
78
+ local_parent_not_sampled: { always_off: undefined },
79
+ },
80
+ },
81
+ };
82
+ }
83
+ exports.initializeDefaultTracerProviderConfiguration = initializeDefaultTracerProviderConfiguration;
84
+ function initializeDefaultMeterProviderConfiguration() {
85
+ return {
86
+ readers: [],
87
+ views: [],
88
+ exemplar_filter: 'trace_based',
89
+ };
90
+ }
91
+ exports.initializeDefaultMeterProviderConfiguration = initializeDefaultMeterProviderConfiguration;
92
+ function initializeDefaultLoggerProviderConfiguration() {
93
+ return {
94
+ processors: [],
95
+ limits: { attribute_count_limit: 128 },
96
+ 'logger_configurator/development': {},
97
+ };
98
+ }
99
+ exports.initializeDefaultLoggerProviderConfiguration = initializeDefaultLoggerProviderConfiguration;
183
100
  function getHttpTlsConfig(certificateFile, clientKeyFile, clientCertificateFile) {
184
101
  if (certificateFile || clientKeyFile || clientCertificateFile) {
185
102
  const tls = {};
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,4CAA0C;AAC1C,8CAAuD;AACvD,+BAA+B;AAG/B;;;;;;;;GAQG;AACH,SAAgB,wBAAwB,CAAC,KAAc;IACrD,MAAM,GAAG,GAAG,uBAAuB,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACjE,IAAI,GAAG,KAAK,MAAM,EAAE;QAClB,OAAO,IA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;YACzB,GAAG,CAAC,SAAS,GAAG,qBAAqB,CAAC;SACvC;QACD,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;SACzB;QACD,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAvBD,4CAuBC;AAED,SAAgB,gBAAgB,CAC9B,eAAwB,EACxB,aAAsB,EACtB,qBAA8B;IAE9B,IAAI,eAAe,IAAI,aAAa,IAAI,qBAAqB,EAAE;QAC7D,MAAM,GAAG,GAAY,EAAE,CAAC;QACxB,IAAI,eAAe,EAAE;YACnB,GAAG,CAAC,OAAO,GAAG,eAAe,CAAC;SAC/B;QACD,IAAI,aAAa,EAAE;YACjB,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC;SAC9B;QACD,IAAI,qBAAqB,EAAE;YACzB,GAAG,CAAC,SAAS,GAAG,qBAAqB,CAAC;SACvC;QACD,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAnBD,4CAmBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport { inspect } from 'util';\nimport type { GrpcTls, HttpTls } from './models/commonModel';\n\n/**\n * Retrieves a boolean value from a configuration file parameter.\n * - Trims leading and trailing whitespace and ignores casing.\n * - Returns `undefined` if the value is empty, unset, or contains only whitespace.\n * - Returns `undefined` and a warning for values that cannot be mapped to a boolean.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace.\n */\nexport function getBooleanFromConfigFile(value: unknown): boolean | undefined {\n const raw = envVariableSubstitution(value)?.trim().toLowerCase();\n if (raw === 'true') {\n return true;\n } else if (raw === 'false') {\n return false;\n } else if (raw == null || raw === '') {\n return undefined;\n } else {\n diag.warn(`Unknown value ${inspect(raw)}, expected 'true' or 'false'`);\n return undefined;\n }\n}\n\n/**\n * Retrieves a list of booleans from a configuration file parameter.\n * - Uses ',' as the delimiter.\n * - Trims leading and trailing whitespace from each entry.\n * - Excludes empty entries.\n * - Returns `undefined` if the variable is empty or contains only whitespace.\n * - Returns an empty array if all entries are empty or whitespace.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {boolean[] | undefined} - The list of strings or `undefined`.\n */\nexport function getBooleanListFromConfigFile(\n value: unknown\n): boolean[] | undefined {\n const list = getStringFromConfigFile(value)?.split(',');\n if (list) {\n const filteredList = [];\n for (let i = 0; i < list.length; i++) {\n const element = getBooleanFromConfigFile(list[i]);\n if (element != null) {\n filteredList.push(element);\n }\n }\n return filteredList;\n }\n return list;\n}\n\n/**\n * Retrieves a number from a configuration file parameter.\n * - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace.\n * - Returns `undefined` and a warning if is not a number.\n * - Returns a number in all other cases.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {number | undefined} - The number value or `undefined`.\n */\nexport function getNumberFromConfigFile(value: unknown): number | undefined {\n const raw = envVariableSubstitution(value)?.trim();\n if (raw == null || raw.trim() === '') {\n return undefined;\n }\n\n const n = Number(raw);\n if (isNaN(n)) {\n diag.warn(`Unknown value ${inspect(raw)}, expected a number`);\n return undefined;\n }\n\n return n;\n}\n\n/**\n * Retrieves a list of numbers from a configuration file parameter.\n * - Uses ',' as the delimiter.\n * - Trims leading and trailing whitespace from each entry.\n * - Excludes empty entries.\n * - Returns `undefined` if the variable is empty or contains only whitespace.\n * - Returns an empty array if all entries are empty or whitespace.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {number[] | undefined} - The list of numbers or `undefined`.\n */\nexport function getNumberListFromConfigFile(\n value: unknown\n): number[] | undefined {\n const list = getStringFromConfigFile(value)?.split(',');\n if (list) {\n const filteredList = [];\n for (let i = 0; i < list.length; i++) {\n const element = getNumberFromConfigFile(list[i]);\n if (element || element === 0) {\n filteredList.push(element);\n }\n }\n return filteredList;\n }\n return list;\n}\n\n/**\n * Retrieves a string from a configuration file parameter.\n * - Returns `undefined` if the variable is empty, unset, or contains only whitespace.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {string | undefined} - The string value or `undefined`.\n */\nexport function getStringFromConfigFile(value: unknown): string | undefined {\n const raw = envVariableSubstitution(value)?.trim();\n if (value == null || raw === '') {\n return undefined;\n }\n return raw;\n}\n\n/**\n * Retrieves a list of strings from a configuration file parameter.\n * - Uses ',' as the delimiter.\n * - Trims leading and trailing whitespace from each entry.\n * - Excludes empty entries.\n * - Returns `undefined` if the variable is empty or contains only whitespace.\n * - Returns an empty array if all entries are empty or whitespace.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {string[] | undefined} - The list of strings or `undefined`.\n */\nexport function getStringListFromConfigFile(\n value: unknown\n): string[] | undefined {\n value = envVariableSubstitution(value);\n return getStringFromConfigFile(value)\n ?.split(',')\n .map(v => v.trim())\n .filter(s => s !== '');\n}\n\nexport function envVariableSubstitution(value: unknown): string | undefined {\n if (value == null) {\n return undefined;\n }\n\n const matches = String(value).match(/\\$\\{[a-zA-Z0-9,=/_:.-]*\\}/g);\n if (matches) {\n let stringValue = String(value);\n for (const match of matches) {\n const v = match.substring(2, match.length - 1).split(':-');\n const defaultValue = v.length === 2 ? v[1] : '';\n const replacement = getStringFromEnv(v[0]) || defaultValue;\n stringValue = stringValue.replace(match, replacement);\n }\n return stringValue;\n }\n return String(value);\n}\n\nexport function getGrpcTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string,\n insecure?: boolean\n): GrpcTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: GrpcTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n if (insecure !== undefined) {\n tls.insecure = insecure;\n }\n return tls;\n }\n return undefined;\n}\n\nexport function getHttpTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string\n): HttpTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: HttpTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n return tls;\n }\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,8CAAuD;AAGvD,SAAgB,uBAAuB,CAAC,KAAa;IACnD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,yFAAyF;IACzF,MAAM,QAAQ,GAAG,2DAA2D,CAAC;IAC7E,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,KAA6B,CAAC;IAElC,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;QAC5C,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YACrB,MAAM,IAAI,GAAG,CAAC;SACf;aAAM;YACL,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACzB,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YACpC,MAAM,IAAI,IAAA,uBAAgB,EAAC,OAAO,CAAC,IAAI,YAAY,CAAC;SACrD;QACD,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;KAChC;IAED,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;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E,UAAU,EAAE,SAAS,EAAE;aACpD;SACF;KACF,CAAC;AACJ,CAAC;AAtBD,oGAsBC;AAED,SAAgB,2CAA2C;IAGzD,OAAO;QACL,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;QACT,eAAe,EAAE,aAAa;KAC/B,CAAC;AACJ,CAAC;AARD,kGAQC;AAED,SAAgB,4CAA4C;IAG1D,OAAO;QACL,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,EAAE,qBAAqB,EAAE,GAAG,EAAE;QACtC,iCAAiC,EAAE,EAAE;KACtC,CAAC;AACJ,CAAC;AARD,oGAQC;AAED,SAAgB,gBAAgB,CAC9B,eAAwB,EACxB,aAAsB,EACtB,qBAA8B;IAE9B,IAAI,eAAe,IAAI,aAAa,IAAI,qBAAqB,EAAE;QAC7D,MAAM,GAAG,GAAY,EAAE,CAAC;QACxB,IAAI,eAAe,EAAE;YACnB,GAAG,CAAC,OAAO,GAAG,eAAe,CAAC;SAC/B;QACD,IAAI,aAAa,EAAE;YACjB,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC;SAC9B;QACD,IAAI,qBAAqB,EAAE;YACzB,GAAG,CAAC,SAAS,GAAG,qBAAqB,CAAC;SACvC;QACD,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAnBD,4CAmBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport type { ConfigurationModel, GrpcTls, HttpTls } from './generated/types';\n\nexport function envVariableSubstitution(value: string): string {\n const str = String(value);\n // Spec ABNF: $$ is a literal $; ${VAR}, ${VAR:-default}, ${env:VAR}, ${env:VAR:-default}\n const TOKEN_RE = /\\$\\$|\\$\\{(?:env:)?([a-zA-Z_][a-zA-Z0-9_]*)(?::-(.*?))?\\}/g;\n let result = '';\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n while ((match = TOKEN_RE.exec(str)) !== null) {\n result += str.slice(lastIndex, match.index);\n if (match[0] === '$$') {\n result += '$';\n } else {\n const varName = match[1];\n const defaultValue = match[2] ?? '';\n result += getStringFromEnv(varName) || defaultValue;\n }\n lastIndex = TOKEN_RE.lastIndex;\n }\n\n result += str.slice(lastIndex);\n return result;\n}\n\nexport function getGrpcTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string,\n insecure?: boolean\n): GrpcTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: GrpcTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n if (insecure !== undefined) {\n tls.insecure = insecure;\n }\n return tls;\n }\n return undefined;\n}\n\nexport function initializeDefaultConfiguration(): ConfigurationModel {\n return {\n disabled: false,\n resource: {},\n attribute_limits: {\n attribute_count_limit: 128,\n },\n };\n}\n\nexport function initializeDefaultTracerProviderConfiguration(): NonNullable<\n ConfigurationModel['tracer_provider']\n> {\n return {\n processors: [],\n limits: {\n attribute_count_limit: 128,\n event_count_limit: 128,\n link_count_limit: 128,\n event_attribute_count_limit: 128,\n link_attribute_count_limit: 128,\n },\n sampler: {\n parent_based: {\n root: { always_on: undefined },\n remote_parent_sampled: { always_on: undefined },\n remote_parent_not_sampled: { always_off: undefined },\n local_parent_sampled: { always_on: undefined },\n local_parent_not_sampled: { always_off: undefined },\n },\n },\n };\n}\n\nexport function initializeDefaultMeterProviderConfiguration(): NonNullable<\n ConfigurationModel['meter_provider']\n> {\n return {\n readers: [],\n views: [],\n exemplar_filter: 'trace_based',\n };\n}\n\nexport function initializeDefaultLoggerProviderConfiguration(): NonNullable<\n ConfigurationModel['logger_provider']\n> {\n return {\n processors: [],\n limits: { attribute_count_limit: 128 },\n 'logger_configurator/development': {},\n };\n}\n\nexport function getHttpTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string\n): HttpTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: HttpTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n return tls;\n }\n return undefined;\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.215.0";
1
+ export declare const VERSION = "0.217.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -6,5 +6,5 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.VERSION = void 0;
8
8
  // this is autogenerated file, see scripts/version-update.js
9
- exports.VERSION = '0.215.0';
9
+ exports.VERSION = '0.217.0';
10
10
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.215.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.217.0';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/configuration",
3
- "version": "0.215.0",
3
+ "version": "0.217.0",
4
4
  "description": "OpenTelemetry Configuration",
5
5
  "main": "build/src/index.js",
6
6
  "types": "build/src/index.d.ts",
@@ -9,6 +9,7 @@
9
9
  "prepublishOnly": "npm run compile",
10
10
  "compile": "tsc --build",
11
11
  "clean": "tsc --build --clean",
12
+ "generate:config": "node ./scripts/generate-config.js",
12
13
  "test": "nyc mocha test/**/*.test.ts",
13
14
  "lint": "eslint . --ext .ts",
14
15
  "lint:fix": "eslint . --ext .ts --fix",
@@ -38,7 +39,7 @@
38
39
  "access": "public"
39
40
  },
40
41
  "dependencies": {
41
- "@opentelemetry/core": "2.7.0",
42
+ "@opentelemetry/core": "2.7.1",
42
43
  "yaml": "^2.0.0"
43
44
  },
44
45
  "peerDependencies": {
@@ -49,6 +50,8 @@
49
50
  "@types/mocha": "10.0.10",
50
51
  "@types/node": "18.19.130",
51
52
  "@types/sinon": "17.0.4",
53
+ "ajv": "^8.0.0",
54
+ "json-schema-to-typescript": "^15.0.0",
52
55
  "mocha": "11.7.5",
53
56
  "nyc": "17.1.0",
54
57
  "sinon": "18.0.1",
@@ -57,5 +60,5 @@
57
60
  },
58
61
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/configuration",
59
62
  "sideEffects": false,
60
- "gitHead": "a0476eef3cb973bfcc0c2e41f868dd7b484c2ed8"
63
+ "gitHead": "74cde1b674508ccc0ed2601ac43a80ff2d35114c"
61
64
  }
@@ -1,183 +0,0 @@
1
- export interface IncludeExclude {
2
- /**
3
- * Configure list of attribute key patterns to include from resource detectors.
4
- * Attribute keys from resource detectors are evaluated to match as follows:
5
- * * If the value of the attribute key exactly matches.
6
- * * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
7
- * If omitted, all attributes are included.
8
- */
9
- included?: string[];
10
- /**
11
- * Configure list of attribute key patterns to exclude from resource detectors. Applies after .resource.detectors.attributes.included (i.e. excluded has higher priority than included).
12
- * Attribute keys from resource detectors are evaluated to match as follows:
13
- * * If the value of the attribute key exactly matches.
14
- * * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
15
- * If omitted, .included attributes are included.
16
- */
17
- excluded?: string[];
18
- }
19
- export interface NameStringValuePair {
20
- name: string;
21
- value: string;
22
- }
23
- export interface OtlpHttpExporter {
24
- /**
25
- * Configure endpoint, including the trace, metric or log specific path.
26
- * If omitted or null, http://localhost:4318/v1/traces is used for trace,
27
- * http://localhost:4318/v1/metrics for metrics
28
- * and http://localhost:4318/v1/logs is used for logs.
29
- */
30
- endpoint?: string;
31
- /**
32
- * Configure TLS settings for the exporter.
33
- */
34
- tls?: HttpTls;
35
- /**
36
- * Configure compression.
37
- * Values include: gzip, none. Implementations may support other compression algorithms.
38
- * If omitted or null, none is used.
39
- */
40
- compression?: string;
41
- /**
42
- * Configure max time (in milliseconds) to wait for each export.
43
- * Value must be non-negative. A value of 0 indicates no limit (infinity).
44
- * If omitted or null, 10000 is used.
45
- */
46
- timeout?: number;
47
- /**
48
- * Configure headers. Entries have higher priority than entries from .headers_list.
49
- * If an entry's .value is null, the entry is ignored.
50
- */
51
- headers?: NameStringValuePair[];
52
- /**
53
- * Configure headers. Entries have lower priority than entries from .headers.
54
- * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS.
55
- * If omitted or null, no headers are added.
56
- */
57
- headers_list?: string;
58
- /**
59
- * Configure the encoding used for messages.
60
- * Values include: protobuf, json. Implementations may not support json.
61
- * If omitted or null, protobuf is used.
62
- */
63
- encoding?: OtlpHttpEncoding;
64
- }
65
- export declare enum OtlpHttpEncoding {
66
- JSON = "json",
67
- Protobuf = "protobuf"
68
- }
69
- export interface OtlpGrpcExporter {
70
- /**
71
- * Configure endpoint.
72
- * If omitted or null, http://localhost:4317 is used.
73
- */
74
- endpoint?: string;
75
- /**
76
- * Configure TLS settings for the exporter.
77
- */
78
- tls?: GrpcTls;
79
- /**
80
- * Configure headers. Entries have higher priority than entries from .headers_list.
81
- * If an entry's .value is null, the entry is ignored.
82
- */
83
- headers?: NameStringValuePair[];
84
- /**
85
- * Configure headers. Entries have lower priority than entries from .headers.
86
- * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS.
87
- * If omitted or null, no headers are added.
88
- */
89
- headers_list?: string;
90
- /**
91
- * Configure compression.
92
- * Values include: gzip, none. Implementations may support other compression algorithms.
93
- * If omitted or null, none is used.
94
- */
95
- compression?: string;
96
- /**
97
- * Configure max time (in milliseconds) to wait for each export.
98
- * Value must be non-negative. A value of 0 indicates no limit (infinity).
99
- * If omitted or null, 10000 is used.
100
- */
101
- timeout?: number;
102
- }
103
- export interface ExperimentalOtlpFileExporter {
104
- /**
105
- * Configure output stream.
106
- * Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.
107
- * If omitted or null, stdout is used.
108
- */
109
- output_stream?: string;
110
- }
111
- export interface HttpTls {
112
- /**
113
- * Configure certificate used to verify a server's TLS credentials.
114
- * Absolute path to certificate file in PEM format.
115
- * If omitted or null, system default certificate verification is used for secure connections.
116
- */
117
- ca_file?: string;
118
- /**
119
- * Configure mTLS private client key.
120
- * Absolute path to client key file in PEM format. If set, .client_certificate must also be set.
121
- * If omitted or null, mTLS is not used.
122
- */
123
- key_file?: string;
124
- /**
125
- * Configure mTLS client certificate.
126
- * Absolute path to client certificate file in PEM format. If set, .client_key must also be set.
127
- * If omitted or null, mTLS is not used.
128
- */
129
- cert_file?: string;
130
- }
131
- export interface GrpcTls {
132
- /**
133
- * Configure certificate used to verify a server's TLS credentials.
134
- * Absolute path to certificate file in PEM format.
135
- * If omitted or null, system default certificate verification is used for secure connections.
136
- */
137
- ca_file?: string;
138
- /**
139
- * Configure mTLS private client key.
140
- * Absolute path to client key file in PEM format. If set, .client_certificate must also be set.
141
- * If omitted or null, mTLS is not used.
142
- */
143
- key_file?: string;
144
- /**
145
- * Configure mTLS client certificate.
146
- * Absolute path to client certificate file in PEM format. If set, .client_key must also be set.
147
- * If omitted or null, mTLS is not used.
148
- */
149
- cert_file?: string;
150
- /**
151
- * Configure client transport security for the exporter's connection.
152
- * Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure.
153
- * If omitted or null, false is used.
154
- */
155
- insecure?: boolean;
156
- }
157
- export declare enum SeverityNumber {
158
- DEBUG = "debug",
159
- DEBUG2 = "debug2",
160
- DEBUG3 = "debug3",
161
- DEBUG4 = "debug4",
162
- ERROR = "error",
163
- ERROR2 = "error2",
164
- ERROR3 = "error3",
165
- ERROR4 = "error4",
166
- FATAL = "fatal",
167
- FATAL2 = "fatal2",
168
- FATAL3 = "fatal3",
169
- FATAL4 = "fatal4",
170
- INFO = "info",
171
- INFO2 = "info2",
172
- INFO3 = "info3",
173
- INFO4 = "info4",
174
- TRACE = "trace",
175
- TRACE2 = "trace2",
176
- TRACE3 = "trace3",
177
- TRACE4 = "trace4",
178
- WARN = "warn",
179
- WARN2 = "warn2",
180
- WARN3 = "warn3",
181
- WARN4 = "warn4"
182
- }
183
- //# sourceMappingURL=commonModel.d.ts.map
@@ -1,40 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- * SPDX-License-Identifier: Apache-2.0
4
- */
5
- 'use strict';
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SeverityNumber = exports.OtlpHttpEncoding = void 0;
8
- var OtlpHttpEncoding;
9
- (function (OtlpHttpEncoding) {
10
- OtlpHttpEncoding["JSON"] = "json";
11
- OtlpHttpEncoding["Protobuf"] = "protobuf";
12
- })(OtlpHttpEncoding = exports.OtlpHttpEncoding || (exports.OtlpHttpEncoding = {}));
13
- var SeverityNumber;
14
- (function (SeverityNumber) {
15
- SeverityNumber["DEBUG"] = "debug";
16
- SeverityNumber["DEBUG2"] = "debug2";
17
- SeverityNumber["DEBUG3"] = "debug3";
18
- SeverityNumber["DEBUG4"] = "debug4";
19
- SeverityNumber["ERROR"] = "error";
20
- SeverityNumber["ERROR2"] = "error2";
21
- SeverityNumber["ERROR3"] = "error3";
22
- SeverityNumber["ERROR4"] = "error4";
23
- SeverityNumber["FATAL"] = "fatal";
24
- SeverityNumber["FATAL2"] = "fatal2";
25
- SeverityNumber["FATAL3"] = "fatal3";
26
- SeverityNumber["FATAL4"] = "fatal4";
27
- SeverityNumber["INFO"] = "info";
28
- SeverityNumber["INFO2"] = "info2";
29
- SeverityNumber["INFO3"] = "info3";
30
- SeverityNumber["INFO4"] = "info4";
31
- SeverityNumber["TRACE"] = "trace";
32
- SeverityNumber["TRACE2"] = "trace2";
33
- SeverityNumber["TRACE3"] = "trace3";
34
- SeverityNumber["TRACE4"] = "trace4";
35
- SeverityNumber["WARN"] = "warn";
36
- SeverityNumber["WARN2"] = "warn2";
37
- SeverityNumber["WARN3"] = "warn3";
38
- SeverityNumber["WARN4"] = "warn4";
39
- })(SeverityNumber = exports.SeverityNumber || (exports.SeverityNumber = {}));
40
- //# sourceMappingURL=commonModel.js.map