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分
- マージ済み PR(30日)
- 13
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/ApplicationInsights-Java のほかの issue
-
Java 25 native-access warning from bundled Netty requires broad ALL-UNNAMED permission対応中かも @rajkumar-rangaraj が 17 日前に担当しました。 オープン
microsoft/ApplicationInsights-Java#4851 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
microsoft/ApplicationInsights-Java#4770 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
microsoft/ApplicationInsights-Java#4769 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoft/ApplicationInsights-Java#4729 · コメント 131 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
microsoft/ApplicationInsights-Java#4712 ·
メンテナーはふだん 1 日以内に返信
microsoft/ApplicationInsights-Java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
MaikuB/flutter_appauth#683 ·
-
type: possible bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
grimmory-tools/grimmory#2850 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信