@pocket-tools/tracing 1.7.1 → 1.7.3
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/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-semantic-release.log +68 -65
- package/dist/index.d.mts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +7 -17
- package/dist/index.mjs +8 -18
- package/package.json +1 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[33mCJS[39m [33mYou have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin[39m
|
|
12
12
|
[33mESM[39m [33mYou have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin[39m
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m7.60 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 114ms
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m5.43 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 129ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 7515ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m549.00 B[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m549.00 B[39m
|
|
@@ -14,74 +14,77 @@
|
|
|
14
14
|
[34mESM[39m Build start
|
|
15
15
|
[33mCJS[39m [33mYou have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin[39m
|
|
16
16
|
[33mESM[39m [33mYou have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin[39m
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
17
|
+
[32mCJS[39m [1mdist/index.js [22m[32m7.60 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 196ms
|
|
19
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m5.43 KB[39m
|
|
20
|
+
[32mESM[39m ⚡️ Build success in 204ms
|
|
21
21
|
[34mDTS[39m Build start
|
|
22
|
-
[32mDTS[39m ⚡️ Build success in
|
|
23
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
24
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
22
|
+
[32mDTS[39m ⚡️ Build success in 7187ms
|
|
23
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m549.00 B[39m
|
|
24
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m549.00 B[39m
|
|
25
25
|
|
|
26
26
|
> @pocket-tools/tracing@0.0.0-development semantic-release /home/runner/work/pocket-monorepo/pocket-monorepo/packages/tracing
|
|
27
27
|
> semantic-release
|
|
28
28
|
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
29
|
+
[4:10:23 PM] [semantic-release] › ℹ Running semantic-release version 24.1.0
|
|
30
|
+
[4:10:25 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/npm"
|
|
31
|
+
[4:10:25 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/github"
|
|
32
|
+
[4:10:25 PM] [semantic-release] › ✔ Loaded plugin "prepare" from "@semantic-release/npm"
|
|
33
|
+
[4:10:25 PM] [semantic-release] › ✔ Loaded plugin "publish" from "@semantic-release/npm"
|
|
34
|
+
[4:10:25 PM] [semantic-release] › ✔ Loaded plugin "publish" from "@semantic-release/github"
|
|
35
|
+
[4:10:25 PM] [semantic-release] › ✔ Loaded plugin "addChannel" from "@semantic-release/npm"
|
|
36
|
+
[4:10:25 PM] [semantic-release] › ✔ Loaded plugin "addChannel" from "@semantic-release/github"
|
|
37
|
+
[4:10:30 PM] [semantic-release] › ✔ Run automated release from branch main on repository git+https://github.com/Pocket/pocket-monorepo.git
|
|
38
|
+
[4:10:31 PM] [semantic-release] › ✔ Allowed to push to the Git repository
|
|
39
|
+
[4:10:31 PM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/npm"
|
|
40
|
+
[4:10:31 PM] [semantic-release] [@semantic-release/npm] › ℹ Verify authentication for registry https://registry.npmjs.org/
|
|
41
|
+
[4:10:31 PM] [semantic-release] [@semantic-release/npm] › ℹ Wrote NPM_TOKEN to /tmp/f3ff2908e074a6c6ba1e753a22adf067/.npmrc
|
|
42
42
|
pocket-npm
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
[
|
|
65
|
-
[
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
[
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
[
|
|
74
|
-
[
|
|
75
|
-
[
|
|
76
|
-
[
|
|
77
|
-
[
|
|
78
|
-
[
|
|
79
|
-
[
|
|
80
|
-
[
|
|
81
|
-
[
|
|
82
|
-
[
|
|
83
|
-
[
|
|
84
|
-
[
|
|
85
|
-
[
|
|
86
|
-
[
|
|
87
|
-
[
|
|
43
|
+
[4:10:32 PM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/npm"
|
|
44
|
+
[4:10:32 PM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/github"
|
|
45
|
+
[4:10:32 PM] [semantic-release] [@semantic-release/github] › ℹ Verify GitHub authentication (https://api.github.com)
|
|
46
|
+
[4:10:32 PM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/github"
|
|
47
|
+
[4:10:32 PM] [semantic-release] › ℹ Found git tag @pocket-tools/tracing-v1.7.2 associated with version 1.7.2 on branch main
|
|
48
|
+
[4:10:32 PM] [semantic-release] › ℹ Found 3 commits since last release
|
|
49
|
+
[4:10:32 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
50
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
|
|
51
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ Found 1 commits for package @pocket-tools/tracing since last release
|
|
52
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ Analyzing commit: fix(graphql): ensuring we get graphql values in traces (#810)
|
|
53
|
+
|
|
54
|
+
* fix(values): allow graphql values in the otel
|
|
55
|
+
|
|
56
|
+
* fix(x-amzn): ensuring v3 proxy has its own trace
|
|
57
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ The release type for the commit is patch
|
|
58
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ Analysis of 1 commits complete: patch release
|
|
59
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
|
|
60
|
+
[4:10:32 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
61
|
+
[4:10:32 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
62
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ Plugin "@semantic-release/release-notes-generator" does not provide step "analyzeCommits"
|
|
63
|
+
[4:10:32 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
64
|
+
[4:10:32 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
65
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ Plugin "@semantic-release/npm" does not provide step "analyzeCommits"
|
|
66
|
+
[4:10:32 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
67
|
+
[4:10:32 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
68
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ Plugin "@semantic-release/github" does not provide step "analyzeCommits"
|
|
69
|
+
[4:10:32 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
70
|
+
[4:10:32 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
71
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ No more plugins
|
|
72
|
+
[4:10:32 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
73
|
+
[4:10:32 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
74
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ No more plugins
|
|
75
|
+
[4:10:32 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
76
|
+
[4:10:32 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
77
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ No more plugins
|
|
78
|
+
[4:10:32 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
79
|
+
[4:10:32 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
80
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ No more plugins
|
|
81
|
+
[4:10:32 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
82
|
+
[4:10:32 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
83
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ No more plugins
|
|
84
|
+
[4:10:32 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
85
|
+
[4:10:32 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
86
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ No more plugins
|
|
87
|
+
[4:10:32 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
|
|
88
|
+
[4:10:32 PM] [semantic-release] › ℹ The next release version is 1.7.3
|
|
89
|
+
[4:10:32 PM] [semantic-release] › ℹ Start step "generateNotes" of plugin "[Function: semantic-release-monorepo]"
|
|
90
|
+
[4:10:32 PM] [semantic-release] [[Function: semantic-release-monorepo]] › ℹ Plugin "@semantic-release/commit-analyzer" does not provide step "generateNotes"
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DiagLogger } from '@opentelemetry/api';
|
|
2
1
|
import { NodeClient } from '@sentry/node';
|
|
3
2
|
|
|
4
3
|
declare enum AdditionalInstrumentation {
|
|
@@ -12,7 +11,6 @@ type TracingConfig = {
|
|
|
12
11
|
graphQLDepth?: number;
|
|
13
12
|
url?: string;
|
|
14
13
|
protocol?: 'GRPC' | 'HTTP';
|
|
15
|
-
logger?: DiagLogger;
|
|
16
14
|
sentry: NodeClient | undefined;
|
|
17
15
|
additionalInstrumentations?: AdditionalInstrumentation[];
|
|
18
16
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DiagLogger } from '@opentelemetry/api';
|
|
2
1
|
import { NodeClient } from '@sentry/node';
|
|
3
2
|
|
|
4
3
|
declare enum AdditionalInstrumentation {
|
|
@@ -12,7 +11,6 @@ type TracingConfig = {
|
|
|
12
11
|
graphQLDepth?: number;
|
|
13
12
|
url?: string;
|
|
14
13
|
protocol?: 'GRPC' | 'HTTP';
|
|
15
|
-
logger?: DiagLogger;
|
|
16
14
|
sentry: NodeClient | undefined;
|
|
17
15
|
additionalInstrumentations?: AdditionalInstrumentation[];
|
|
18
16
|
};
|
package/dist/index.js
CHANGED
|
@@ -47,14 +47,10 @@ var import_instrumentation = require("@prisma/instrumentation");
|
|
|
47
47
|
var import_resources = require("@opentelemetry/resources");
|
|
48
48
|
var import_semantic_conventions = require("@opentelemetry/semantic-conventions");
|
|
49
49
|
var import_opentelemetry = require("@sentry/opentelemetry");
|
|
50
|
-
var import_sdk_metrics = require("@opentelemetry/sdk-metrics");
|
|
51
|
-
var import_exporter_metrics_otlp_http = require("@opentelemetry/exporter-metrics-otlp-http");
|
|
52
|
-
var import_exporter_metrics_otlp_grpc = require("@opentelemetry/exporter-metrics-otlp-grpc");
|
|
53
50
|
var import_auto_instrumentations_node = require("@opentelemetry/auto-instrumentations-node");
|
|
54
51
|
var import_resources2 = require("@opentelemetry/resources");
|
|
55
52
|
var import_resource_detector_aws = require("@opentelemetry/resource-detector-aws");
|
|
56
53
|
var Sentry = __toESM(require("@sentry/node"));
|
|
57
|
-
var import_ts_logger = require("@pocket-tools/ts-logger");
|
|
58
54
|
var import_sdk_trace_base = require("@opentelemetry/sdk-trace-base");
|
|
59
55
|
var import_propagator_aws_xray = require("@opentelemetry/propagator-aws-xray");
|
|
60
56
|
var import_id_generator_aws_xray = require("@opentelemetry/id-generator-aws-xray");
|
|
@@ -93,12 +89,13 @@ function awaitAttributes(detector) {
|
|
|
93
89
|
var batchConfig = {
|
|
94
90
|
maxQueueSize: 4096,
|
|
95
91
|
maxExportBatchSize: 1e3,
|
|
96
|
-
scheduledDelayMillis:
|
|
92
|
+
scheduledDelayMillis: 500,
|
|
97
93
|
exportTimeoutMillis: 5e3
|
|
98
94
|
};
|
|
99
95
|
async function nodeSDKBuilder(config) {
|
|
100
|
-
var _a
|
|
96
|
+
var _a;
|
|
101
97
|
config = { ...tracingDefaults, ...config };
|
|
98
|
+
import_api.diag.setLogger(new import_api.DiagConsoleLogger(), import_api.DiagLogLevel.WARN);
|
|
102
99
|
const _resource = import_resources.Resource.default().merge(
|
|
103
100
|
new import_resources.Resource({
|
|
104
101
|
[import_semantic_conventions.ATTR_SERVICE_NAME]: config.serviceName,
|
|
@@ -109,14 +106,6 @@ async function nodeSDKBuilder(config) {
|
|
|
109
106
|
//collector url
|
|
110
107
|
url: `${config.url}/v1/traces`
|
|
111
108
|
}) : new import_exporter_trace_otlp_grpc.OTLPTraceExporter({ url: config.url });
|
|
112
|
-
const _metricReader = new import_sdk_metrics.PeriodicExportingMetricReader({
|
|
113
|
-
exporter: config.protocol === "HTTP" ? new import_exporter_metrics_otlp_http.OTLPMetricExporter({
|
|
114
|
-
url: `${config.url}/v1/metrics`
|
|
115
|
-
}) : new import_exporter_metrics_otlp_grpc.OTLPMetricExporter({ url: config.url }),
|
|
116
|
-
// once every 60 seconds, GCP supports 1 every 5 seconds for custom metrics https://cloud.google.com/monitoring/quotas#custom_metrics_quotas
|
|
117
|
-
// But lets just do 60 seconds for now as we figure it out
|
|
118
|
-
exportIntervalMillis: 6e4
|
|
119
|
-
});
|
|
120
109
|
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 });
|
|
121
110
|
const instrumentations = [
|
|
122
111
|
(0, import_auto_instrumentations_node.getNodeAutoInstrumentations)({
|
|
@@ -140,7 +129,8 @@ async function nodeSDKBuilder(config) {
|
|
|
140
129
|
ignoreIncomingPaths: ["/.well-known/apollo/server-health"]
|
|
141
130
|
},
|
|
142
131
|
"@opentelemetry/instrumentation-graphql": {
|
|
143
|
-
ignoreTrivialResolveSpans: true
|
|
132
|
+
ignoreTrivialResolveSpans: true,
|
|
133
|
+
allowValues: true
|
|
144
134
|
}
|
|
145
135
|
})
|
|
146
136
|
];
|
|
@@ -157,7 +147,8 @@ async function nodeSDKBuilder(config) {
|
|
|
157
147
|
resource: _resource,
|
|
158
148
|
idGenerator: new import_id_generator_aws_xray.AWSXRayIdGenerator(),
|
|
159
149
|
spanProcessors: [new import_sdk_trace_base.BatchSpanProcessor(_traceExporter, batchConfig)],
|
|
160
|
-
|
|
150
|
+
// Disabling metrics until traces feel in the right space.
|
|
151
|
+
// metricReader: _metricReader,
|
|
161
152
|
logRecordProcessors: [
|
|
162
153
|
new import_sdk_node.logs.BatchLogRecordProcessor(_logExporter, batchConfig)
|
|
163
154
|
],
|
|
@@ -171,7 +162,6 @@ async function nodeSDKBuilder(config) {
|
|
|
171
162
|
]
|
|
172
163
|
});
|
|
173
164
|
sdk.start();
|
|
174
|
-
import_api.diag.setLogger((_b = config.logger) != null ? _b : import_ts_logger.serverLogger, import_api.DiagLogLevel.WARN);
|
|
175
165
|
import_api.diag.info("Tracer successfully started");
|
|
176
166
|
Sentry.validateOpenTelemetrySetup();
|
|
177
167
|
import_process.default.on("SIGTERM", () => {
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/tracing.ts
|
|
2
2
|
import process from "process";
|
|
3
3
|
import { NodeSDK, logs } from "@opentelemetry/sdk-node";
|
|
4
|
-
import { DiagLogLevel, diag } from "@opentelemetry/api";
|
|
4
|
+
import { DiagConsoleLogger, DiagLogLevel, diag } from "@opentelemetry/api";
|
|
5
5
|
import { KnexInstrumentation } from "@opentelemetry/instrumentation-knex";
|
|
6
6
|
import { OTLPTraceExporter as HTTPOTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
7
7
|
import { OTLPTraceExporter as GRPCOTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-grpc";
|
|
@@ -14,9 +14,6 @@ import {
|
|
|
14
14
|
ATTR_SERVICE_VERSION
|
|
15
15
|
} from "@opentelemetry/semantic-conventions";
|
|
16
16
|
import { SentrySampler } from "@sentry/opentelemetry";
|
|
17
|
-
import { PeriodicExportingMetricReader } from "@opentelemetry/sdk-metrics";
|
|
18
|
-
import { OTLPMetricExporter as HTTPOTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-http";
|
|
19
|
-
import { OTLPMetricExporter as GRPCOTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-grpc";
|
|
20
17
|
import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node";
|
|
21
18
|
import {
|
|
22
19
|
envDetectorSync,
|
|
@@ -25,7 +22,6 @@ import {
|
|
|
25
22
|
} from "@opentelemetry/resources";
|
|
26
23
|
import { awsEcsDetectorSync } from "@opentelemetry/resource-detector-aws";
|
|
27
24
|
import * as Sentry from "@sentry/node";
|
|
28
|
-
import { serverLogger } from "@pocket-tools/ts-logger";
|
|
29
25
|
import {
|
|
30
26
|
BatchSpanProcessor,
|
|
31
27
|
ParentBasedSampler
|
|
@@ -67,12 +63,13 @@ function awaitAttributes(detector) {
|
|
|
67
63
|
var batchConfig = {
|
|
68
64
|
maxQueueSize: 4096,
|
|
69
65
|
maxExportBatchSize: 1e3,
|
|
70
|
-
scheduledDelayMillis:
|
|
66
|
+
scheduledDelayMillis: 500,
|
|
71
67
|
exportTimeoutMillis: 5e3
|
|
72
68
|
};
|
|
73
69
|
async function nodeSDKBuilder(config) {
|
|
74
|
-
var _a
|
|
70
|
+
var _a;
|
|
75
71
|
config = { ...tracingDefaults, ...config };
|
|
72
|
+
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.WARN);
|
|
76
73
|
const _resource = Resource.default().merge(
|
|
77
74
|
new Resource({
|
|
78
75
|
[ATTR_SERVICE_NAME]: config.serviceName,
|
|
@@ -83,14 +80,6 @@ async function nodeSDKBuilder(config) {
|
|
|
83
80
|
//collector url
|
|
84
81
|
url: `${config.url}/v1/traces`
|
|
85
82
|
}) : new GRPCOTLPTraceExporter({ url: config.url });
|
|
86
|
-
const _metricReader = new PeriodicExportingMetricReader({
|
|
87
|
-
exporter: config.protocol === "HTTP" ? new HTTPOTLPMetricExporter({
|
|
88
|
-
url: `${config.url}/v1/metrics`
|
|
89
|
-
}) : new GRPCOTLPMetricExporter({ url: config.url }),
|
|
90
|
-
// once every 60 seconds, GCP supports 1 every 5 seconds for custom metrics https://cloud.google.com/monitoring/quotas#custom_metrics_quotas
|
|
91
|
-
// But lets just do 60 seconds for now as we figure it out
|
|
92
|
-
exportIntervalMillis: 6e4
|
|
93
|
-
});
|
|
94
83
|
const _logExporter = config.protocol === "HTTP" ? new HTTPOTLPLogExporter({ url: `${config.url}/v1/logs` }) : new GRPCOTLPLogExporter({ url: config.url });
|
|
95
84
|
const instrumentations = [
|
|
96
85
|
getNodeAutoInstrumentations({
|
|
@@ -114,7 +103,8 @@ async function nodeSDKBuilder(config) {
|
|
|
114
103
|
ignoreIncomingPaths: ["/.well-known/apollo/server-health"]
|
|
115
104
|
},
|
|
116
105
|
"@opentelemetry/instrumentation-graphql": {
|
|
117
|
-
ignoreTrivialResolveSpans: true
|
|
106
|
+
ignoreTrivialResolveSpans: true,
|
|
107
|
+
allowValues: true
|
|
118
108
|
}
|
|
119
109
|
})
|
|
120
110
|
];
|
|
@@ -131,7 +121,8 @@ async function nodeSDKBuilder(config) {
|
|
|
131
121
|
resource: _resource,
|
|
132
122
|
idGenerator: new AWSXRayIdGenerator(),
|
|
133
123
|
spanProcessors: [new BatchSpanProcessor(_traceExporter, batchConfig)],
|
|
134
|
-
|
|
124
|
+
// Disabling metrics until traces feel in the right space.
|
|
125
|
+
// metricReader: _metricReader,
|
|
135
126
|
logRecordProcessors: [
|
|
136
127
|
new logs.BatchLogRecordProcessor(_logExporter, batchConfig)
|
|
137
128
|
],
|
|
@@ -145,7 +136,6 @@ async function nodeSDKBuilder(config) {
|
|
|
145
136
|
]
|
|
146
137
|
});
|
|
147
138
|
sdk.start();
|
|
148
|
-
diag.setLogger((_b = config.logger) != null ? _b : serverLogger, DiagLogLevel.WARN);
|
|
149
139
|
diag.info("Tracer successfully started");
|
|
150
140
|
Sentry.validateOpenTelemetrySetup();
|
|
151
141
|
process.on("SIGTERM", () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pocket-tools/tracing",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"description": "Utilities for tracing",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tracing"
|
|
@@ -86,7 +86,6 @@
|
|
|
86
86
|
"@opentelemetry/sdk-trace-node": "1.26.0",
|
|
87
87
|
"@opentelemetry/semantic-conventions": "1.27.0",
|
|
88
88
|
"@opentelemetry/winston-transport": "0.6.0",
|
|
89
|
-
"@pocket-tools/ts-logger": "workspace:*",
|
|
90
89
|
"@prisma/instrumentation": "5.19.1",
|
|
91
90
|
"@sentry/node": "8.33.0",
|
|
92
91
|
"@sentry/opentelemetry": "8.33.0",
|