appinsights-logger
Advanced tools
Comparing version 0.0.6 to 0.1.0
import * as appInsights from 'applicationinsights'; | ||
import { EventTelemetry, DependencyTelemetry, ExceptionTelemetry, MetricTelemetry, RequestTelemetry, TraceTelemetry } from 'applicationinsights/out/Declarations/Contracts'; | ||
import { RulesDictonary } from './samplingRulesByUrl'; | ||
export declare const ai: typeof appInsights; | ||
export declare const aiClient: appInsights.TelemetryClient; | ||
export declare const ai: typeof appInsights; | ||
export declare function trackEvent(telemetry: EventTelemetry): void; | ||
@@ -19,2 +20,3 @@ export declare function trackException(telemetry: ExceptionTelemetry): void; | ||
export declare function measureDependency(marker: IMarker, data?: string, success?: boolean): void; | ||
export declare function samplingRulesByUrl(rulesDictionary: RulesDictonary): void; | ||
export {}; |
@@ -5,2 +5,3 @@ "use strict"; | ||
const clientKey = (process.env.APPINSIGHTS_INSTRUMENTATIONKEY || "fake"); | ||
const samplingRulesByUrl_1 = require("./samplingRulesByUrl"); | ||
appInsights.setup(clientKey) | ||
@@ -15,6 +16,7 @@ .setAutoDependencyCorrelation((process.env.AI_AUTO_DEPENDENCY_CORRELATE === 'false' ? false : true)) | ||
.setSendLiveMetrics(false) | ||
.setDistributedTracingMode(appInsights.DistributedTracingModes.AI_AND_W3C) | ||
.start(); | ||
.setDistributedTracingMode(appInsights.DistributedTracingModes.AI_AND_W3C); | ||
exports.ai = appInsights; // in case you need to override setup() | ||
exports.aiClient = appInsights.defaultClient; | ||
exports.ai = appInsights; // in case you need to override setup() | ||
exports.aiClient.config.samplingPercentage = parseInt(process.env.AI_SAMPLING_PERCENTAGE || '100'); | ||
exports.ai.start(); | ||
const debugInsightsEnabled = (process.env.DEBUG_INSIGHTS === 'true') || false; | ||
@@ -52,2 +54,6 @@ exports.aiClient.context.tags[exports.aiClient.context.keys.cloudRole] = process.env.WEBSITE_SITE_NAME || 'defaultCloudRole'; | ||
exports.measureDependency = measureDependency; | ||
function samplingRulesByUrl(rulesDictionary) { | ||
samplingRulesByUrl_1.addSamplingRulesByUrl(rulesDictionary, exports.aiClient); | ||
} | ||
exports.samplingRulesByUrl = samplingRulesByUrl; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "appinsights-logger", | ||
"version": "0.0.6", | ||
"version": "0.1.0", | ||
"description": "thin, yet opinionated wrapper for applcation insights", | ||
@@ -27,3 +27,3 @@ "repository": "gopuff/appinsights-logger", | ||
"@types/node": "^13.9.8", | ||
"del-cli": "^3.0.0", | ||
"del-cli": "^3.0.1", | ||
"dotenv": "^8.2.0", | ||
@@ -30,0 +30,0 @@ "typescript": "^3.8.3" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11086
8
97
7