Configure Application Insights default client
using settings taken from the environment:
setup tracing options
setup cloudRole and version
eventually setup http keeplive to prevent SNAT port exhaustion
start application insights
As the default client is a singleton shared between functions
you may want to prevent bootstrapping insights more than once
checking if appInsights.defaultClient id already set in the caller.
If you need to programmatically call Application Insights methods
set operationId = context.Tracecontext.traceparent to correlate
the call with the parent request.
Configure Application Insights default client using settings taken from the environment:
As the default client is a singleton shared between functions you may want to prevent bootstrapping insights more than once checking if appInsights.defaultClient id already set in the caller.
To enable http agent keepalive set up these environment variables: https://github.com/pagopa/io-ts-commons/blob/master/src/agent.ts#L11
If you need to programmatically call Application Insights methods set operationId = context.Tracecontext.traceparent to correlate the call with the parent request.