应用程序见解和标签 [英] Application Insights and Tags

查看:69
本文介绍了应用程序见解和标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个集成了Application Insights的应用程序(asp.net).在门户中,我创建了2个标签:App1 = 1,App2 = 1(每个应用一个标签).但是下一步是什么?如何将标签添加到ApplicationInsights.config中,以便每个应用程序发送其标签?

I have 2 applications (asp.net) with Application Insights integrated. In the portal I have created 2 tags: App1 = 1, App2 = 1 (one tag for each app). But what is the next step? How do I add the tags into the ApplicationInsights.config, so that each app sends its tag?

推荐答案

那不是标记的用途.他们在那里整理您的Azure资源,请参见

That's not where tags are for. They are there to organize your Azure resources, see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-using-tags.

资源管理器使您可以通过应用标签来逻辑组织资源.标签由键/值对组成,这些键/值对使用您定义的属性来标识资源.要将资源标记为属于同一类别,请对这些资源应用相同的标签.

Resource Manager enables you to logically organize resources by applying tags. The tags consist of key/value pairs that identify resources with properties that you define. To mark resources as belonging to the same category, apply the same tag to those resources.

如果要在两个应用程序之间进行区分,则需要使用不同的工具密钥,这意味着两个不同的Application Insights环境.

If you want to make a distinction between the two apps you need to use different instrumentation keys, meaning two distinct Application Insights environments.

来自 https://docs.microsoft.com/zh-CN/azure/application-insights/app-insights-create-new-resource :

检测键标识您创建的资源.您需要将其提供给SDK.

The instrumentation key identifies the resource that you created. You'll need it to give to the SDK.

作为替代方案,您可以按照以下概述将自定义属性添加到您的SDK调用中以进行区分: https://blogs.msdn.microsoft.com/visualstudioalm/2015/01/07/application-insights-support-for-multiple-environments-stamps-and-app-versions/

As an alternative you could add custom properties to your SDK calls to make a distinction if that is what you need as outlined here: https://blogs.msdn.microsoft.com/visualstudioalm/2015/01/07/application-insights-support-for-multiple-environments-stamps-and-app-versions/ and Adding custom properties for each request in Application Insights metrics

因此,这取决于Web应用程序的差异.如果它们不相关,我建议使用不同的工具密钥.如果一个应用程序是暂存/测试应用程序,而另一个应用程序是生产应用程序,则可以考虑使用自定义属性,以便可以基于该自定义属性比较收集的数据.

So it depends on the web application differences. If they are unrelated I would suggest using different instrumentation keys. If one app is a staging/test app and the other is the production app then you can consider using custom properties so you can compare the gathered data based on the custom property.

这篇关于应用程序见解和标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆