Make error logs without an underlying exception visible in Traces in AI
メンテナーはふだん 2 日以内に返信
@trask がすでに取り組んでいます。
2022年7月20日 から。
評価
この issue はまだ評価されていません。
説明
Is your feature request related to a problem? Please describe.
Currently the java agent will split log.error calls (using logback and Spring Boot default) between Exceptions and Traces in AI panel, based on whether there was an "Exception" parameter or not passed to the log.error call.
That is extremely unintuitive and makes developers build dashboards/monitoring that do not show real problems.
We've just found out all microservices had errors in monitoring due to that split.
When developers call log.error, if they have an exception from underlying code they will of course pass it to the log.error, so that there is more context visible (call stack etc.). However when there is no underlying exception, developers with experience in JVM or Functional Programming tend NOT to create an exception (because it's expansive on performance, because the stack doesn't have to be gathered, because for FP the situation is better modeled with a returned type), but just log.error. After all, log.error is for logging errors, no matter the source.
On the AI dashboard, a developer enters a query to see all the errors like so
traces
| where cloud_RoleName == "name of the microservice"
| where severityLevel > 2
| order by timestamp desc
and sees warns and errors. And indeed, some errors are visible there. All the developers we have, expected that "severityLevel > 2" gives them all the errors, and neither expected that errors reported with an underlying stack trace are not visible there.
We can get around that with an union in the query, like so
traces
| union exceptions
| where cloud_RoleName == "name of the microservice"
| where severityLevel > 2
| order by timestamp desc
but fields of traces and exceptions do not overlap, so if you are looking for a message (as in the log.error(message)) it will be either in the "message" field, or the "outerMessage" field, depending on whether it's a trace or an exception logged via log.error(exception).
Describe the solution you would like
-
Everything logged on error severity should be available in traces. In a perfect scenario, the additional fields (stack trace, etc) would be visible in customDimensions.
-
If the call to log was without a message, as in
log.error(exception)
the exception message should be available in the "message" field of the trace
Describe alternatives you have considered
Since our devs use functional programming in Kotlin/Java/Groovy, they do not throw exceptions when they detect an error, but model it with returned types and monitor with log.error calls (without an exception).
The only solution we found is to add "| union exceptions" to every dashboard, but it makes the number of columns in the grid too large, and requires complicating the dashboard query even more. Simple things should be simple, and this workaround is unnecessarly complex.
Additional context
Tested on Spring Boot (all versions) with AI agent 3.x, default logback configuration, calls via SLF4J.
- 主要言語
- Java
- スター
- 327
- フォーク
- 222
- 平均マージ
- 22時間 34分
- マージ済み PR(30日)
- 14
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/ApplicationInsights-Java のほかの issue
-
Java 25 native-access warning from bundled Netty requires broad ALL-UNNAMED permission対応中かも @rajkumar-rangaraj が 9 日前に担当しました。 オープン
microsoft/ApplicationInsights-Java#4851 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
microsoft/ApplicationInsights-Java#4817 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
microsoft/ApplicationInsights-Java#4770 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
microsoft/ApplicationInsights-Java#4769 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoft/ApplicationInsights-Java#4729 · コメント 124 件 ·
メンテナーはふだん 2 日以内に返信
microsoft/ApplicationInsights-Java の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
ci-failure-cause test-failure
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
nextcloud/notes-android#3367 ·
メンテナーはふだん 1 日以内に返信
-
:wave: team-triage a:chore in:isolated-projects in:kotlin-dsl
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信