- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 the documentation关于如何使用 opencensus-python
将跟踪提交到 Azure Application Insights,详细说明了如何向 customDimensions
字段添加其他信息。也就是说,
import logging
from opencensus.ext.azure.log_exporter import AzureLogHandler
logger = logging.getLogger(__name__)
logger.addHandler(AzureLogHandler(
connection_string='InstrumentationKey=00000000-0000-0000-0000-000000000000')
)
logger.error('blooh')
logger.error('blooh2', extra={'custom_dimensions': {'woot': 42}})
变成了
在 Application Insights UI 中。
这一切都很好,但是从默认包含的 customDimensions
中删除项目的预期方法是什么?即像 fileName
和 process
这样的东西?
最佳答案
作者:inspection of the source code ,这些属性似乎很难避免创建,但可以通过对信封进行后处理来删除它们:
import logging
from opencensus.ext.azure.log_exporter import AzureLogHandler
custom_dimensions = {'foo': 'bar'}
def remove_items(envelope):
envelope.data.baseData.properties = custom_dimensions
return True
logger = logging.getLogger(__name__)
handler = AzureLogHandler(connection_string='InstrumentationKey=00000000-0000-0000-0000-000000000000')
handler.add_telemetry_processor(remove_items)
logger.addHandler(handler)
logger.error('blooh')
这已经过测试并可在 opencensus-ext-azure
版本 1.0.5 中运行。
另请注意,使用此方法,在记录时不再需要指定额外
。
关于python - 使用 opencensus-python 时从 Application Insights 中删除 customDimensions 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64576336/
我编写了一个标准 SQL 查询,用于从 BigQuery 中提取一些 Google Analytics(分析)数据。我在下面粘贴了一个用于测试的简化版本: SELECT COUNT(DISTINCT(
截至几天前,以下查询在使用the schema generated by an export from GA的BQ上运行良好: SELECT hits.customDimensions.value F
我已经为 ASP.NET Core 项目设置了应用程序洞察。 appsettings.json: "ApplicationInsights": { "InstrumentationKey"
我已经为 ASP.NET Core 项目设置了应用程序洞察。 appsettings.json: "ApplicationInsights": { "InstrumentationKey"
我正在使用以下代码将数据发送到应用程序洞察 appInsights.trackEvent({ name:'EventName', proprties:{'keys1':'value1' ,
我的 BigQuery 表如下所示 Fullvisitorid CustomDimension.Index CustomDimension.value 123
我正在迁移到 BigQuery 中的新 SQL 语法,因为它看起来更灵活。然而,在访问 customDimensions 中的字段时,我有点卡住了。我正在写一些非常简单的东西,如下所示: SELECT
我们正在使用 Azure 应用程序 Insights 进行错误日志记录。我是 KQL 新手,并尝试按以下格式从内置的“customDimensions”列中获取自定义属性, “customDimens
我们正在使用 Azure 应用程序 Insights 进行错误日志记录。我是 KQL 新手,并尝试按以下格式从内置的“customDimensions”列中获取自定义属性, “customDimens
对于这个具体问题很抱歉,但我觉得我已经走到了死胡同,因为我对 SQL 的了解还没有那么远。 来自 GoogleAnalytics 原始数据的 BigQuery 实现的数据如下所示: |-visitId
我正在尝试将 Azure App Insights 与 Azure Function App (HttpTriggered) 集成。我想在请求表的“customDimensions”对象中添加我自己的
在 the documentation关于如何使用 opencensus-python 将跟踪提交到 Azure Application Insights,详细说明了如何向 customDimensi
在 the documentation关于如何使用 opencensus-python 将跟踪提交到 Azure Application Insights,详细说明了如何向 customDimensi
我是一名优秀的程序员,十分优秀!