grafana / grafana/pyroscope-java
Propagating Pyroscope labels to async worker threads in Java
- 主要言語
- Java
- スター
- 125
- フォーク
- 48
- 平均マージ
- 4日 14時間
- マージ済み PR(30日)
- 5
説明
Hello,
I'm using the Pyroscope Java profiling agent to profile a Java application which does a lot of async tasks. I have a method like this:
```java
public CompletableFuture method() {
return Pyroscope.LabelsWrapper.run(new LabelsSet(key, value), () -> doStuff());
}
```
The issue is that `doStuff()` triggers async operations executed on different worker threads. The labels set via LabelsWrapper.run() don't propagate to these worker threads, so the async work isn't profiled with the correct labels.
Is there a recommended way to handle this without adding significant verbosity to the existing code? I'm hoping to avoid manually wrapping every async call.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
まず、Java agent における LabelsWrapper の動作と、doStuff() によってトリガーされた非同期処理がどのように他のスレッドへ処理を移すかを確認します。各非同期呼び出しを手動でラップせずにラベルの伝播をサポートできるかを判断します。完了の条件は、ワーカースレッドのプロファイリングで、元の操作のラベルが保持されることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- observability-sre
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100