如何在dotnet C#中使用开放式遥测设置弹性云可观察性的环境?
I have configured my tracing provider, instrumentation and OTLP Exporter which works great in Elastic Cloud Observability dashboards.
It is easy to set the service name but there does not seem seem to be a common API to set the Environment name.
So when I click on Traces all I see is All or Not Defined.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仔细浏览了围绕开放遥测的弹性搜索文档后,我发现绝对没有有关如何做到这一点的信息!
-edit-最近允许W3C使用弹性架构常见模式。因此,引用
您需要与Otel Exporter一起通过的属性就像
service.envorirnment
* *deployment.environment.environment
是可以为您解决问题的代码段。
然后,您需要在资源建立器中添加属性
,现在的环境将用您的所有跟踪,指标和日志
After carefully skimming the Elastic Search documentation around Open Telemetry I found absolutely no information on how to do this!?
-Edit - Recently Elastic had allowed W3C to use the Elastics Common Schema for... everything. So reference that going forward
The attribute that you need to pass along with OTEL Exporter would be like
service.environment
*deployment.environment
Here is the code snippet that will solve the problem for you.
Then you need to add the attributes within the ResourceBuilder
And now environments will be tagged with all your Traces, Metrics and Logs