@orion-js/telemetry 4.0.0-next.7 → 4.0.1
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/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -24,13 +24,13 @@ __export(index_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(index_exports);
|
|
25
25
|
var import_auto_instrumentations_node = require("@opentelemetry/auto-instrumentations-node");
|
|
26
26
|
var import_sdk_node = require("@opentelemetry/sdk-node");
|
|
27
|
-
var
|
|
28
|
-
var
|
|
27
|
+
var import_exporter_prometheus = require("@opentelemetry/exporter-prometheus");
|
|
28
|
+
var import_host_metrics = require("@opentelemetry/host-metrics");
|
|
29
29
|
function setupTelemetry({
|
|
30
30
|
nodeSDKConfig,
|
|
31
31
|
metrics
|
|
32
32
|
}) {
|
|
33
|
-
const metricReader = (metrics == null ? void 0 : metrics.disable) ? void 0 : new PrometheusExporter({ port: (metrics == null ? void 0 : metrics.port) ||
|
|
33
|
+
const metricReader = (metrics == null ? void 0 : metrics.disable) ? void 0 : new import_exporter_prometheus.PrometheusExporter({ port: (metrics == null ? void 0 : metrics.port) || 9464 });
|
|
34
34
|
const sdk = new import_sdk_node.NodeSDK({
|
|
35
35
|
instrumentations: [
|
|
36
36
|
(0, import_auto_instrumentations_node.getNodeAutoInstrumentations)({
|
|
@@ -42,11 +42,11 @@ function setupTelemetry({
|
|
|
42
42
|
metricReader,
|
|
43
43
|
...nodeSDKConfig
|
|
44
44
|
});
|
|
45
|
+
sdk.start();
|
|
45
46
|
if (metricReader) {
|
|
46
|
-
const hostMetrics = new HostMetrics();
|
|
47
|
+
const hostMetrics = new import_host_metrics.HostMetrics();
|
|
47
48
|
hostMetrics.start();
|
|
48
49
|
}
|
|
49
|
-
sdk.start();
|
|
50
50
|
}
|
|
51
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
52
52
|
0 && (module.exports = {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {getNodeAutoInstrumentations} from '@opentelemetry/auto-instrumentations-node'\nimport {NodeSDK, NodeSDKConfiguration} from '@opentelemetry/sdk-node'\
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {getNodeAutoInstrumentations} from '@opentelemetry/auto-instrumentations-node'\nimport {NodeSDK, NodeSDKConfiguration} from '@opentelemetry/sdk-node'\nimport {PrometheusExporter} from '@opentelemetry/exporter-prometheus'\nimport {HostMetrics} from '@opentelemetry/host-metrics'\n\nfunction setupTelemetry({\n nodeSDKConfig,\n metrics,\n}: {\n nodeSDKConfig?: Partial<NodeSDKConfiguration>\n metrics?: {\n disable?: boolean\n port?: number\n }\n}) {\n const metricReader = metrics?.disable\n ? undefined\n : new PrometheusExporter({port: metrics?.port || 9464})\n const sdk = new NodeSDK({\n instrumentations: [\n getNodeAutoInstrumentations({\n '@opentelemetry/instrumentation-graphql': {\n ignoreResolveSpans: true,\n },\n }),\n ],\n metricReader,\n ...nodeSDKConfig,\n })\n\n sdk.start()\n\n if (metricReader) {\n const hostMetrics = new HostMetrics()\n hostMetrics.start()\n }\n}\n\nexport {setupTelemetry}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAA0C;AAC1C,sBAA4C;AAC5C,iCAAiC;AACjC,0BAA0B;AAE1B,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AACF,GAMG;AACD,QAAM,gBAAe,mCAAS,WAC1B,SACA,IAAI,8CAAmB,EAAC,OAAM,mCAAS,SAAQ,KAAI,CAAC;AACxD,QAAM,MAAM,IAAI,wBAAQ;AAAA,IACtB,kBAAkB;AAAA,UAChB,+DAA4B;AAAA,QAC1B,0CAA0C;AAAA,UACxC,oBAAoB;AAAA,QACtB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AAED,MAAI,MAAM;AAEV,MAAI,cAAc;AAChB,UAAM,cAAc,IAAI,gCAAY;AACpC,gBAAY,MAAM;AAAA,EACpB;AACF;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
1
|
// src/index.ts
|
|
9
2
|
import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node";
|
|
10
3
|
import { NodeSDK } from "@opentelemetry/sdk-node";
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
import { PrometheusExporter } from "@opentelemetry/exporter-prometheus";
|
|
5
|
+
import { HostMetrics } from "@opentelemetry/host-metrics";
|
|
13
6
|
function setupTelemetry({
|
|
14
7
|
nodeSDKConfig,
|
|
15
8
|
metrics
|
|
16
9
|
}) {
|
|
17
|
-
const metricReader = (metrics == null ? void 0 : metrics.disable) ? void 0 : new PrometheusExporter({ port: (metrics == null ? void 0 : metrics.port) ||
|
|
10
|
+
const metricReader = (metrics == null ? void 0 : metrics.disable) ? void 0 : new PrometheusExporter({ port: (metrics == null ? void 0 : metrics.port) || 9464 });
|
|
18
11
|
const sdk = new NodeSDK({
|
|
19
12
|
instrumentations: [
|
|
20
13
|
getNodeAutoInstrumentations({
|
|
@@ -26,11 +19,11 @@ function setupTelemetry({
|
|
|
26
19
|
metricReader,
|
|
27
20
|
...nodeSDKConfig
|
|
28
21
|
});
|
|
22
|
+
sdk.start();
|
|
29
23
|
if (metricReader) {
|
|
30
24
|
const hostMetrics = new HostMetrics();
|
|
31
25
|
hostMetrics.start();
|
|
32
26
|
}
|
|
33
|
-
sdk.start();
|
|
34
27
|
}
|
|
35
28
|
export {
|
|
36
29
|
setupTelemetry
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {getNodeAutoInstrumentations} from '@opentelemetry/auto-instrumentations-node'\nimport {NodeSDK, NodeSDKConfiguration} from '@opentelemetry/sdk-node'\
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {getNodeAutoInstrumentations} from '@opentelemetry/auto-instrumentations-node'\nimport {NodeSDK, NodeSDKConfiguration} from '@opentelemetry/sdk-node'\nimport {PrometheusExporter} from '@opentelemetry/exporter-prometheus'\nimport {HostMetrics} from '@opentelemetry/host-metrics'\n\nfunction setupTelemetry({\n nodeSDKConfig,\n metrics,\n}: {\n nodeSDKConfig?: Partial<NodeSDKConfiguration>\n metrics?: {\n disable?: boolean\n port?: number\n }\n}) {\n const metricReader = metrics?.disable\n ? undefined\n : new PrometheusExporter({port: metrics?.port || 9464})\n const sdk = new NodeSDK({\n instrumentations: [\n getNodeAutoInstrumentations({\n '@opentelemetry/instrumentation-graphql': {\n ignoreResolveSpans: true,\n },\n }),\n ],\n metricReader,\n ...nodeSDKConfig,\n })\n\n sdk.start()\n\n if (metricReader) {\n const hostMetrics = new HostMetrics()\n hostMetrics.start()\n }\n}\n\nexport {setupTelemetry}\n"],"mappings":";AAAA,SAAQ,mCAAkC;AAC1C,SAAQ,eAAoC;AAC5C,SAAQ,0BAAyB;AACjC,SAAQ,mBAAkB;AAE1B,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AACF,GAMG;AACD,QAAM,gBAAe,mCAAS,WAC1B,SACA,IAAI,mBAAmB,EAAC,OAAM,mCAAS,SAAQ,KAAI,CAAC;AACxD,QAAM,MAAM,IAAI,QAAQ;AAAA,IACtB,kBAAkB;AAAA,MAChB,4BAA4B;AAAA,QAC1B,0CAA0C;AAAA,UACxC,oBAAoB;AAAA,QACtB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AAED,MAAI,MAAM;AAEV,MAAI,cAAc;AAChB,UAAM,cAAc,IAAI,YAAY;AACpC,gBAAY,MAAM;AAAA,EACpB;AACF;","names":[]}
|