Unable to easily suppress dependency exception using java agent
维护者通常 1 天内回复
@heyams 已经在做这个了。
开始于 2023年6月20日。
评估
这个 Issue 还没有评估数据。
描述
Expected behavior
I was hoping to suppress an exception using exception.message or exception.stacktrace that is flooding our logs - 900,000 times a day.
Actual behavior
I only appear to be able to suppress the exception using exception.type.
To Reproduce
I started off followed the steps detailed in Span Attributes Available for Sampling to look for the exception. Whilst I can see all the dependencies exported that way, it appears that the exceptions are exported differently and don't appear with text exporting span. In my case I can see the exception as json in the log, for example
{
"ver": 1,
"name": "Exception",
"time": "2023-06-19T11:41:42.152Z",
"iKey": "b44af8fc-1647-443d-8cea-55c5cfbd4518",
"tags": {
"ai.internal.sdkVersion": "java:3.4.13",
},
"data": {
"baseType": "ExceptionData",
"baseData": {
"ver": 2,
"exceptions": [
{
"typeName": "java.sql.SQLException",
"message": "ORA-06550: line 1, column 28:",
"stack": "java.sql.SQLException: ORA-06550: line 1, column 28:\nPLS-00302: component 'GETMAXIDENTIFIERLENGTH' must be declared..."
}
]
}
}
I can get the suppression working with configuration such as
"telemetryType": "exception",
"attributes": [
{
"key": "exception.type",
"value": "java.sql.SQLException",
"matchType": "strict"
}
],
"percentage": 0
but would ideally like to match on the message or stacktrace instead. According to the opentelemetry exception documentation I think I should be matching on exception.message or exception.stacktrace, but can't get either to work. For example I think:
"telemetryType": "exception",
"attributes": [
{
"key": "exception.stacktrace",
"value": ".*GETDBCOMPATMAJORVERSION.*",
"matchType": "regexp"
}
],
"percentage": 0
should do the trick, but the exception still appears in the logs. I've also tried suppressing the dependency, which works fine with the above regexp but doesn't suppress the corresponding exception.
Please could you let me know the key that I need therefore to match on the stacktrace and / or message to suppress the exception. Looking at the Oracle code that throws the exception it appears to be caught and doesn't then affect the behaviour of the application, hence the reason for the suppression.
System information
Please provide the following information:
- SDK Version: java:3.4.13
- OS type and version: Based off docker image eclipse-temurin:19-jre-jammy so Java 19
- Application Server type and version (if applicable): Spring Boot 3.1.0
- Using spring-boot? Yes
- 主要语言
- Java
- 星标
- 326
- 派生
- 223
- 平均合并
- 23 小时 6 分钟
- 30 天内合并 PR
- 13
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/ApplicationInsights-Java 的其他 Issue
-
Java 25 native-access warning from bundled Netty requires broad ALL-UNNAMED permission可能已有人在做 @rajkumar-rangaraj 于 18 天前认领。 未关闭
microsoft/ApplicationInsights-Java#4851 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
microsoft/ApplicationInsights-Java#4770 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 30/100
microsoft/ApplicationInsights-Java#4769 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
microsoft/ApplicationInsights-Java#4729 · 133 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
microsoft/ApplicationInsights-Java#4712 ·
维护者通常 1 天内回复
查看 microsoft/ApplicationInsights-Java 的全部 Issue
相似的 Issue
-
new feature
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
apache/rocketmq-dashboard#5594 ·
维护者通常 3 天内回复
-
bug pkg:sdk
难度 2/5 1-3 小时 新手友好度 82/100
aws/aws-durable-execution-sdk-java#773 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
PCL-Community/PCL-CE#3652 ·
维护者通常 1 天内回复
-
TaskSecret.vue: replace explicit `any` with real types可能已有人在做 @prayas-bit 今天认领。 未关闭area/frontend good first issue kind/cooldown
难度 2/5 1-3 小时 新手友好度 68/100
kestra-io/kestra#20352 · 1 条评论 ·
维护者通常 1 天内回复