@pocket-tools/tracing 1.11.1 → 1.12.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/dist/index.cjs +9 -7
- package/dist/index.d.cts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +9 -7
- package/package.json +20 -20
package/dist/index.cjs
CHANGED
|
@@ -68,15 +68,16 @@ var additionalInstrumentationConstructors = {
|
|
|
68
68
|
PRISMA: import_instrumentation.PrismaInstrumentation
|
|
69
69
|
};
|
|
70
70
|
var tracingDefaults = {
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
additionalInstrumentations: [],
|
|
72
|
+
enableMetrics: false,
|
|
73
|
+
flagName: "perm.backend.sentry-trace-sampler-rate",
|
|
73
74
|
graphQLDepth: 8,
|
|
74
|
-
url: "http://localhost:4318",
|
|
75
75
|
protocol: "HTTP",
|
|
76
|
+
release: "unknown",
|
|
77
|
+
serviceName: "unknown",
|
|
76
78
|
unleash: {},
|
|
77
79
|
// no-op cause its required in the config
|
|
78
|
-
|
|
79
|
-
additionalInstrumentations: []
|
|
80
|
+
url: "http://localhost:4318"
|
|
80
81
|
};
|
|
81
82
|
function awaitAttributes(detector) {
|
|
82
83
|
return {
|
|
@@ -111,7 +112,7 @@ async function nodeSDKBuilder(config) {
|
|
|
111
112
|
//collector url
|
|
112
113
|
url: `${config.url}/v1/traces`
|
|
113
114
|
}) : new import_exporter_trace_otlp_grpc.OTLPTraceExporter({ url: config.url });
|
|
114
|
-
const _metricReader = new import_sdk_metrics.PeriodicExportingMetricReader({
|
|
115
|
+
const _metricReader = config.enableMetrics ? new import_sdk_metrics.PeriodicExportingMetricReader({
|
|
115
116
|
exporter: config.protocol === "HTTP" ? new import_exporter_metrics_otlp_http.OTLPMetricExporter({
|
|
116
117
|
url: `${config.url}/v1/metrics`
|
|
117
118
|
}) : new import_exporter_metrics_otlp_grpc.OTLPMetricExporter({ url: config.url }),
|
|
@@ -119,7 +120,7 @@ async function nodeSDKBuilder(config) {
|
|
|
119
120
|
// But lets just do 60 seconds for now as we figure it out
|
|
120
121
|
exportIntervalMillis: 1e4,
|
|
121
122
|
exportTimeoutMillis: 5e3
|
|
122
|
-
});
|
|
123
|
+
}) : void 0;
|
|
123
124
|
const _logExporter = config.protocol === "HTTP" ? new import_exporter_logs_otlp_http.OTLPLogExporter({ url: `${config.url}/v1/logs` }) : new import_exporter_logs_otlp_grpc.OTLPLogExporter({ url: config.url });
|
|
124
125
|
const instrumentations = [
|
|
125
126
|
(0, import_auto_instrumentations_node.getNodeAutoInstrumentations)({
|
|
@@ -188,6 +189,7 @@ async function nodeSDKBuilder(config) {
|
|
|
188
189
|
idGenerator: new import_id_generator_aws_xray.AWSXRayIdGenerator(),
|
|
189
190
|
spanProcessors: [new import_sdk_trace_base.BatchSpanProcessor(_traceExporter, batchConfig)],
|
|
190
191
|
metricReader: _metricReader,
|
|
192
|
+
// either an instance of MetricReader, or undefined
|
|
191
193
|
logRecordProcessors: [
|
|
192
194
|
new import_sdk_node.logs.BatchLogRecordProcessor(_logExporter, batchConfig)
|
|
193
195
|
],
|
package/dist/index.d.cts
CHANGED
|
@@ -5,15 +5,16 @@ declare enum AdditionalInstrumentation {
|
|
|
5
5
|
PRISMA = "PRISMA"
|
|
6
6
|
}
|
|
7
7
|
type TracingConfig = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
additionalInstrumentations?: AdditionalInstrumentation[];
|
|
9
|
+
enableMetrics?: boolean;
|
|
10
|
+
flagName?: string;
|
|
11
11
|
graphQLDepth?: number;
|
|
12
|
-
url?: string;
|
|
13
12
|
protocol?: 'GRPC' | 'HTTP';
|
|
13
|
+
release: string;
|
|
14
|
+
samplingRatio?: number;
|
|
15
|
+
serviceName: string;
|
|
14
16
|
unleash: Unleash;
|
|
15
|
-
|
|
16
|
-
additionalInstrumentations?: AdditionalInstrumentation[];
|
|
17
|
+
url?: string;
|
|
17
18
|
};
|
|
18
19
|
declare function nodeSDKBuilder(config: TracingConfig): Promise<void>;
|
|
19
20
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5,15 +5,16 @@ declare enum AdditionalInstrumentation {
|
|
|
5
5
|
PRISMA = "PRISMA"
|
|
6
6
|
}
|
|
7
7
|
type TracingConfig = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
additionalInstrumentations?: AdditionalInstrumentation[];
|
|
9
|
+
enableMetrics?: boolean;
|
|
10
|
+
flagName?: string;
|
|
11
11
|
graphQLDepth?: number;
|
|
12
|
-
url?: string;
|
|
13
12
|
protocol?: 'GRPC' | 'HTTP';
|
|
13
|
+
release: string;
|
|
14
|
+
samplingRatio?: number;
|
|
15
|
+
serviceName: string;
|
|
14
16
|
unleash: Unleash;
|
|
15
|
-
|
|
16
|
-
additionalInstrumentations?: AdditionalInstrumentation[];
|
|
17
|
+
url?: string;
|
|
17
18
|
};
|
|
18
19
|
declare function nodeSDKBuilder(config: TracingConfig): Promise<void>;
|
|
19
20
|
|
package/dist/index.js
CHANGED
|
@@ -49,15 +49,16 @@ var additionalInstrumentationConstructors = {
|
|
|
49
49
|
PRISMA: PrismaInstrumentation
|
|
50
50
|
};
|
|
51
51
|
var tracingDefaults = {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
additionalInstrumentations: [],
|
|
53
|
+
enableMetrics: false,
|
|
54
|
+
flagName: "perm.backend.sentry-trace-sampler-rate",
|
|
54
55
|
graphQLDepth: 8,
|
|
55
|
-
url: "http://localhost:4318",
|
|
56
56
|
protocol: "HTTP",
|
|
57
|
+
release: "unknown",
|
|
58
|
+
serviceName: "unknown",
|
|
57
59
|
unleash: {},
|
|
58
60
|
// no-op cause its required in the config
|
|
59
|
-
|
|
60
|
-
additionalInstrumentations: []
|
|
61
|
+
url: "http://localhost:4318"
|
|
61
62
|
};
|
|
62
63
|
function awaitAttributes(detector) {
|
|
63
64
|
return {
|
|
@@ -92,7 +93,7 @@ async function nodeSDKBuilder(config) {
|
|
|
92
93
|
//collector url
|
|
93
94
|
url: `${config.url}/v1/traces`
|
|
94
95
|
}) : new GRPCOTLPTraceExporter({ url: config.url });
|
|
95
|
-
const _metricReader = new PeriodicExportingMetricReader({
|
|
96
|
+
const _metricReader = config.enableMetrics ? new PeriodicExportingMetricReader({
|
|
96
97
|
exporter: config.protocol === "HTTP" ? new HTTPOTLPMetricExporter({
|
|
97
98
|
url: `${config.url}/v1/metrics`
|
|
98
99
|
}) : new GRPCOTLPMetricExporter({ url: config.url }),
|
|
@@ -100,7 +101,7 @@ async function nodeSDKBuilder(config) {
|
|
|
100
101
|
// But lets just do 60 seconds for now as we figure it out
|
|
101
102
|
exportIntervalMillis: 1e4,
|
|
102
103
|
exportTimeoutMillis: 5e3
|
|
103
|
-
});
|
|
104
|
+
}) : void 0;
|
|
104
105
|
const _logExporter = config.protocol === "HTTP" ? new HTTPOTLPLogExporter({ url: `${config.url}/v1/logs` }) : new GRPCOTLPLogExporter({ url: config.url });
|
|
105
106
|
const instrumentations = [
|
|
106
107
|
getNodeAutoInstrumentations({
|
|
@@ -169,6 +170,7 @@ async function nodeSDKBuilder(config) {
|
|
|
169
170
|
idGenerator: new AWSXRayIdGenerator(),
|
|
170
171
|
spanProcessors: [new BatchSpanProcessor(_traceExporter, batchConfig)],
|
|
171
172
|
metricReader: _metricReader,
|
|
173
|
+
// either an instance of MetricReader, or undefined
|
|
172
174
|
logRecordProcessors: [
|
|
173
175
|
new logs.BatchLogRecordProcessor(_logExporter, batchConfig)
|
|
174
176
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pocket-tools/tracing",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "Utilities for tracing",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tracing"
|
|
@@ -76,44 +76,44 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@opentelemetry/api": "1.9.0",
|
|
79
|
-
"@opentelemetry/auto-instrumentations-node": "0.55.
|
|
80
|
-
"@opentelemetry/context-async-hooks": "1.30.
|
|
81
|
-
"@opentelemetry/core": "1.30.
|
|
82
|
-
"@opentelemetry/exporter-logs-otlp-grpc": "0.57.
|
|
83
|
-
"@opentelemetry/exporter-logs-otlp-http": "0.57.
|
|
84
|
-
"@opentelemetry/exporter-metrics-otlp-grpc": "0.57.
|
|
85
|
-
"@opentelemetry/exporter-metrics-otlp-http": "0.57.
|
|
86
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "0.57.
|
|
87
|
-
"@opentelemetry/exporter-trace-otlp-http": "0.57.
|
|
79
|
+
"@opentelemetry/auto-instrumentations-node": "0.55.2",
|
|
80
|
+
"@opentelemetry/context-async-hooks": "1.30.1",
|
|
81
|
+
"@opentelemetry/core": "1.30.1",
|
|
82
|
+
"@opentelemetry/exporter-logs-otlp-grpc": "0.57.1",
|
|
83
|
+
"@opentelemetry/exporter-logs-otlp-http": "0.57.1",
|
|
84
|
+
"@opentelemetry/exporter-metrics-otlp-grpc": "0.57.1",
|
|
85
|
+
"@opentelemetry/exporter-metrics-otlp-http": "0.57.1",
|
|
86
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "0.57.1",
|
|
87
|
+
"@opentelemetry/exporter-trace-otlp-http": "0.57.1",
|
|
88
88
|
"@opentelemetry/id-generator-aws-xray": "1.2.2",
|
|
89
89
|
"@opentelemetry/instrumentation-knex": "0.44.0",
|
|
90
|
-
"@opentelemetry/propagator-aws-xray": "1.26.
|
|
90
|
+
"@opentelemetry/propagator-aws-xray": "1.26.1",
|
|
91
91
|
"@opentelemetry/resource-detector-aws": "1.10.0",
|
|
92
|
-
"@opentelemetry/resources": "1.30.
|
|
93
|
-
"@opentelemetry/sdk-metrics": "1.30.
|
|
94
|
-
"@opentelemetry/sdk-node": "0.57.
|
|
95
|
-
"@opentelemetry/sdk-trace-base": "1.30.
|
|
96
|
-
"@opentelemetry/sdk-trace-node": "1.30.
|
|
92
|
+
"@opentelemetry/resources": "1.30.1",
|
|
93
|
+
"@opentelemetry/sdk-metrics": "1.30.1",
|
|
94
|
+
"@opentelemetry/sdk-node": "0.57.1",
|
|
95
|
+
"@opentelemetry/sdk-trace-base": "1.30.1",
|
|
96
|
+
"@opentelemetry/sdk-trace-node": "1.30.1",
|
|
97
97
|
"@opentelemetry/semantic-conventions": "1.28.0",
|
|
98
98
|
"@opentelemetry/winston-transport": "0.10.0",
|
|
99
99
|
"@prisma/instrumentation": "5.22.0",
|
|
100
100
|
"@sentry/node": "8.47.0",
|
|
101
101
|
"@sentry/opentelemetry": "8.47.0",
|
|
102
|
-
"tslib": "2.8.
|
|
102
|
+
"tslib": "2.8.1",
|
|
103
103
|
"unleash-client": "6.1.2"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
106
|
"@jest/globals": "29.7.0",
|
|
107
107
|
"@semantic-release/exec": "6.0.3",
|
|
108
108
|
"@types/jest": "29.5.14",
|
|
109
|
-
"@types/node": "^22.
|
|
109
|
+
"@types/node": "^22.10.7",
|
|
110
110
|
"jest": "29.7.0",
|
|
111
|
-
"semantic-release": "24.2.
|
|
111
|
+
"semantic-release": "24.2.1",
|
|
112
112
|
"semantic-release-monorepo": "8.0.2",
|
|
113
113
|
"ts-jest": "29.2.5",
|
|
114
114
|
"ts-node": "10.9.2",
|
|
115
115
|
"tsup": "8.3.5",
|
|
116
|
-
"typescript": "5.7.
|
|
116
|
+
"typescript": "5.7.3",
|
|
117
117
|
"@pocket-tools/eslint-config": "0.0.0",
|
|
118
118
|
"tsconfig": "0.0.0"
|
|
119
119
|
},
|