@opentelemetry/sdk-node 0.33.0 → 0.35.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.
package/README.md CHANGED
@@ -129,7 +129,7 @@ Configure a custom sampler. By default, all traces will be sampled.
129
129
 
130
130
  ### traceExporter
131
131
 
132
- Configure a trace exporter. If an exporter OR span processor is not configured, the tracing SDK will not be initialized and registered. If an exporter is configured, it will be used with a [BatchSpanProcessor](../../../packages/opentelemetry-sdk-trace-base/src/platform/node/export/BatchSpanProcessor.ts).
132
+ Configure a trace exporter. If an exporter is configured, it will be used with a [BatchSpanProcessor](../../../packages/opentelemetry-sdk-trace-base/src/platform/node/export/BatchSpanProcessor.ts). If an exporter OR span processor is not configured programatically, this package will auto setup the default `otlp` exporter with `http/protobuf` protocol with a `BatchSpanProcessor`.
133
133
 
134
134
  ### spanLimits
135
135
 
@@ -139,6 +139,34 @@ Configure tracing parameters. These are the same trace parameters used to [confi
139
139
 
140
140
  Configure the [service name](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#service).
141
141
 
142
+ ## Disable the SDK from the environment
143
+
144
+ Disable the SDK by setting the `OTEL_SDK_DISABLED` environment variable to `true`.
145
+
146
+ ## Configure Trace Exporter from Environment
147
+
148
+ This is an alternative to programmatically configuring an exporter or span processor. This package will auto setup the default `otlp` exporter with `http/protobuf` protocol if `traceExporter` or `spanProcessor` hasn't been passed into the `NodeSDK` constructor.
149
+
150
+ ### Exporters
151
+
152
+ | Environment variable | Description |
153
+ |----------------------|-------------|
154
+ | OTEL_TRACES_EXPORTER | List of exporters to be used for tracing, separated by commas. Options include `otlp`, `jaeger`, `zipkin`, and `none`. Default is `otlp`. `none` means no autoconfigured exporter.
155
+
156
+ ### OTLP Exporter
157
+
158
+ | Environment variable | Description |
159
+ |----------------------|-------------|
160
+ | OTEL_EXPORTER_OTLP_PROTOCOL | The transport protocol to use on OTLP trace, metric, and log requests. Options include `grpc`, `http/protobuf`, and `http/json`. Default is `http/protobuf`. |
161
+ | OTEL_EXPORTER_OTLP_TRACES_PROTOCOL | The transport protocol to use on OTLP trace requests. Options include `grpc`, `http/protobuf`, and `http/json`. Default is `http/protobuf`. |
162
+ | OTEL_EXPORTER_OTLP_METRICS_PROTOCOL | The transport protocol to use on OTLP metric requests. Options include `grpc`, `http/protobuf`, and `http/json`. Default is `http/protobuf`. |
163
+
164
+ Additionally, you can specify other applicable environment variables that apply to each exporter such as the following:
165
+
166
+ - [OTLP exporter environment configuration](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options)
167
+ - [Zipkin exporter environment configuration](https://github.com/open-telemetry/opentelemetry-specification/blob/6ce62202e5407518e19c56c445c13682ef51a51d/specification/sdk-environment-variables.md#zipkin-exporter)
168
+ - [Jaeger exporter environment configuration](https://github.com/open-telemetry/opentelemetry-specification/blob/6ce62202e5407518e19c56c445c13682ef51a51d/specification/sdk-environment-variables.md#jaeger-exporter)
169
+
142
170
  ## Useful links
143
171
 
144
172
  - For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
@@ -0,0 +1,17 @@
1
+ import { SpanExporter, SDKRegistrationConfig, SpanProcessor } from '@opentelemetry/sdk-trace-base';
2
+ import { NodeTracerConfig, NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
3
+ export declare class TracerProviderWithEnvExporters extends NodeTracerProvider {
4
+ private _configuredExporters;
5
+ private _spanProcessors;
6
+ private _hasSpanProcessors;
7
+ static configureOtlp(): SpanExporter;
8
+ static getOtlpProtocol(): string;
9
+ protected static _registeredExporters: Map<string, () => SpanExporter>;
10
+ constructor(config?: NodeTracerConfig);
11
+ addSpanProcessor(spanProcessor: SpanProcessor): void;
12
+ register(config?: SDKRegistrationConfig): void;
13
+ private createExportersFromList;
14
+ private configureSpanProcessors;
15
+ private filterBlanksAndNulls;
16
+ }
17
+ //# sourceMappingURL=TracerProviderWithEnvExporter.d.ts.map
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var _a;
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.TracerProviderWithEnvExporters = void 0;
20
+ const api_1 = require("@opentelemetry/api");
21
+ const core_1 = require("@opentelemetry/core");
22
+ const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
23
+ const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
24
+ const exporter_trace_otlp_proto_1 = require("@opentelemetry/exporter-trace-otlp-proto");
25
+ const exporter_trace_otlp_http_1 = require("@opentelemetry/exporter-trace-otlp-http");
26
+ const exporter_trace_otlp_grpc_1 = require("@opentelemetry/exporter-trace-otlp-grpc");
27
+ const exporter_zipkin_1 = require("@opentelemetry/exporter-zipkin");
28
+ const exporter_jaeger_1 = require("@opentelemetry/exporter-jaeger");
29
+ class TracerProviderWithEnvExporters extends sdk_trace_node_1.NodeTracerProvider {
30
+ constructor(config = {}) {
31
+ super(config);
32
+ this._configuredExporters = [];
33
+ this._hasSpanProcessors = false;
34
+ let traceExportersList = this.filterBlanksAndNulls(Array.from(new Set((0, core_1.getEnv)().OTEL_TRACES_EXPORTER.split(','))));
35
+ if (traceExportersList[0] === 'none') {
36
+ api_1.diag.warn('OTEL_TRACES_EXPORTER contains "none". SDK will not be initialized.');
37
+ }
38
+ else if (traceExportersList.length === 0) {
39
+ api_1.diag.warn('OTEL_TRACES_EXPORTER is empty. Using default otlp exporter.');
40
+ traceExportersList = ['otlp'];
41
+ this.createExportersFromList(traceExportersList);
42
+ this._spanProcessors = this.configureSpanProcessors(this._configuredExporters);
43
+ this._spanProcessors.forEach(processor => {
44
+ this.addSpanProcessor(processor);
45
+ });
46
+ }
47
+ else {
48
+ if (traceExportersList.length > 1 &&
49
+ traceExportersList.includes('none')) {
50
+ api_1.diag.warn('OTEL_TRACES_EXPORTER contains "none" along with other exporters. Using default otlp exporter.');
51
+ traceExportersList = ['otlp'];
52
+ }
53
+ this.createExportersFromList(traceExportersList);
54
+ if (this._configuredExporters.length > 0) {
55
+ this._spanProcessors = this.configureSpanProcessors(this._configuredExporters);
56
+ this._spanProcessors.forEach(processor => {
57
+ this.addSpanProcessor(processor);
58
+ });
59
+ }
60
+ else {
61
+ api_1.diag.warn('Unable to set up trace exporter(s) due to invalid exporter and/or protocol values.');
62
+ }
63
+ }
64
+ }
65
+ static configureOtlp() {
66
+ const protocol = this.getOtlpProtocol();
67
+ switch (protocol) {
68
+ case 'grpc':
69
+ return new exporter_trace_otlp_grpc_1.OTLPTraceExporter();
70
+ case 'http/json':
71
+ return new exporter_trace_otlp_http_1.OTLPTraceExporter();
72
+ case 'http/protobuf':
73
+ return new exporter_trace_otlp_proto_1.OTLPTraceExporter();
74
+ default:
75
+ api_1.diag.warn(`Unsupported OTLP traces protocol: ${protocol}. Using http/protobuf.`);
76
+ return new exporter_trace_otlp_proto_1.OTLPTraceExporter();
77
+ }
78
+ }
79
+ static getOtlpProtocol() {
80
+ var _b, _c, _d;
81
+ const parsedEnvValues = (0, core_1.getEnvWithoutDefaults)();
82
+ return ((_d = (_c = (_b = parsedEnvValues.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL) !== null && _b !== void 0 ? _b : parsedEnvValues.OTEL_EXPORTER_OTLP_PROTOCOL) !== null && _c !== void 0 ? _c : (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_PROTOCOL) !== null && _d !== void 0 ? _d : (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_PROTOCOL);
83
+ }
84
+ addSpanProcessor(spanProcessor) {
85
+ super.addSpanProcessor(spanProcessor);
86
+ this._hasSpanProcessors = true;
87
+ }
88
+ register(config) {
89
+ if (this._hasSpanProcessors) {
90
+ super.register(config);
91
+ }
92
+ }
93
+ createExportersFromList(exporterList) {
94
+ exporterList.forEach(exporterName => {
95
+ const exporter = this._getSpanExporter(exporterName);
96
+ if (exporter) {
97
+ this._configuredExporters.push(exporter);
98
+ }
99
+ else {
100
+ api_1.diag.warn(`Unrecognized OTEL_TRACES_EXPORTER value: ${exporterName}.`);
101
+ }
102
+ });
103
+ }
104
+ configureSpanProcessors(exporters) {
105
+ return exporters.map(exporter => {
106
+ if (exporter instanceof sdk_trace_base_1.ConsoleSpanExporter) {
107
+ return new sdk_trace_base_1.SimpleSpanProcessor(exporter);
108
+ }
109
+ else {
110
+ return new sdk_trace_base_1.BatchSpanProcessor(exporter);
111
+ }
112
+ });
113
+ }
114
+ filterBlanksAndNulls(list) {
115
+ return list.map(item => item.trim()).filter(s => s !== 'null' && s !== '');
116
+ }
117
+ }
118
+ exports.TracerProviderWithEnvExporters = TracerProviderWithEnvExporters;
119
+ _a = TracerProviderWithEnvExporters;
120
+ TracerProviderWithEnvExporters._registeredExporters = new Map([
121
+ ['otlp', () => _a.configureOtlp()],
122
+ ['zipkin', () => new exporter_zipkin_1.ZipkinExporter()],
123
+ ['jaeger', () => new exporter_jaeger_1.JaegerExporter()],
124
+ ['console', () => new sdk_trace_base_1.ConsoleSpanExporter()],
125
+ ]);
126
+ //# sourceMappingURL=TracerProviderWithEnvExporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TracerProviderWithEnvExporter.js","sourceRoot":"","sources":["../../src/TracerProviderWithEnvExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH,4CAA0C;AAC1C,8CAAoE;AACpE,kEAOuC;AACvC,kEAGuC;AACvC,wFAAuG;AACvG,sFAAqG;AACrG,sFAAqG;AACrG,oEAAgE;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,CAAE,CAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { diag } from '@opentelemetry/api';\nimport { getEnv, getEnvWithoutDefaults } from '@opentelemetry/core';\nimport {\n ConsoleSpanExporter,\n SpanExporter,\n BatchSpanProcessor,\n SimpleSpanProcessor,\n SDKRegistrationConfig,\n SpanProcessor,\n} from '@opentelemetry/sdk-trace-base';\nimport {\n NodeTracerConfig,\n NodeTracerProvider,\n} from '@opentelemetry/sdk-trace-node';\nimport { OTLPTraceExporter as OTLPProtoTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';\nimport { OTLPTraceExporter as OTLPHttpTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';\nimport { OTLPTraceExporter as OTLPGrpcTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';\nimport { ZipkinExporter } from '@opentelemetry/exporter-zipkin';\nimport { JaegerExporter } from '@opentelemetry/exporter-jaeger';\n\nexport class TracerProviderWithEnvExporters extends NodeTracerProvider {\n private _configuredExporters: SpanExporter[] = [];\n private _spanProcessors: SpanProcessor[] | undefined;\n private _hasSpanProcessors: boolean = false;\n\n static configureOtlp(): SpanExporter {\n const protocol = this.getOtlpProtocol();\n\n switch (protocol) {\n case 'grpc':\n return new OTLPGrpcTraceExporter();\n case 'http/json':\n return new OTLPHttpTraceExporter();\n case 'http/protobuf':\n return new OTLPProtoTraceExporter();\n default:\n diag.warn(\n `Unsupported OTLP traces protocol: ${protocol}. Using http/protobuf.`\n );\n return new OTLPProtoTraceExporter();\n }\n }\n\n static getOtlpProtocol(): string {\n const parsedEnvValues = getEnvWithoutDefaults();\n\n return (\n parsedEnvValues.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL ??\n parsedEnvValues.OTEL_EXPORTER_OTLP_PROTOCOL ??\n getEnv().OTEL_EXPORTER_OTLP_TRACES_PROTOCOL ??\n getEnv().OTEL_EXPORTER_OTLP_PROTOCOL\n );\n }\n\n protected static override _registeredExporters = new Map<\n string,\n () => SpanExporter\n >([\n ['otlp', () => this.configureOtlp()],\n ['zipkin', () => new ZipkinExporter()],\n ['jaeger', () => new JaegerExporter()],\n ['console', () => new ConsoleSpanExporter()],\n ]);\n\n public constructor(config: NodeTracerConfig = {}) {\n super(config);\n let traceExportersList = this.filterBlanksAndNulls(\n Array.from(new Set(getEnv().OTEL_TRACES_EXPORTER.split(',')))\n );\n\n if (traceExportersList[0] === 'none') {\n diag.warn(\n 'OTEL_TRACES_EXPORTER contains \"none\". SDK will not be initialized.'\n );\n } else if (traceExportersList.length === 0) {\n diag.warn('OTEL_TRACES_EXPORTER is empty. Using default otlp exporter.');\n\n traceExportersList = ['otlp'];\n this.createExportersFromList(traceExportersList);\n\n this._spanProcessors = this.configureSpanProcessors(\n this._configuredExporters\n );\n this._spanProcessors.forEach(processor => {\n this.addSpanProcessor(processor);\n });\n } else {\n if (\n traceExportersList.length > 1 &&\n traceExportersList.includes('none')\n ) {\n diag.warn(\n 'OTEL_TRACES_EXPORTER contains \"none\" along with other exporters. Using default otlp exporter.'\n );\n traceExportersList = ['otlp'];\n }\n\n this.createExportersFromList(traceExportersList);\n\n if (this._configuredExporters.length > 0) {\n this._spanProcessors = this.configureSpanProcessors(\n this._configuredExporters\n );\n this._spanProcessors.forEach(processor => {\n this.addSpanProcessor(processor);\n });\n } else {\n diag.warn(\n 'Unable to set up trace exporter(s) due to invalid exporter and/or protocol values.'\n );\n }\n }\n }\n\n override addSpanProcessor(spanProcessor: SpanProcessor) {\n super.addSpanProcessor(spanProcessor);\n this._hasSpanProcessors = true;\n }\n\n override register(config?: SDKRegistrationConfig) {\n if (this._hasSpanProcessors) {\n super.register(config);\n }\n }\n\n private createExportersFromList(exporterList: string[]) {\n exporterList.forEach(exporterName => {\n const exporter = this._getSpanExporter(exporterName);\n if (exporter) {\n this._configuredExporters.push(exporter);\n } else {\n diag.warn(`Unrecognized OTEL_TRACES_EXPORTER value: ${exporterName}.`);\n }\n });\n }\n\n private configureSpanProcessors(\n exporters: SpanExporter[]\n ): (BatchSpanProcessor | SimpleSpanProcessor)[] {\n return exporters.map(exporter => {\n if (exporter instanceof ConsoleSpanExporter) {\n return new SimpleSpanProcessor(exporter);\n } else {\n return new BatchSpanProcessor(exporter);\n }\n });\n }\n\n private filterBlanksAndNulls(list: string[]): string[] {\n return list.map(item => item.trim()).filter(s => s !== 'null' && s !== '');\n }\n}\n"]}
@@ -25,6 +25,7 @@ export declare class NodeSDK {
25
25
  private _tracerProvider?;
26
26
  private _meterProvider?;
27
27
  private _serviceName?;
28
+ private _disabled?;
28
29
  /**
29
30
  * Create a new NodeJS SDK instance
30
31
  */
package/build/src/sdk.js CHANGED
@@ -16,21 +16,31 @@
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.NodeSDK = void 0;
19
- const api_metrics_1 = require("@opentelemetry/api-metrics");
19
+ const api_1 = require("@opentelemetry/api");
20
20
  const instrumentation_1 = require("@opentelemetry/instrumentation");
21
21
  const resources_1 = require("@opentelemetry/resources");
22
22
  const sdk_metrics_1 = require("@opentelemetry/sdk-metrics");
23
23
  const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
24
24
  const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
25
25
  const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
26
+ const TracerProviderWithEnvExporter_1 = require("./TracerProviderWithEnvExporter");
27
+ const core_1 = require("@opentelemetry/core");
26
28
  class NodeSDK {
27
29
  /**
28
30
  * Create a new NodeJS SDK instance
29
31
  */
30
32
  constructor(configuration = {}) {
31
33
  var _a, _b, _c, _d;
34
+ if ((0, core_1.getEnv)().OTEL_SDK_DISABLED) {
35
+ this._disabled = true;
36
+ // Functions with possible side-effects are set
37
+ // to no-op via the _disabled flag
38
+ }
32
39
  this._resource = (_a = configuration.resource) !== null && _a !== void 0 ? _a : new resources_1.Resource({});
33
- this._resourceDetectors = (_b = configuration.resourceDetectors) !== null && _b !== void 0 ? _b : [resources_1.envDetector, resources_1.processDetector];
40
+ this._resourceDetectors = (_b = configuration.resourceDetectors) !== null && _b !== void 0 ? _b : [
41
+ resources_1.envDetector,
42
+ resources_1.processDetector,
43
+ ];
34
44
  this._serviceName = configuration.serviceName;
35
45
  this._autoDetectResources = (_c = configuration.autoDetectResources) !== null && _c !== void 0 ? _c : true;
36
46
  if (configuration.spanProcessor || configuration.traceExporter) {
@@ -95,6 +105,9 @@ class NodeSDK {
95
105
  }
96
106
  /** Detect resource attributes */
97
107
  async detectResources() {
108
+ if (this._disabled) {
109
+ return;
110
+ }
98
111
  const internalConfig = {
99
112
  detectors: this._resourceDetectors,
100
113
  };
@@ -108,32 +121,41 @@ class NodeSDK {
108
121
  * Once the SDK has been configured, call this method to construct SDK components and register them with the OpenTelemetry API.
109
122
  */
110
123
  async start() {
111
- var _a, _b;
124
+ var _a, _b, _c, _d, _e;
125
+ if (this._disabled) {
126
+ return;
127
+ }
112
128
  if (this._autoDetectResources) {
113
129
  await this.detectResources();
114
130
  }
115
- this._resource = this._serviceName === undefined
116
- ? this._resource
117
- : this._resource.merge(new resources_1.Resource({ [semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: this._serviceName }));
131
+ this._resource =
132
+ this._serviceName === undefined
133
+ ? this._resource
134
+ : this._resource.merge(new resources_1.Resource({
135
+ [semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: this._serviceName,
136
+ }));
137
+ const Provider = this._tracerProviderConfig
138
+ ? sdk_trace_node_1.NodeTracerProvider
139
+ : TracerProviderWithEnvExporter_1.TracerProviderWithEnvExporters;
140
+ const tracerProvider = new Provider(Object.assign(Object.assign({}, (_a = this._tracerProviderConfig) === null || _a === void 0 ? void 0 : _a.tracerConfig), { resource: this._resource }));
141
+ this._tracerProvider = tracerProvider;
118
142
  if (this._tracerProviderConfig) {
119
- const tracerProvider = new sdk_trace_node_1.NodeTracerProvider(Object.assign(Object.assign({}, this._tracerProviderConfig.tracerConfig), { resource: this._resource }));
120
- this._tracerProvider = tracerProvider;
121
143
  tracerProvider.addSpanProcessor(this._tracerProviderConfig.spanProcessor);
122
- tracerProvider.register({
123
- contextManager: this._tracerProviderConfig.contextManager,
124
- propagator: this._tracerProviderConfig.textMapPropagator,
125
- });
126
144
  }
145
+ tracerProvider.register({
146
+ contextManager: (_b = this._tracerProviderConfig) === null || _b === void 0 ? void 0 : _b.contextManager,
147
+ propagator: (_c = this._tracerProviderConfig) === null || _c === void 0 ? void 0 : _c.textMapPropagator,
148
+ });
127
149
  if (this._meterProviderConfig) {
128
150
  const meterProvider = new sdk_metrics_1.MeterProvider({
129
151
  resource: this._resource,
130
- views: (_b = (_a = this._meterProviderConfig) === null || _a === void 0 ? void 0 : _a.views) !== null && _b !== void 0 ? _b : [],
152
+ views: (_e = (_d = this._meterProviderConfig) === null || _d === void 0 ? void 0 : _d.views) !== null && _e !== void 0 ? _e : [],
131
153
  });
132
154
  if (this._meterProviderConfig.reader) {
133
155
  meterProvider.addMetricReader(this._meterProviderConfig.reader);
134
156
  }
135
157
  this._meterProvider = meterProvider;
136
- api_metrics_1.metrics.setGlobalMeterProvider(meterProvider);
158
+ api_1.metrics.setGlobalMeterProvider(meterProvider);
137
159
  }
138
160
  (0, instrumentation_1.registerInstrumentations)({
139
161
  instrumentations: this._instrumentations,
@@ -149,8 +171,7 @@ class NodeSDK {
149
171
  }
150
172
  return (Promise.all(promises)
151
173
  // return void instead of the array from Promise.all
152
- .then(() => {
153
- }));
174
+ .then(() => { }));
154
175
  }
155
176
  }
156
177
  exports.NodeSDK = NodeSDK;
@@ -1 +1 @@
1
- {"version":3,"file":"sd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,cAAc,EAAE,IAAI,CAAC,qBAAqB,CAAC,cAAc;gBACzD,UAAU,EAAE,IAAI,CAAC,qBAAqB,CAAC,iBAAiB;aACzD,CAAC,CAAC;SACJ;QAED,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC7B,MAAM,aAAa,GAAG,IAAI,2BAAa,CAAC;gBACtC,QAAQ,EAAE,IAAI,CAAC,SAAS;gBACxB,KAAK,EAAE,MAAA,MAAA,IAAI,CAAC,oBAAoB,0CAAE,KAAK,mCAAI,EAAE;aAC9C,CAAC,CAAC;YAEH,IAAI,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE;gBACpC,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;aACjE;YAED,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;YAEpC,qBAAO,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC;SAC/C;QAED,IAAA,0CAAwB,EAAC;YACvB,gBAAgB,EAAE,IAAI,CAAC,iBAAiB;SACzC,CAAC,CAAC;IACL,CAAC;IAEM,QAAQ;QACb,MAAM,QAAQ,GAAuB,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC;SAChD;QACD,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC/C;QAED,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;YACnB,oDAAoD;aACnD,IAAI,CAAC,GAAG,EAAE;QACX,CAAC,CAAC,CACL,CAAC;IACJ,CAAC;CACF;AAnMD,0BAmMC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ContextManager, TextMapPropagator } from '@opentelemetry/api';\nimport { metrics } from '@opentelemetry/api-metrics';\nimport {\n InstrumentationOption,\n registerInstrumentations\n} from '@opentelemetry/instrumentation';\nimport {\n Detector,\n detectResources,\n envDetector,\n processDetector,\n Resource,\n ResourceDetectionConfig\n} from '@opentelemetry/resources';\nimport { MeterProvider, MetricReader, View } from '@opentelemetry/sdk-metrics';\nimport {\n BatchSpanProcessor,\n SpanProcessor\n} from '@opentelemetry/sdk-trace-base';\nimport { NodeTracerConfig, NodeTracerProvider } from '@opentelemetry/sdk-trace-node';\nimport { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';\nimport { NodeSDKConfiguration } from './types';\n\n/** This class represents everything needed to register a fully configured OpenTelemetry Node.js SDK */\n\nexport type MeterProviderConfig = {\n /**\n * Reference to the MetricReader instance by the NodeSDK\n */\n reader?: MetricReader\n /**\n * List of {@link View}s that should be passed to the MeterProvider\n */\n views?: View[]\n};\nexport class NodeSDK {\n private _tracerProviderConfig?: {\n tracerConfig: NodeTracerConfig;\n spanProcessor: SpanProcessor;\n contextManager?: ContextManager;\n textMapPropagator?: TextMapPropagator;\n };\n private _meterProviderConfig?: MeterProviderConfig;\n private _instrumentations: InstrumentationOption[];\n\n private _resource: Resource;\n private _resourceDetectors: Detector[];\n\n private _autoDetectResources: boolean;\n\n private _tracerProvider?: NodeTracerProvider;\n private _meterProvider?: MeterProvider;\n private _serviceName?: string;\n\n /**\n * Create a new NodeJS SDK instance\n */\n public constructor(configuration: Partial<NodeSDKConfiguration> = {}) {\n this._resource = configuration.resource ?? new Resource({});\n this._resourceDetectors = configuration.resourceDetectors ?? [envDetector, processDetector];\n\n this._serviceName = configuration.serviceName;\n\n this._autoDetectResources = configuration.autoDetectResources ?? true;\n\n if (configuration.spanProcessor || configuration.traceExporter) {\n const tracerProviderConfig: NodeTracerConfig = {};\n\n if (configuration.sampler) {\n tracerProviderConfig.sampler = configuration.sampler;\n }\n if (configuration.spanLimits) {\n tracerProviderConfig.spanLimits = configuration.spanLimits;\n }\n\n const spanProcessor =\n configuration.spanProcessor ??\n new BatchSpanProcessor(configuration.traceExporter!);\n\n this.configureTracerProvider(\n tracerProviderConfig,\n spanProcessor,\n configuration.contextManager,\n configuration.textMapPropagator\n );\n }\n\n if (configuration.metricReader || configuration.views) {\n const meterProviderConfig: MeterProviderConfig = {};\n if (configuration.metricReader) {\n meterProviderConfig.reader = configuration.metricReader;\n }\n\n if (configuration.views) {\n meterProviderConfig.views = configuration.views;\n }\n\n this.configureMeterProvider(meterProviderConfig);\n }\n\n let instrumentations: InstrumentationOption[] = [];\n if (configuration.instrumentations) {\n instrumentations = configuration.instrumentations;\n }\n this._instrumentations = instrumentations;\n }\n\n /** Set configurations required to register a NodeTracerProvider */\n public configureTracerProvider(\n tracerConfig: NodeTracerConfig,\n spanProcessor: SpanProcessor,\n contextManager?: ContextManager,\n textMapPropagator?: TextMapPropagator\n ): void {\n this._tracerProviderConfig = {\n tracerConfig,\n spanProcessor,\n contextManager,\n textMapPropagator,\n };\n }\n\n /** Set configurations needed to register a MeterProvider */\n public configureMeterProvider(config: MeterProviderConfig): void {\n // nothing is set yet, we can set config and return.\n if (this._meterProviderConfig == null) {\n this._meterProviderConfig = config;\n return;\n }\n\n // make sure we do not override existing views with other views.\n if (this._meterProviderConfig.views != null && config.views != null) {\n throw new Error('Views passed but Views have already been configured.');\n }\n\n // set views, but make sure we do not override existing views with null/undefined.\n if (config.views != null) {\n this._meterProviderConfig.views = config.views;\n }\n\n // make sure we do not override existing reader with another reader.\n if (this._meterProviderConfig.reader != null && config.reader != null) {\n throw new Error('MetricReader passed but MetricReader has already been configured.');\n }\n\n // set reader, but make sure we do not override existing reader with null/undefined.\n if (config.reader != null) {\n this._meterProviderConfig.reader = config.reader;\n }\n }\n\n /** Detect resource attributes */\n public async detectResources(): Promise<void> {\n const internalConfig: ResourceDetectionConfig = {\n detectors: this._resourceDetectors,\n };\n\n this.addResource(await detectResources(internalConfig));\n }\n\n /** Manually add a resource */\n public addResource(resource: Resource): void {\n this._resource = this._resource.merge(resource);\n }\n\n /**\n * Once the SDK has been configured, call this method to construct SDK components and register them with the OpenTelemetry API.\n */\n public async start(): Promise<void> {\n if (this._autoDetectResources) {\n await this.detectResources();\n }\n\n this._resource = this._serviceName === undefined\n ? this._resource\n : this._resource.merge(new Resource(\n { [SemanticResourceAttributes.SERVICE_NAME]: this._serviceName }\n ));\n\n if (this._tracerProviderConfig) {\n const tracerProvider = new NodeTracerProvider({\n ...this._tracerProviderConfig.tracerConfig,\n resource: this._resource,\n });\n\n this._tracerProvider = tracerProvider;\n\n tracerProvider.addSpanProcessor(this._tracerProviderConfig.spanProcessor);\n tracerProvider.register({\n contextManager: this._tracerProviderConfig.contextManager,\n propagator: this._tracerProviderConfig.textMapPropagator,\n });\n }\n\n if (this._meterProviderConfig) {\n const meterProvider = new MeterProvider({\n resource: this._resource,\n views: this._meterProviderConfig?.views ?? [],\n });\n\n if (this._meterProviderConfig.reader) {\n meterProvider.addMetricReader(this._meterProviderConfig.reader);\n }\n\n this._meterProvider = meterProvider;\n\n metrics.setGlobalMeterProvider(meterProvider);\n }\n\n registerInstrumentations({\n instrumentations: this._instrumentations,\n });\n }\n\n public shutdown(): Promise<void> {\n const promises: Promise<unknown>[] = [];\n if (this._tracerProvider) {\n promises.push(this._tracerProvider.shutdown());\n }\n if (this._meterProvider) {\n promises.push(this._meterProvider.shutdown());\n }\n\n return (\n Promise.all(promises)\n // return void instead of the array from Promise.all\n .then(() => {\n })\n );\n }\n}\n"]}
1
+ {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;G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,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC/C;QAED,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;YACnB,oDAAoD;aACnD,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAClB,CAAC;IACJ,CAAC;CACF;AA/ND,0BA+NC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ContextManager, TextMapPropagator, metrics } from '@opentelemetry/api';\nimport {\n InstrumentationOption,\n registerInstrumentations,\n} from '@opentelemetry/instrumentation';\nimport {\n Detector,\n detectResources,\n envDetector,\n processDetector,\n Resource,\n ResourceDetectionConfig,\n} from '@opentelemetry/resources';\nimport { MeterProvider, MetricReader, View } from '@opentelemetry/sdk-metrics';\nimport {\n BatchSpanProcessor,\n SpanProcessor,\n} from '@opentelemetry/sdk-trace-base';\nimport {\n NodeTracerConfig,\n NodeTracerProvider,\n} from '@opentelemetry/sdk-trace-node';\nimport { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';\nimport { NodeSDKConfiguration } from './types';\nimport { TracerProviderWithEnvExporters } from './TracerProviderWithEnvExporter';\nimport { getEnv } from '@opentelemetry/core';\n\n/** This class represents everything needed to register a fully configured OpenTelemetry Node.js SDK */\n\nexport type MeterProviderConfig = {\n /**\n * Reference to the MetricReader instance by the NodeSDK\n */\n reader?: MetricReader;\n /**\n * List of {@link View}s that should be passed to the MeterProvider\n */\n views?: View[];\n};\nexport class NodeSDK {\n private _tracerProviderConfig?: {\n tracerConfig: NodeTracerConfig;\n spanProcessor: SpanProcessor;\n contextManager?: ContextManager;\n textMapPropagator?: TextMapPropagator;\n };\n private _meterProviderConfig?: MeterProviderConfig;\n private _instrumentations: InstrumentationOption[];\n\n private _resource: Resource;\n private _resourceDetectors: Detector[];\n\n private _autoDetectResources: boolean;\n\n private _tracerProvider?: NodeTracerProvider | TracerProviderWithEnvExporters;\n private _meterProvider?: MeterProvider;\n private _serviceName?: string;\n\n private _disabled?: boolean;\n\n /**\n * Create a new NodeJS SDK instance\n */\n public constructor(configuration: Partial<NodeSDKConfiguration> = {}) {\n if (getEnv().OTEL_SDK_DISABLED) {\n this._disabled = true;\n // Functions with possible side-effects are set\n // to no-op via the _disabled flag\n }\n\n this._resource = configuration.resource ?? new Resource({});\n this._resourceDetectors = configuration.resourceDetectors ?? [\n envDetector,\n processDetector,\n ];\n\n this._serviceName = configuration.serviceName;\n\n this._autoDetectResources = configuration.autoDetectResources ?? true;\n\n if (configuration.spanProcessor || configuration.traceExporter) {\n const tracerProviderConfig: NodeTracerConfig = {};\n\n if (configuration.sampler) {\n tracerProviderConfig.sampler = configuration.sampler;\n }\n if (configuration.spanLimits) {\n tracerProviderConfig.spanLimits = configuration.spanLimits;\n }\n\n const spanProcessor =\n configuration.spanProcessor ??\n new BatchSpanProcessor(configuration.traceExporter!);\n\n this.configureTracerProvider(\n tracerProviderConfig,\n spanProcessor,\n configuration.contextManager,\n configuration.textMapPropagator\n );\n }\n\n if (configuration.metricReader || configuration.views) {\n const meterProviderConfig: MeterProviderConfig = {};\n if (configuration.metricReader) {\n meterProviderConfig.reader = configuration.metricReader;\n }\n\n if (configuration.views) {\n meterProviderConfig.views = configuration.views;\n }\n\n this.configureMeterProvider(meterProviderConfig);\n }\n\n let instrumentations: InstrumentationOption[] = [];\n if (configuration.instrumentations) {\n instrumentations = configuration.instrumentations;\n }\n this._instrumentations = instrumentations;\n }\n\n /** Set configurations required to register a NodeTracerProvider */\n public configureTracerProvider(\n tracerConfig: NodeTracerConfig,\n spanProcessor: SpanProcessor,\n contextManager?: ContextManager,\n textMapPropagator?: TextMapPropagator\n ): void {\n this._tracerProviderConfig = {\n tracerConfig,\n spanProcessor,\n contextManager,\n textMapPropagator,\n };\n }\n\n /** Set configurations needed to register a MeterProvider */\n public configureMeterProvider(config: MeterProviderConfig): void {\n // nothing is set yet, we can set config and return.\n if (this._meterProviderConfig == null) {\n this._meterProviderConfig = config;\n return;\n }\n\n // make sure we do not override existing views with other views.\n if (this._meterProviderConfig.views != null && config.views != null) {\n throw new Error('Views passed but Views have already been configured.');\n }\n\n // set views, but make sure we do not override existing views with null/undefined.\n if (config.views != null) {\n this._meterProviderConfig.views = config.views;\n }\n\n // make sure we do not override existing reader with another reader.\n if (this._meterProviderConfig.reader != null && config.reader != null) {\n throw new Error(\n 'MetricReader passed but MetricReader has already been configured.'\n );\n }\n\n // set reader, but make sure we do not override existing reader with null/undefined.\n if (config.reader != null) {\n this._meterProviderConfig.reader = config.reader;\n }\n }\n\n /** Detect resource attributes */\n public async detectResources(): Promise<void> {\n if (this._disabled) {\n return;\n }\n\n const internalConfig: ResourceDetectionConfig = {\n detectors: this._resourceDetectors,\n };\n\n this.addResource(await detectResources(internalConfig));\n }\n\n /** Manually add a resource */\n public addResource(resource: Resource): void {\n this._resource = this._resource.merge(resource);\n }\n\n /**\n * Once the SDK has been configured, call this method to construct SDK components and register them with the OpenTelemetry API.\n */\n public async start(): Promise<void> {\n if (this._disabled) {\n return;\n }\n\n if (this._autoDetectResources) {\n await this.detectResources();\n }\n\n this._resource =\n this._serviceName === undefined\n ? this._resource\n : this._resource.merge(\n new Resource({\n [SemanticResourceAttributes.SERVICE_NAME]: this._serviceName,\n })\n );\n\n const Provider = this._tracerProviderConfig\n ? NodeTracerProvider\n : TracerProviderWithEnvExporters;\n\n const tracerProvider = new Provider({\n ...this._tracerProviderConfig?.tracerConfig,\n resource: this._resource,\n });\n\n this._tracerProvider = tracerProvider;\n\n if (this._tracerProviderConfig) {\n tracerProvider.addSpanProcessor(this._tracerProviderConfig.spanProcessor);\n }\n\n tracerProvider.register({\n contextManager: this._tracerProviderConfig?.contextManager,\n propagator: this._tracerProviderConfig?.textMapPropagator,\n });\n\n if (this._meterProviderConfig) {\n const meterProvider = new MeterProvider({\n resource: this._resource,\n views: this._meterProviderConfig?.views ?? [],\n });\n\n if (this._meterProviderConfig.reader) {\n meterProvider.addMetricReader(this._meterProviderConfig.reader);\n }\n\n this._meterProvider = meterProvider;\n\n metrics.setGlobalMeterProvider(meterProvider);\n }\n\n registerInstrumentations({\n instrumentations: this._instrumentations,\n });\n }\n\n public shutdown(): Promise<void> {\n const promises: Promise<unknown>[] = [];\n if (this._tracerProvider) {\n promises.push(this._tracerProvider.shutdown());\n }\n if (this._meterProvider) {\n promises.push(this._meterProvider.shutdown());\n }\n\n return (\n Promise.all(promises)\n // return void instead of the array from Promise.all\n .then(() => {})\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ContextManager, SpanAttributes } from '@opentelemetry/api';\nimport { TextMapPropagator } from '@opentelemetry/api';\nimport { InstrumentationOption } from '@opentelemetry/instrumentation';\nimport { Detector, Resource } from '@opentelemetry/resources';\nimport { MetricReader, View } from '@opentelemetry/sdk-metrics';\nimport {\n Sampler,\n SpanExporter,\n SpanLimits,\n SpanProcessor,\n} from '@opentelemetry/sdk-trace-base';\n\nexport interface NodeSDKConfiguration {\n autoDetectResources: boolean;\n contextManager: ContextManager;\n defaultAttributes: SpanAttributes;\n textMapPropagator: TextMapPropagator;\n metricReader: MetricReader;\n views: View[]\n instrumentations: InstrumentationOption[];\n resource: Resource;\n resourceDetectors: Detector[];\n sampler: Sampler;\n serviceName?: string;\n spanProcessor: SpanProcessor;\n traceExporter: SpanExporter;\n spanLimits: SpanLimits;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ContextManager, SpanAttributes } from '@opentelemetry/api';\nimport { TextMapPropagator } from '@opentelemetry/api';\nimport { InstrumentationOption } from '@opentelemetry/instrumentation';\nimport { Detector, Resource } from '@opentelemetry/resources';\nimport { MetricReader, View } from '@opentelemetry/sdk-metrics';\nimport {\n Sampler,\n SpanExporter,\n SpanLimits,\n SpanProcessor,\n} from '@opentelemetry/sdk-trace-base';\n\nexport interface NodeSDKConfiguration {\n autoDetectResources: boolean;\n contextManager: ContextManager;\n defaultAttributes: SpanAttributes;\n textMapPropagator: TextMapPropagator;\n metricReader: MetricReader;\n views: View[];\n instrumentations: InstrumentationOption[];\n resource: Resource;\n resourceDetectors: Detector[];\n sampler: Sampler;\n serviceName?: string;\n spanProcessor: SpanProcessor;\n traceExporter: SpanExporter;\n spanLimits: SpanLimits;\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.33.0";
1
+ export declare const VERSION = "0.35.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -17,5 +17,5 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.VERSION = void 0;
19
19
  // this is autogenerated file, see scripts/version-update.js
20
- exports.VERSION = '0.33.0';
20
+ exports.VERSION = '0.35.0';
21
21
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.33.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.35.0';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/sdk-node",
3
- "version": "0.33.0",
3
+ "version": "0.35.0",
4
4
  "description": "OpenTelemetry SDK for Node.js",
5
5
  "main": "build/src/index.js",
6
6
  "types": "build/src/index.d.ts",
@@ -44,22 +44,26 @@
44
44
  "access": "public"
45
45
  },
46
46
  "dependencies": {
47
- "@opentelemetry/api-metrics": "0.33.0",
48
- "@opentelemetry/core": "1.7.0",
49
- "@opentelemetry/instrumentation": "0.33.0",
50
- "@opentelemetry/resources": "1.7.0",
51
- "@opentelemetry/sdk-metrics": "0.33.0",
52
- "@opentelemetry/sdk-trace-base": "1.7.0",
53
- "@opentelemetry/sdk-trace-node": "1.7.0"
47
+ "@opentelemetry/core": "1.9.0",
48
+ "@opentelemetry/exporter-jaeger": "1.9.0",
49
+ "@opentelemetry/exporter-trace-otlp-grpc": "0.35.0",
50
+ "@opentelemetry/exporter-trace-otlp-http": "0.35.0",
51
+ "@opentelemetry/exporter-trace-otlp-proto": "0.35.0",
52
+ "@opentelemetry/exporter-zipkin": "1.9.0",
53
+ "@opentelemetry/instrumentation": "0.35.0",
54
+ "@opentelemetry/resources": "1.9.0",
55
+ "@opentelemetry/sdk-metrics": "1.9.0",
56
+ "@opentelemetry/sdk-trace-base": "1.9.0",
57
+ "@opentelemetry/sdk-trace-node": "1.9.0",
58
+ "@opentelemetry/semantic-conventions": "1.9.0"
54
59
  },
55
60
  "peerDependencies": {
56
- "@opentelemetry/api": ">=1.0.0 <1.3.0"
61
+ "@opentelemetry/api": ">=1.3.0 <1.5.0"
57
62
  },
58
63
  "devDependencies": {
59
- "@opentelemetry/api": ">=1.0.0 <1.3.0",
60
- "@opentelemetry/context-async-hooks": "1.7.0",
61
- "@opentelemetry/semantic-conventions": "1.7.0",
62
- "@types/mocha": "9.1.1",
64
+ "@opentelemetry/api": ">=1.3.0 <1.5.0",
65
+ "@opentelemetry/context-async-hooks": "1.9.0",
66
+ "@types/mocha": "10.0.0",
63
67
  "@types/node": "18.6.5",
64
68
  "@types/semver": "7.3.9",
65
69
  "@types/sinon": "10.0.13",
@@ -68,11 +72,12 @@
68
72
  "mocha": "10.0.0",
69
73
  "nyc": "15.1.0",
70
74
  "semver": "7.3.5",
71
- "sinon": "14.0.0",
75
+ "sinon": "15.0.0",
72
76
  "ts-loader": "8.4.0",
73
77
  "ts-mocha": "10.0.0",
74
78
  "typescript": "4.4.4"
75
79
  },
76
80
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-sdk-node",
77
- "gitHead": "ad88c3d9aa0100fe259b93f4b660e84417b757ac"
81
+ "sideEffects": false,
82
+ "gitHead": "08f597f3a3d71a4852b0afbba120af15ca038121"
78
83
  }