英文:
Enable/disable programmatically opentelemetry exporters
问题
我想要能够在需要进行故障排除时仅启用导出器的能力。禁用代理不合理,因为仪器化应在启动 JVM 时进行,所以我的想法是以禁用导出器的方式启动服务器,如下所示:
opentelemetry-javaagent.jar -Dotel.traces.exporter=none -Dotel.metrics.exporter=none
然后,通过 JMX 的某种方式,我们可以启用导出器。
有办法实现这一点吗?
英文:
I would like to have the ability to enable exporters only when needed for troubleshooting. Disabling the agent wouldn't make sense, since the instrumentation should happen when starting the jvm, so my idea is to start my server with disabled exporters like this:
> opentelemetry-javaagent.jar -Dotel.traces.exporter=none -Dotel.metrics.exporter=none
and then somehow with JMX we can enable the exporters.
Is there a way to achieve this?
答案1
得分: 2
我建议,与其禁用导出功能,不如创建一个自定义的采样器。你可以大部分时间将采样关闭,并在需要时启用它。这也能避免收集和处理跨度的开销。
英文:
I would suggest that instead of disabling the export, you make a custom sampler. You can have sampling turned off most of the time and enable it as you see fit. This also would avoid the overhead of collecting and processing spans.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论