plutin 1.7.14 → 1.7.16

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 CHANGED
@@ -1703,12 +1703,14 @@ var MetricsManager = class {
1703
1703
  static {
1704
1704
  __name(this, "MetricsManager");
1705
1705
  }
1706
+ meter = null;
1706
1707
  constructor() {
1707
- console.log(`OTEL_ENABLE - value: ${process.env.OTEL_ENABLE} - type: ${typeof process.env.OTEL_ENABLE}`);
1708
- console.log("OTEL_SERVICE_NAME", process.env.OTEL_SERVICE_NAME);
1709
- console.log("OTEL_SERVICE_VERSION", process.env.OTEL_SERVICE_VERSION);
1708
+ try {
1709
+ this.meter = OTEL_ENABLED ? import_api2.metrics.getMeter(process.env.OTEL_SERVICE_NAME || "plutin-boilerplate-common", process.env.OTEL_SERVICE_VERSION || "1.0.0") : null;
1710
+ } catch (err) {
1711
+ console.error("Error initializing metrics manager:", err);
1712
+ }
1710
1713
  }
1711
- meter = OTEL_ENABLED ? import_api2.metrics.getMeter(process.env.OTEL_SERVICE_NAME || "plutin-boilerplate-common", process.env.OTEL_SERVICE_VERSION || "1.0.0") : null;
1712
1714
  httpRequestsTotal = this.meter?.createCounter("http_requests_total", {
1713
1715
  description: "Total de requisi\xE7\xF5es HTTP",
1714
1716
  unit: "1"
@@ -1987,6 +1989,7 @@ var MetricsManager = class {
1987
1989
  });
1988
1990
  }
1989
1991
  startSystemMetricsCollection(intervalMs = 5e3) {
1992
+ console.log(`OTEL_ENABLED - ${!OTEL_ENABLED} - ${this.meter}`);
1990
1993
  if (!OTEL_ENABLED || !this.meter) {
1991
1994
  return;
1992
1995
  }