当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript applicationinsights.getClient函数代码示例

本文整理汇总了TypeScript中applicationinsights.getClient函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getClient函数的具体用法?TypeScript getClient怎么用?TypeScript getClient使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getClient函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: getClient

	export function getClient(aiKey: string): typeof appInsights.client {

		ensureAIEngineIsInitialized();

		const client = appInsights.getClient(aiKey);
		client.channel.setOfflineMode(true);
		client.context.tags[client.context.keys.deviceMachineName] = ''; //prevent App Insights from reporting machine name
		if (aiKey.indexOf('AIF-') === 0) {
			client.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1';
		}
		return client;
	}
开发者ID:Buildsoftwaresphere,项目名称:vscode,代码行数:12,代码来源:aiAdapter.ts

示例2: constructor

	constructor(options: Options) {
		this.name = options.name;
        this.options = Object.assign({}, DEFAULT_LOGGING_OPTIONS, options.log);
        this.options.messages = MessageLevel.parse(this.options.messages);

        if (options.console) {
            this.cClient = new ConsoleLogger(this.name, options.console);
        }
        
        if (options.telemetry) {
            validateTelemetryProvider(options.telemetry);
            this.tClient = ApplicationInsights.getClient(options.telemetry.key);
        }

        if (options.sources) {
            if (!Array.isArray(options.sources)) throw new TypeError('sources option must be an array');
            this.whitelist = new Set(options.sources);
        }
	}
开发者ID:herculesinc,项目名称:credo.logger,代码行数:19,代码来源:index.ts

示例3: getClient

function getClient(aiKey: string): typeof appInsights.client {

	ensureAIEngineIsInitialized();

	const client = appInsights.getClient(aiKey);
	client.channel.setOfflineMode(true);

	// {{SQL CARBON EDIT}}
	// clear all ID fields from telemetry
	client.context.tags[client.context.keys.deviceMachineName] = '';
	client.context.tags[client.context.keys.cloudRoleInstance] = '';

	// set envelope flags to suppress Vortex ingest header
	client.addTelemetryProcessor((envelope, contextObjects) => {
		envelope.flags = 0x200000;
		return true;
	});

	if (aiKey.indexOf('AIF-') === 0) {
		client.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1';
	}
	return client;
}
开发者ID:jumpinjackie,项目名称:sqlopsstudio,代码行数:23,代码来源:appInsightsAppender.ts

示例4: constructor

 constructor(key: string) {
     this.client = applicationinsights.getClient(key);
     let sessionKey = this.client.context.keys.sessionId;
     this.client.context.tags[sessionKey] = uuidv4();
 }
开发者ID:arjun-msft,项目名称:opent2t,代码行数:5,代码来源:AppInsightsTrackerTransport.ts


注:本文中的applicationinsights.getClient函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。