@opentelemetry/sdk-node 0.31.0 → 0.33.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 +19 -12
- package/build/src/index.d.ts +1 -1
- package/build/src/index.js +1 -1
- package/build/src/index.js.map +1 -1
- package/build/src/sdk.d.ts +16 -5
- package/build/src/sdk.js +47 -14
- package/build/src/sdk.js.map +1 -1
- package/build/src/types.d.ts +6 -4
- package/build/src/types.js.map +1 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/build/src/version.js.map +1 -1
- package/package.json +20 -20
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
[![NPM Published Version][npm-img]][npm-url]
|
|
4
4
|
[![Apache License][license-image]][license-image]
|
|
5
5
|
|
|
6
|
+
**Note: This is an experimental package under active development. New releases may include breaking changes.**
|
|
7
|
+
|
|
6
8
|
This package provides the full OpenTelemetry SDK for Node.js including tracing and metrics.
|
|
7
9
|
|
|
8
10
|
## Quick Start
|
|
@@ -18,7 +20,7 @@ $ npm install @opentelemetry/sdk-node
|
|
|
18
20
|
$ # Install exporters and plugins
|
|
19
21
|
$ npm install \
|
|
20
22
|
@opentelemetry/exporter-jaeger \ # add tracing exporters as needed
|
|
21
|
-
@opentelemetry/exporter-prometheus # add metrics exporters as needed
|
|
23
|
+
@opentelemetry/exporter-prometheus \ # add metrics exporters as needed
|
|
22
24
|
@opentelemetry/instrumentation-http # add instrumentations as needed
|
|
23
25
|
|
|
24
26
|
$ # or install all officially supported core and contrib plugins
|
|
@@ -26,7 +28,7 @@ $ npm install @opentelemetry/auto-instrumentations-node
|
|
|
26
28
|
|
|
27
29
|
```
|
|
28
30
|
|
|
29
|
-
> Note: this example is for Node.js. See [examples/
|
|
31
|
+
> Note: this example is for Node.js. See [examples/opentelemetry-web](https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/opentelemetry-web) for a browser example.
|
|
30
32
|
|
|
31
33
|
### Initialize the SDK
|
|
32
34
|
|
|
@@ -50,7 +52,7 @@ const sdk = new opentelemetry.NodeSDK({
|
|
|
50
52
|
// Optional - if omitted, the tracing SDK will not be initialized
|
|
51
53
|
traceExporter: jaegerExporter,
|
|
52
54
|
// Optional - If omitted, the metrics SDK will not be initialized
|
|
53
|
-
|
|
55
|
+
metricReader: prometheusExporter,
|
|
54
56
|
// Optional - you can use the metapackage or load each instrumentation individually
|
|
55
57
|
instrumentations: [getNodeAutoInstrumentations()],
|
|
56
58
|
// See the Configuration section below for additional configuration options
|
|
@@ -92,17 +94,17 @@ Use a custom context manager. Default: [AsyncHooksContextManager](../../../packa
|
|
|
92
94
|
|
|
93
95
|
Use a custom propagator. Default: [CompositePropagator](../../../packages/opentelemetry-core/src/propagation/composite.ts) using [W3C Trace Context](../../../packages/opentelemetry-core/README.md#w3ctracecontextpropagator-propagator) and [Baggage](../../../packages/opentelemetry-core/README.md#baggage-propagator)
|
|
94
96
|
|
|
95
|
-
###
|
|
96
|
-
|
|
97
|
-
Use a custom processor for metrics. Default: UngroupedProcessor
|
|
98
|
-
|
|
99
|
-
### metricExporter
|
|
97
|
+
### metricReader
|
|
100
98
|
|
|
101
|
-
|
|
99
|
+
Add a [MetricReader](../opentelemetry-sdk-metrics/src/export/MetricReader.ts)
|
|
100
|
+
that will be passed to the `MeterProvider`. If `metricReader` is not configured,
|
|
101
|
+
the metrics SDK will not be initialized and registered.
|
|
102
102
|
|
|
103
|
-
###
|
|
103
|
+
### views
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
A list of views to be passed to the `MeterProvider`.
|
|
106
|
+
Accepts an array of [View](../opentelemetry-sdk-metrics/src/view/View.ts)-instances.
|
|
107
|
+
This parameter can be used to configure explicit bucket sizes of histogram metrics.
|
|
106
108
|
|
|
107
109
|
### instrumentations
|
|
108
110
|
|
|
@@ -114,9 +116,14 @@ or configure each instrumentation individually.
|
|
|
114
116
|
|
|
115
117
|
Configure a resource. Resources may also be detected by using the `autoDetectResources` method of the SDK.
|
|
116
118
|
|
|
119
|
+
### resourceDetectors
|
|
120
|
+
|
|
121
|
+
Configure resource detectors. By default, the resource detectors are [envDetector, processDetector].
|
|
122
|
+
NOTE: In order to enable the detection, the parameter `autoDetectResources` has to be `true`.
|
|
123
|
+
|
|
117
124
|
### sampler
|
|
118
125
|
|
|
119
|
-
Configure a custom sampler. By default all traces will be sampled.
|
|
126
|
+
Configure a custom sampler. By default, all traces will be sampled.
|
|
120
127
|
|
|
121
128
|
### spanProcessor
|
|
122
129
|
|
package/build/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * as api from '@opentelemetry/api';
|
|
2
2
|
export * as contextBase from '@opentelemetry/api';
|
|
3
3
|
export * as core from '@opentelemetry/core';
|
|
4
|
-
export * as metrics from '@opentelemetry/sdk-metrics
|
|
4
|
+
export * as metrics from '@opentelemetry/sdk-metrics';
|
|
5
5
|
export * as node from '@opentelemetry/sdk-trace-node';
|
|
6
6
|
export * as resources from '@opentelemetry/resources';
|
|
7
7
|
export * as tracing from '@opentelemetry/sdk-trace-base';
|
package/build/src/index.js
CHANGED
|
@@ -29,7 +29,7 @@ exports.tracing = exports.resources = exports.node = exports.metrics = exports.c
|
|
|
29
29
|
exports.api = require("@opentelemetry/api");
|
|
30
30
|
exports.contextBase = require("@opentelemetry/api");
|
|
31
31
|
exports.core = require("@opentelemetry/core");
|
|
32
|
-
exports.metrics = require("@opentelemetry/sdk-metrics
|
|
32
|
+
exports.metrics = require("@opentelemetry/sdk-metrics");
|
|
33
33
|
exports.node = require("@opentelemetry/sdk-trace-node");
|
|
34
34
|
exports.resources = require("@opentelemetry/resources");
|
|
35
35
|
exports.tracing = require("@opentelemetry/sdk-trace-base");
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,4CAA0C;AAC1C,oDAAkD;AAClD,8CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,4CAA0C;AAC1C,oDAAkD;AAClD,8CAA4C;AAC5C,wDAAsD;AACtD,wDAAsD;AACtD,wDAAsD;AACtD,2DAAyD;AACzD,wCAAsB;AACtB,0CAAwB","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\nexport * as api from '@opentelemetry/api';\nexport * as contextBase from '@opentelemetry/api';\nexport * as core from '@opentelemetry/core';\nexport * as metrics from '@opentelemetry/sdk-metrics';\nexport * as node from '@opentelemetry/sdk-trace-node';\nexport * as resources from '@opentelemetry/resources';\nexport * as tracing from '@opentelemetry/sdk-trace-base';\nexport * from './sdk';\nexport * from './types';\n"]}
|
package/build/src/sdk.d.ts
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { ContextManager, TextMapPropagator } from '@opentelemetry/api';
|
|
2
|
-
import { Resource
|
|
3
|
-
import { MetricReader } from '@opentelemetry/sdk-metrics
|
|
2
|
+
import { Resource } from '@opentelemetry/resources';
|
|
3
|
+
import { MetricReader, View } from '@opentelemetry/sdk-metrics';
|
|
4
4
|
import { SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
5
5
|
import { NodeTracerConfig } from '@opentelemetry/sdk-trace-node';
|
|
6
6
|
import { NodeSDKConfiguration } from './types';
|
|
7
7
|
/** This class represents everything needed to register a fully configured OpenTelemetry Node.js SDK */
|
|
8
|
+
export declare type MeterProviderConfig = {
|
|
9
|
+
/**
|
|
10
|
+
* Reference to the MetricReader instance by the NodeSDK
|
|
11
|
+
*/
|
|
12
|
+
reader?: MetricReader;
|
|
13
|
+
/**
|
|
14
|
+
* List of {@link View}s that should be passed to the MeterProvider
|
|
15
|
+
*/
|
|
16
|
+
views?: View[];
|
|
17
|
+
};
|
|
8
18
|
export declare class NodeSDK {
|
|
9
19
|
private _tracerProviderConfig?;
|
|
20
|
+
private _meterProviderConfig?;
|
|
10
21
|
private _instrumentations;
|
|
11
|
-
private _metricReader?;
|
|
12
22
|
private _resource;
|
|
23
|
+
private _resourceDetectors;
|
|
13
24
|
private _autoDetectResources;
|
|
14
25
|
private _tracerProvider?;
|
|
15
26
|
private _meterProvider?;
|
|
@@ -21,9 +32,9 @@ export declare class NodeSDK {
|
|
|
21
32
|
/** Set configurations required to register a NodeTracerProvider */
|
|
22
33
|
configureTracerProvider(tracerConfig: NodeTracerConfig, spanProcessor: SpanProcessor, contextManager?: ContextManager, textMapPropagator?: TextMapPropagator): void;
|
|
23
34
|
/** Set configurations needed to register a MeterProvider */
|
|
24
|
-
configureMeterProvider(
|
|
35
|
+
configureMeterProvider(config: MeterProviderConfig): void;
|
|
25
36
|
/** Detect resource attributes */
|
|
26
|
-
detectResources(
|
|
37
|
+
detectResources(): Promise<void>;
|
|
27
38
|
/** Manually add a resource */
|
|
28
39
|
addResource(resource: Resource): void;
|
|
29
40
|
/**
|
package/build/src/sdk.js
CHANGED
|
@@ -19,20 +19,20 @@ exports.NodeSDK = void 0;
|
|
|
19
19
|
const api_metrics_1 = require("@opentelemetry/api-metrics");
|
|
20
20
|
const instrumentation_1 = require("@opentelemetry/instrumentation");
|
|
21
21
|
const resources_1 = require("@opentelemetry/resources");
|
|
22
|
-
const
|
|
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
|
-
/** This class represents everything needed to register a fully configured OpenTelemetry Node.js SDK */
|
|
27
26
|
class NodeSDK {
|
|
28
27
|
/**
|
|
29
28
|
* Create a new NodeJS SDK instance
|
|
30
29
|
*/
|
|
31
30
|
constructor(configuration = {}) {
|
|
32
|
-
var _a, _b, _c;
|
|
31
|
+
var _a, _b, _c, _d;
|
|
33
32
|
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];
|
|
34
34
|
this._serviceName = configuration.serviceName;
|
|
35
|
-
this._autoDetectResources = (
|
|
35
|
+
this._autoDetectResources = (_c = configuration.autoDetectResources) !== null && _c !== void 0 ? _c : true;
|
|
36
36
|
if (configuration.spanProcessor || configuration.traceExporter) {
|
|
37
37
|
const tracerProviderConfig = {};
|
|
38
38
|
if (configuration.sampler) {
|
|
@@ -41,11 +41,18 @@ class NodeSDK {
|
|
|
41
41
|
if (configuration.spanLimits) {
|
|
42
42
|
tracerProviderConfig.spanLimits = configuration.spanLimits;
|
|
43
43
|
}
|
|
44
|
-
const spanProcessor = (
|
|
44
|
+
const spanProcessor = (_d = configuration.spanProcessor) !== null && _d !== void 0 ? _d : new sdk_trace_base_1.BatchSpanProcessor(configuration.traceExporter);
|
|
45
45
|
this.configureTracerProvider(tracerProviderConfig, spanProcessor, configuration.contextManager, configuration.textMapPropagator);
|
|
46
46
|
}
|
|
47
|
-
if (configuration.metricReader) {
|
|
48
|
-
|
|
47
|
+
if (configuration.metricReader || configuration.views) {
|
|
48
|
+
const meterProviderConfig = {};
|
|
49
|
+
if (configuration.metricReader) {
|
|
50
|
+
meterProviderConfig.reader = configuration.metricReader;
|
|
51
|
+
}
|
|
52
|
+
if (configuration.views) {
|
|
53
|
+
meterProviderConfig.views = configuration.views;
|
|
54
|
+
}
|
|
55
|
+
this.configureMeterProvider(meterProviderConfig);
|
|
49
56
|
}
|
|
50
57
|
let instrumentations = [];
|
|
51
58
|
if (configuration.instrumentations) {
|
|
@@ -63,12 +70,34 @@ class NodeSDK {
|
|
|
63
70
|
};
|
|
64
71
|
}
|
|
65
72
|
/** Set configurations needed to register a MeterProvider */
|
|
66
|
-
configureMeterProvider(
|
|
67
|
-
|
|
73
|
+
configureMeterProvider(config) {
|
|
74
|
+
// nothing is set yet, we can set config and return.
|
|
75
|
+
if (this._meterProviderConfig == null) {
|
|
76
|
+
this._meterProviderConfig = config;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// make sure we do not override existing views with other views.
|
|
80
|
+
if (this._meterProviderConfig.views != null && config.views != null) {
|
|
81
|
+
throw new Error('Views passed but Views have already been configured.');
|
|
82
|
+
}
|
|
83
|
+
// set views, but make sure we do not override existing views with null/undefined.
|
|
84
|
+
if (config.views != null) {
|
|
85
|
+
this._meterProviderConfig.views = config.views;
|
|
86
|
+
}
|
|
87
|
+
// make sure we do not override existing reader with another reader.
|
|
88
|
+
if (this._meterProviderConfig.reader != null && config.reader != null) {
|
|
89
|
+
throw new Error('MetricReader passed but MetricReader has already been configured.');
|
|
90
|
+
}
|
|
91
|
+
// set reader, but make sure we do not override existing reader with null/undefined.
|
|
92
|
+
if (config.reader != null) {
|
|
93
|
+
this._meterProviderConfig.reader = config.reader;
|
|
94
|
+
}
|
|
68
95
|
}
|
|
69
96
|
/** Detect resource attributes */
|
|
70
|
-
async detectResources(
|
|
71
|
-
const internalConfig =
|
|
97
|
+
async detectResources() {
|
|
98
|
+
const internalConfig = {
|
|
99
|
+
detectors: this._resourceDetectors,
|
|
100
|
+
};
|
|
72
101
|
this.addResource(await (0, resources_1.detectResources)(internalConfig));
|
|
73
102
|
}
|
|
74
103
|
/** Manually add a resource */
|
|
@@ -79,6 +108,7 @@ class NodeSDK {
|
|
|
79
108
|
* Once the SDK has been configured, call this method to construct SDK components and register them with the OpenTelemetry API.
|
|
80
109
|
*/
|
|
81
110
|
async start() {
|
|
111
|
+
var _a, _b;
|
|
82
112
|
if (this._autoDetectResources) {
|
|
83
113
|
await this.detectResources();
|
|
84
114
|
}
|
|
@@ -94,11 +124,14 @@ class NodeSDK {
|
|
|
94
124
|
propagator: this._tracerProviderConfig.textMapPropagator,
|
|
95
125
|
});
|
|
96
126
|
}
|
|
97
|
-
if (this.
|
|
98
|
-
const meterProvider = new
|
|
127
|
+
if (this._meterProviderConfig) {
|
|
128
|
+
const meterProvider = new sdk_metrics_1.MeterProvider({
|
|
99
129
|
resource: this._resource,
|
|
130
|
+
views: (_b = (_a = this._meterProviderConfig) === null || _a === void 0 ? void 0 : _a.views) !== null && _b !== void 0 ? _b : [],
|
|
100
131
|
});
|
|
101
|
-
|
|
132
|
+
if (this._meterProviderConfig.reader) {
|
|
133
|
+
meterProvider.addMetricReader(this._meterProviderConfig.reader);
|
|
134
|
+
}
|
|
102
135
|
this._meterProvider = meterProvider;
|
|
103
136
|
api_metrics_1.metrics.setGlobalMeterProvider(meterProvider);
|
|
104
137
|
}
|
package/build/src/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,4DAAqD;AACrD,oEAGwC;AACxC,wDAMkC;AAClC,sEAA8E;AAC9E,kEAGuC;AACvC,kEAAqF;AACrF,8EAAiF;AAGjF,uGAAuG;AACvG,MAAa,OAAO;IAkBlB;;OAEG;IACH,YAAmB,gBAA+C,EAAE;;QAClE,IAAI,CAAC,SAAS,GAAG,MAAA,aAAa,CAAC,QAAQ,mCAAI,IAAI,oBAAQ,CAAC,EAAE,CAAC,CAAC;QAE5D,IAAI,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC;QAE9C,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AAa,CAAC;gBACtC,QAAQ,EAAE,IAAI,CAAC,SAAS;aACzB,CAAC,CAAC;YAEH,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAElD,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;AAhKD,0BAgKC","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 detectResources,\n envDetector,\n processDetector,\n Resource,\n ResourceDetectionConfig\n} from '@opentelemetry/resources';\nimport { MeterProvider, MetricReader } from '@opentelemetry/sdk-metrics-base';\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 */\nexport class NodeSDK {\n private _tracerProviderConfig?: {\n tracerConfig: NodeTracerConfig;\n spanProcessor: SpanProcessor;\n contextManager?: ContextManager;\n textMapPropagator?: TextMapPropagator;\n };\n private _instrumentations: InstrumentationOption[];\n private _metricReader?: MetricReader;\n\n private _resource: Resource;\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\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) {\n this.configureMeterProvider(configuration.metricReader);\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(reader: MetricReader): void {\n this._metricReader = reader;\n }\n\n /** Detect resource attributes */\n public async detectResources(\n config?: ResourceDetectionConfig\n ): Promise<void> {\n const internalConfig: ResourceDetectionConfig = {\n detectors: [ envDetector, processDetector],\n ...config,\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._metricReader) {\n const meterProvider = new MeterProvider({\n resource: this._resource,\n });\n\n meterProvider.addMetricReader(this._metricReader);\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 inst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\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"]}
|
package/build/src/types.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import type { ContextManager, SpanAttributes } from '@opentelemetry/api';
|
|
2
|
-
import {
|
|
2
|
+
import { TextMapPropagator } from '@opentelemetry/api';
|
|
3
3
|
import { InstrumentationOption } from '@opentelemetry/instrumentation';
|
|
4
|
-
import { Resource } from '@opentelemetry/resources';
|
|
5
|
-
import { MetricReader } from '@opentelemetry/sdk-metrics
|
|
6
|
-
import { SpanExporter, SpanLimits, SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
4
|
+
import { Detector, Resource } from '@opentelemetry/resources';
|
|
5
|
+
import { MetricReader, View } from '@opentelemetry/sdk-metrics';
|
|
6
|
+
import { Sampler, SpanExporter, SpanLimits, SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
7
7
|
export interface NodeSDKConfiguration {
|
|
8
8
|
autoDetectResources: boolean;
|
|
9
9
|
contextManager: ContextManager;
|
|
10
10
|
defaultAttributes: SpanAttributes;
|
|
11
11
|
textMapPropagator: TextMapPropagator;
|
|
12
12
|
metricReader: MetricReader;
|
|
13
|
+
views: View[];
|
|
13
14
|
instrumentations: InstrumentationOption[];
|
|
14
15
|
resource: Resource;
|
|
16
|
+
resourceDetectors: Detector[];
|
|
15
17
|
sampler: Sampler;
|
|
16
18
|
serviceName?: string;
|
|
17
19
|
spanProcessor: SpanProcessor;
|
package/build/src/types.js.map
CHANGED
|
@@ -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 {
|
|
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"]}
|
package/build/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.33.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/src/version.js
CHANGED
package/build/src/version.js.map
CHANGED
|
@@ -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.
|
|
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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/sdk-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.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,35 +44,35 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@opentelemetry/api-metrics": "0.
|
|
48
|
-
"@opentelemetry/core": "1.
|
|
49
|
-
"@opentelemetry/instrumentation": "0.
|
|
50
|
-
"@opentelemetry/resources": "1.
|
|
51
|
-
"@opentelemetry/sdk-metrics
|
|
52
|
-
"@opentelemetry/sdk-trace-base": "1.
|
|
53
|
-
"@opentelemetry/sdk-trace-node": "1.
|
|
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"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@opentelemetry/api": ">=1.0.0 <1.
|
|
56
|
+
"@opentelemetry/api": ">=1.0.0 <1.3.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@opentelemetry/api": ">=1.0.0 <1.
|
|
60
|
-
"@opentelemetry/context-async-hooks": "1.
|
|
61
|
-
"@opentelemetry/semantic-conventions": "1.
|
|
62
|
-
"@types/mocha": "
|
|
63
|
-
"@types/node": "
|
|
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",
|
|
63
|
+
"@types/node": "18.6.5",
|
|
64
64
|
"@types/semver": "7.3.9",
|
|
65
|
-
"@types/sinon": "10.0.
|
|
65
|
+
"@types/sinon": "10.0.13",
|
|
66
66
|
"codecov": "3.8.3",
|
|
67
67
|
"istanbul-instrumenter-loader": "3.0.1",
|
|
68
|
-
"mocha": "
|
|
68
|
+
"mocha": "10.0.0",
|
|
69
69
|
"nyc": "15.1.0",
|
|
70
70
|
"semver": "7.3.5",
|
|
71
|
-
"sinon": "
|
|
72
|
-
"ts-loader": "8.
|
|
73
|
-
"ts-mocha": "
|
|
71
|
+
"sinon": "14.0.0",
|
|
72
|
+
"ts-loader": "8.4.0",
|
|
73
|
+
"ts-mocha": "10.0.0",
|
|
74
74
|
"typescript": "4.4.4"
|
|
75
75
|
},
|
|
76
76
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-sdk-node",
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "ad88c3d9aa0100fe259b93f4b660e84417b757ac"
|
|
78
78
|
}
|