- 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/
我正在尝试使用 OpenCensus 和 Azure Application Insights 在 Python 中发送指标。 理想情况下,我想发送一些具有任意结构的 Python 字典,但是 Ope
我正在使用 Opencensus 在有 10 个工作人员的 grpc 服务器上做一些监控。我的问题是,在制作示踪剂时,示踪剂的导出商应该是本地的还是全局的。浏览器 这是服务器: server = gr
本文整理了Java中io.opencensus.contrib.zpages.ZPageHandlers类的一些代码示例,展示了ZPageHandlers类的具体用法。这些代码示例主要来源于Githu
我正在尝试使用 OpenCensus 将 django 项目日志连接到 Azure Application Insights。 middleware对于 montirong 请求效果很好,但我也想发送
我正在尝试使用 OpenCensus 从我的 Go 应用程序向 Stackdriver 发送自定义指标。 我关注了 guide ,因此设置了 View 和导出器: import ( "cont
本文整理了Java中io.opencensus.exporter.trace.zipkin.ZipkinTraceExporter类的一些代码示例,展示了ZipkinTraceExporter类的具体
使用 opencensus Azure 启动日志后,我无法导入 mlflow。MLFlow 导入将永远运行。 我的环境如下: Python 3.7 opencensus-ext-azure 1.0.7
本文整理了Java中io.opencensus.contrib.zpages.ZPageHandlers.startHttpServerAndRegisterAll()方法的一些代码示例,展示了ZPa
先决条件:Node.js应用Opencensus图书馆Zipkin Exporter和本地的 Zipkin 服务 app.js : const tracing = require('@open
本文整理了Java中io.opencensus.exporter.trace.zipkin.ZipkinTraceExporter.unregister()方法的一些代码示例,展示了ZipkinTra
本文整理了Java中io.opencensus.exporter.trace.zipkin.ZipkinTraceExporter.register()方法的一些代码示例,展示了ZipkinTrace
我是 Google PubSub 的新手。我在客户端库中使用 GoLang。 如何查看 google-cloud-go 库记录的 opencensus 指标? 我已经成功向 Google PubSub
我在 apache karaf 4.2.6 和 java 11 中有一个模块,可以验证 Google Play 中的购买收据。我正在使用 androidpublisher。 当它第一次发送请求时,我在
我在销售我的 go-project 时遇到问题。尝试使用 glide 和 go-dep - 遇到同样的问题。 $ go get -u go.opencensus.io 给出以下错误: package
我正在使用以下函数将一些日志记录标准输出从 Databricks 发送到 Azure 应用程序洞察日志。 我的功能 import logging from opencensus.ext.azure.l
在 the documentation关于如何使用 opencensus-python 将跟踪提交到 Azure Application Insights,详细说明了如何向 customDimensi
在 the documentation关于如何使用 opencensus-python 将跟踪提交到 Azure Application Insights,详细说明了如何向 customDimensi
我正在将包含 Python 应用程序的容器部署到 GKE,但在尝试使用 OpenCensus 发送跟踪消息时遇到错误: Traceback (most recent call last): Fil
我正在使用 OpenCensus 比较不同的跟踪后端。我已经有了使用 Zipkin 和 Azure Monitor 运行良好的简单 OpenCensus.io python 示例。 现在我正在尝试使用
In the docs它说要安装云客户端库(pip install google-cloud-monitoring)。但是,云客户端库在应用程序引擎上的 python2 标准环境中不可用,descri
我是一名优秀的程序员,十分优秀!