UNPKG

applicationinsights

Version:

Microsoft Application Insights module for Node.js

1 lines 2.47 kB
{"version":3,"file":"nodeClient.js","sourceRoot":"","sources":["../../../src/shim/nodeClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,4CAA0C;AAC1C,+DAAmE;AAEnE,MAAM,UAAW,SAAQ,qCAAe;IACpC;;;;;OAKG;IACI,wBAAwB,CAAC,SAA6C;QACzE,UAAI,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;IAC7E,CAAC;IAED;;;;OAIG;IACI,oBAAoB,CAAC,SAA6C;QACrE,UAAI,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACI,uBAAuB,CAAC,SAA6C;QACxE,UAAI,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;IAC5E,CAAC;CACJ;AAED,iBAAS,UAAU,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT license.\r\n\r\nimport { diag } from \"@opentelemetry/api\";\r\nimport { Contracts, TelemetryClient } from \"./applicationinsights\";\r\n\r\nclass NodeClient extends TelemetryClient {\r\n /**\r\n * Log RequestTelemetry from HTTP request and response. This method will log immediately without waiting for request completion\r\n * and it requires duration parameter to be specified on NodeHttpRequestTelemetry object.\r\n * Use trackNodeHttpRequest function to log the telemetry after request completion\r\n * @param telemetry Object encapsulating incoming request, response and duration information\r\n */\r\n public trackNodeHttpRequestSync(telemetry: Contracts.NodeHttpRequestTelemetry) {\r\n diag.warn(\"trackNodeHttpRequestSync is not implemented and is a no-op.\");\r\n }\r\n \r\n /**\r\n * Log RequestTelemetry from HTTP request and response. This method will `follow` the request to completion.\r\n * Use trackNodeHttpRequestSync function to log telemetry immediately without waiting for request completion\r\n * @param telemetry Object encapsulating incoming request and response information\r\n */\r\n public trackNodeHttpRequest(telemetry: Contracts.NodeHttpRequestTelemetry) {\r\n diag.warn(\"trackNodeHttpRequest is not implemented and is a no-op.\");\r\n }\r\n \r\n /**\r\n * Log DependencyTelemetry from outgoing HTTP request. This method will instrument the outgoing request and append\r\n * the specified headers and will log the telemetry when outgoing request is complete\r\n * @param telemetry Object encapsulating outgoing request information\r\n */\r\n public trackNodeHttpDependency(telemetry: Contracts.NodeHttpRequestTelemetry) {\r\n diag.warn(\"trackNodeHttpDependency is not implemented and is a no-op.\");\r\n }\r\n}\r\n\r\nexport = NodeClient;\r\n"]}