import * as appInsights from "applicationinsights"; import Config = require("applicationinsights/out/Library/Config"); export interface IInsightsTracingConfig { readonly isTracingDisabled?: boolean; readonly cloudRole?: string; readonly applicationVersion?: string; } export type ApplicationInsightsConfig = IInsightsTracingConfig & Partial>; /** * Internal usage, do not export */ declare function startAppInsights(connectionString: string, aiConfig: ApplicationInsightsConfig): appInsights.TelemetryClient; export declare function removeQueryParamsPreprocessor(envelope: appInsights.Contracts.Envelope, _?: { readonly [name: string]: unknown; }): boolean; export declare function disableSamplingByTag(envelope: appInsights.Contracts.Envelope, _?: { readonly [name: string]: unknown; }): boolean; /** * 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. * */ export declare function initAppInsights(aiConnectionString: string, config?: ApplicationInsightsConfig, env?: typeof process.env): ReturnType; export {};