1. npm 安裝 applicationinsights 2. index.js 註冊appinsight ``` import * as appInsights from 'applicationinsights'; // 建立 application insight // 環境參數決定哪個環境需要建立appinsight if (process.env.PROJECT_ENV === Environment.PRD || process.env.PROJECT_ENV === Environment.DEV) { appInsights .setup(process.env.APPLICATION_INSIGHT_CONNECTION) .setAutoDependencyCorrelation(true) .setAutoCollectRequests(true) .setAutoCollectPerformance(true, true) .setAutoCollectExceptions(true) .setAutoCollectDependencies(true) .setAutoCollectConsole(true) .setUseDiskRetryCaching(true) .setSendLiveMetrics(false) .setDistributedTracingMode(appInsights.DistributedTracingModes.AI) .start(); } ``` 3. env.參數設定 > 記得CICD環境參數也要放進去 ``` APPLICATION_INSIGHT_CONNECTION={連線資訊} ``` 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up