You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Quarkus:如何从OpenTelemetry采集器中排除特定路径日志

在Quarkus自动Instrumentation中排除指定路径的OpenTelemetry采集

你可以通过配置OpenTelemetry的通用排除路径属性,过滤掉健康检查/check和Prometheus指标/q/metrics的采集数据,具体配置方式如下:

通过Quarkus配置文件设置

在项目的src/main/resources/application.properties中添加以下配置:

# 排除指定路径的OTel采集
otel.instrumentation.common.exclude-paths=/check,/q/metrics

通过系统属性启动应用时设置

启动Quarkus应用时,直接通过JVM系统参数传入排除规则:

java -Dotel.instrumentation.common.exclude-paths="/check,/q/metrics" -jar your-quarkus-app-runner.jar

补充说明

  • 路径之间用逗号分隔,支持ANT风格通配符(比如/q/*可排除所有/q/开头的路径)
  • 该配置基于OpenTelemetry Java Instrumentation的通用规则,Quarkus自动Instrumentation会直接生效
  • 如果使用Quarkus官方的OpenTelemetry扩展,同样适用上述配置

内容的提问来源于stack exchange,提问作者wiradikusuma

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.06 07:42:39