Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

ApplicationInsightsConfig

ApplicationInsightsConfig: IInsightsTracingConfig & Partial<Pick<Config, "httpAgent" | "httpsAgent" | "samplingPercentage" | "disableAppInsights">>

Functions

disableSamplingByTag

  • disableSamplingByTag(envelope: appInsights.Contracts.Envelope, _?: {}): boolean
  • Parameters

    • envelope: appInsights.Contracts.Envelope
    • Optional _: {}
      • [name: string]: unknown

    Returns boolean

initAppInsights

  • initAppInsights(aiInstrumentationKey: string, config?: ApplicationInsightsConfig, env?: typeof process.env): ReturnType<typeof startAppInsights>
  • 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.

    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.

    Parameters

    Returns ReturnType<typeof startAppInsights>

removeQueryParamsPreprocessor

  • removeQueryParamsPreprocessor(envelope: appInsights.Contracts.Envelope, _?: {}): boolean
  • Parameters

    • envelope: appInsights.Contracts.Envelope
    • Optional _: {}
      • [name: string]: unknown

    Returns boolean

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Enumeration
  • Class with type parameter

Generated using TypeDoc