plutin 1.6.7 → 1.7.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 +56 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.mjs +55 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -456,6 +456,7 @@ __export(src_exports, {
|
|
|
456
456
|
Inject: () => Inject,
|
|
457
457
|
NotificationErrorInMemory: () => NotificationErrorInMemory,
|
|
458
458
|
NotificationFactory: () => NotificationFactory,
|
|
459
|
+
OpenTelemetry: () => OpenTelemetry,
|
|
459
460
|
SentryNotifier: () => SentryNotifier,
|
|
460
461
|
Span: () => Span,
|
|
461
462
|
TracerGatewayOpentelemetry: () => TracerGatewayOpentelemetry,
|
|
@@ -1176,9 +1177,22 @@ var FastifyAdapter = class {
|
|
|
1176
1177
|
this.instance = (0, import_fastify.default)({
|
|
1177
1178
|
bodyLimit: 10 * 1024 * 1024,
|
|
1178
1179
|
querystringParser: (str) => import_qs.default.parse(str),
|
|
1179
|
-
|
|
1180
|
+
logger: false,
|
|
1181
|
+
disableRequestLogging: true
|
|
1180
1182
|
});
|
|
1181
1183
|
this.instance.register(import_cors2.default);
|
|
1184
|
+
if (env.NODE_ENV !== "test") {
|
|
1185
|
+
this.instance.addHook("onRequest", async (request) => {
|
|
1186
|
+
logger2.info({
|
|
1187
|
+
req: request
|
|
1188
|
+
});
|
|
1189
|
+
});
|
|
1190
|
+
this.instance.addHook("onResponse", async (_, reply) => {
|
|
1191
|
+
logger2.info({
|
|
1192
|
+
res: reply
|
|
1193
|
+
});
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1182
1196
|
}
|
|
1183
1197
|
registerRoute(controllerClass) {
|
|
1184
1198
|
const { metadata } = validateControllerMetadata(controllerClass);
|
|
@@ -1614,6 +1628,46 @@ var WinstonOtelFastify = class WinstonOtelFastify2 {
|
|
|
1614
1628
|
}
|
|
1615
1629
|
};
|
|
1616
1630
|
|
|
1631
|
+
// src/infra/adapters/observability/otel/opentelemetry.ts
|
|
1632
|
+
var import_exporter_logs_otlp_proto = require("@opentelemetry/exporter-logs-otlp-proto");
|
|
1633
|
+
var import_exporter_metrics_otlp_proto = require("@opentelemetry/exporter-metrics-otlp-proto");
|
|
1634
|
+
var import_exporter_trace_otlp_proto = require("@opentelemetry/exporter-trace-otlp-proto");
|
|
1635
|
+
var import_resources = require("@opentelemetry/resources");
|
|
1636
|
+
var import_sdk_logs = require("@opentelemetry/sdk-logs");
|
|
1637
|
+
var import_sdk_metrics = require("@opentelemetry/sdk-metrics");
|
|
1638
|
+
var import_sdk_node = require("@opentelemetry/sdk-node");
|
|
1639
|
+
var import_semantic_conventions = require("@opentelemetry/semantic-conventions");
|
|
1640
|
+
var OpenTelemetry = class OpenTelemetry2 {
|
|
1641
|
+
static {
|
|
1642
|
+
__name(this, "OpenTelemetry");
|
|
1643
|
+
}
|
|
1644
|
+
env;
|
|
1645
|
+
sdk;
|
|
1646
|
+
constructor(env) {
|
|
1647
|
+
this.env = env;
|
|
1648
|
+
this.sdk = new import_sdk_node.NodeSDK({
|
|
1649
|
+
resource: new import_resources.Resource({
|
|
1650
|
+
[import_semantic_conventions.SEMRESATTRS_SERVICE_NAME]: this.env.OTEL_SERVICE_NAME,
|
|
1651
|
+
[import_semantic_conventions.SEMRESATTRS_SERVICE_VERSION]: this.env.OTEL_SERVICE_VERSION
|
|
1652
|
+
}),
|
|
1653
|
+
traceExporter: new import_exporter_trace_otlp_proto.OTLPTraceExporter({
|
|
1654
|
+
url: this.env.OTEL_OTLP_TRACES_EXPORTER_URL
|
|
1655
|
+
}),
|
|
1656
|
+
logRecordProcessor: new import_sdk_logs.BatchLogRecordProcessor(new import_exporter_logs_otlp_proto.OTLPLogExporter({
|
|
1657
|
+
url: this.env.OTEL_OTLP_LOGS_EXPORTER_URL
|
|
1658
|
+
})),
|
|
1659
|
+
metricReader: new import_sdk_metrics.PeriodicExportingMetricReader({
|
|
1660
|
+
exporter: new import_exporter_metrics_otlp_proto.OTLPMetricExporter({
|
|
1661
|
+
url: this.env.OTEL_OTLP_METRICS_EXPORTER_URL
|
|
1662
|
+
})
|
|
1663
|
+
})
|
|
1664
|
+
});
|
|
1665
|
+
}
|
|
1666
|
+
startSdk() {
|
|
1667
|
+
this.sdk.start();
|
|
1668
|
+
}
|
|
1669
|
+
};
|
|
1670
|
+
|
|
1617
1671
|
// src/infra/adapters/observability/otel/span-decorator.ts
|
|
1618
1672
|
var import_api2 = __toESM(require("@opentelemetry/api"), 1);
|
|
1619
1673
|
var import_reflect_metadata4 = require("reflect-metadata");
|
|
@@ -1754,6 +1808,7 @@ var baseEnvSchema = import_zod.z.object({
|
|
|
1754
1808
|
Inject,
|
|
1755
1809
|
NotificationErrorInMemory,
|
|
1756
1810
|
NotificationFactory,
|
|
1811
|
+
OpenTelemetry,
|
|
1757
1812
|
SentryNotifier,
|
|
1758
1813
|
Span,
|
|
1759
1814
|
TracerGatewayOpentelemetry,
|