Repository URL to install this package:
|
Version:
0.6.14 ▾
|
// (c) Copyright 2023 Supertenant Ltd. - all rights reserved.
// See LICENSE file in project root for license terms.
"use strict";let logger;logger=require("../logger").getLogger("util/initializedTooLate",newLogger=>{logger=newLogger});const hasThePackageBeenInitializedTooLate=require("@supertenant/core").util.hasThePackageBeenInitializedTooLate,agentConnection=require("../agentConnection");let warningHasBeenLogged=!1;function fireMonitoringEvent(){agentConnection.sendAgentMonitoringEvent("nodejs_collector_initialized_too_late","TRACER",error=>{error&&logger.error("Error received while trying to send Agent Monitoring Event to agent: %s",error.message)})}exports.check=function(){hasThePackageBeenInitializedTooLate()&&(warningHasBeenLogged||(logger.warn("It seems you have initialized the @supertenant/collector package too late. Please check our documentation on that, in particular https://www.ibm.com/docs/de/obi/current?topic=nodejs-collector-installation#installing-the-nodejs-collector-package and https://www.ibm.com/docs/de/obi/current?topic=nodejs-collector-installation#common-pitfalls. Tracing might only work partially with this setup, that is, some calls will not be captured."),warningHasBeenLogged=!0),fireMonitoringEvent(),setInterval(fireMonitoringEvent,6e5).unref())};