@forklaunch/core 0.7.1 → 0.7.2
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/lib/{openTelemetryCollector-CmZ3T_2T.d.mts → openTelemetryCollector-DQC2FfOu.d.mts} +1 -0
- package/lib/{openTelemetryCollector-CmZ3T_2T.d.ts → openTelemetryCollector-DQC2FfOu.d.ts} +1 -0
- package/lib/src/cache/index.d.mts +1 -1
- package/lib/src/cache/index.d.ts +1 -1
- package/lib/src/cache/index.js +12 -7
- package/lib/src/cache/index.js.map +1 -1
- package/lib/src/cache/index.mjs +12 -7
- package/lib/src/cache/index.mjs.map +1 -1
- package/lib/src/http/index.d.mts +4 -2
- package/lib/src/http/index.d.ts +4 -2
- package/lib/src/http/index.js +10 -1
- package/lib/src/http/index.js.map +1 -1
- package/lib/src/http/index.mjs +10 -1
- package/lib/src/http/index.mjs.map +1 -1
- package/lib/src/services/index.d.mts +0 -1
- package/lib/src/services/index.d.ts +0 -1
- package/lib/src/services/index.js +9 -16
- package/lib/src/services/index.js.map +1 -1
- package/lib/src/services/index.mjs +9 -14
- package/lib/src/services/index.mjs.map +1 -1
- package/package.json +3 -3
package/lib/src/http/index.mjs
CHANGED
@@ -241,6 +241,7 @@ import {
|
|
241
241
|
ATTR_SERVICE_NAME as ATTR_SERVICE_NAME2
|
242
242
|
} from "@opentelemetry/semantic-conventions";
|
243
243
|
import dotenv from "dotenv";
|
244
|
+
import { v4 as v42 } from "uuid";
|
244
245
|
|
245
246
|
// src/http/guards/isForklaunchRequest.ts
|
246
247
|
function isForklaunchRequest(request) {
|
@@ -390,8 +391,12 @@ var OpenTelemetryCollector = class {
|
|
390
391
|
break;
|
391
392
|
}
|
392
393
|
}
|
393
|
-
this.log(
|
394
|
+
this.log(
|
395
|
+
"info",
|
396
|
+
"OpenTelemetry Collector (Traces + Logs + Metrics) started"
|
397
|
+
);
|
394
398
|
}
|
399
|
+
uuid = v42();
|
395
400
|
logger;
|
396
401
|
metrics;
|
397
402
|
log(level, ...args) {
|
@@ -2289,6 +2294,9 @@ import {
|
|
2289
2294
|
|
2290
2295
|
// src/http/telemetry/recordMetric.ts
|
2291
2296
|
function recordMetric(req, res) {
|
2297
|
+
if (res.metricRecorded) {
|
2298
|
+
return;
|
2299
|
+
}
|
2292
2300
|
httpRequestsTotalCounter.add(1, {
|
2293
2301
|
[ATTR_SERVICE_NAME3]: getEnvVar("OTEL_SERVICE_NAME"),
|
2294
2302
|
[ATTR_API_NAME]: req.contractDetails?.name,
|
@@ -2297,6 +2305,7 @@ function recordMetric(req, res) {
|
|
2297
2305
|
[ATTR_HTTP_ROUTE3]: req.originalPath,
|
2298
2306
|
[ATTR_HTTP_RESPONSE_STATUS_CODE3]: res.statusCode || 0
|
2299
2307
|
});
|
2308
|
+
res.metricRecorded = true;
|
2300
2309
|
}
|
2301
2310
|
|
2302
2311
|
// src/http/middleware/response/enrichExpressLikeSend.middleware.ts
|