grafana / grafana/pyroscope-java

Be able to set an agent log format with a configuration option

オープン
#147 コメント 1 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Java
スター
125
フォーク
48
平均マージ
4日 14時間
マージ済み PR(30日)
5

説明

Our scenario

Hello. We are using docker as the underlying technology to deploy apps and the observability stack. For all the logs we decide to use JSON format that is sent to our Loki backend.
We are trying to adopt the pyroscope Java Otel extension (that implicitly has the Java Agent) to send profiling data to our Pyroscope server.

The issue

During our testing, when we are sending the Pyroscope backend server down, all Java apps using the extension are producing lot of logs that don't align with the rest of echosystem. In our case is JSON.
This is the kind of output we are getting from the agent logger in the docker console:

2024-03-21 11:37:15.292 [ERROR] Error uploading snapshot: 502 <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>

Currently the agent only has this log parameter PYROSCOPE_LOG_LEVEL which is not enough for this case.

Possible solutions
  • As discussed in this thread a custom logger interface implementation can be done:

https://github.com/grafana/pyroscope-java/blob/f73ebfaae1fcdfdf61d3418a78807c5b2b0[…]/agent/src/main/java/io/pyroscope/javaagent/PyroscopeAgent.java
https://github.com/grafana/pyroscope-java/blob/82b1daba0dc05b1851e6b96f2d760ab7901[…]0c49/agent/src/main/java/io/pyroscope/javaagent/api/Logger.java

However, that would require initializing the profiler outside the otel extension, and this is not available when it's running as a javagent.

  • Add a flag PYROSCOPE_LOG_FORMAT to set the logger format. it could be JSON or LOGFTM to align with rest of Grafana stack.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Issue でリンクされているエントリーポイントである agent/src/main/java/io/pyroscope/javaagent/PyroscopeAgent.java と agent/src/main/java/io/pyroscope/javaagent/api/Logger.java から始めます。agent logger がどのように初期化されるかを追跡し、既存の PYROSCOPE_LOG_LEVEL 設定を確認します。完了条件は、agent が要求された log-format オプションを公開し、出力に選択された形式を使用し、サポートされている形式をカバーすることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
observability
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。