Document how to create new subsegments inside a ThreadPoolExecutor thread
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- aws, python
調査の方向性
Issue にリンクされているスレッド処理のドキュメントから始め、set_trace_entity の後にある capture と in_segment のエントリーポイントを確認してください。ワーカースレッドでサブセグメントを作成するためにサポートされているパターンを、クリーンアップも含めて明確にし、読者が有効なアプローチを区別できるように例を更新してください。
索引モデルが issue の本文から書いたものです。
説明
The current documentation shows how to set the parent thread's X-ray entity in the worker thread:
def load_url(url, trace_entity):
# Set the parent X-Ray entity for the worker thread.
xray_recorder.set_trace_entity(trace_entity)
# Subsegment captured from the following HTTP GET will be
# a child of parent entity passed from the main thread.
resp = requests.get(url)
# prevent thread pollution
xray_recorder.clear_trace_entities()
return resp
However it's not clear how this interacts with capture/in_segment. For example, I assume this isn't correct, as the capture starts before we call set_trace_entity:
@xray_recorder.capture('subsegment_name')
def load_url(url, trace_entity):
# Set the parent X-Ray entity for the worker thread.
xray_recorder.set_trace_entity(trace_entity)
# Subsegment captured from the following HTTP GET will be
# a child of parent entity passed from the main thread.
resp = requests.get(url)
# prevent thread pollution
xray_recorder.clear_trace_entities()
return resp
However, are these two OK?
def load_url(url, trace_entity):
# Set the parent X-Ray entity for the worker thread.
xray_recorder.set_trace_entity(trace_entity)
with xray_recorder.capture('subsegment_name'):
# Subsegment captured from the following HTTP GET will be
# a child of parent entity passed from the main thread.
resp = requests.get(url)
# prevent thread pollution
xray_recorder.clear_trace_entities()
return resp
def load_url(url, trace_entity):
# Set the parent X-Ray entity for the worker thread.
xray_recorder.set_trace_entity(trace_entity)
with xray_recorder.in_segment('segment_name') as segment:
segment.put_metadata('key', dict, 'namespace')
# Subsegment captured from the following HTTP GET will be
# a child of parent entity passed from the main thread.
resp = requests.get(url)
# prevent thread pollution
xray_recorder.clear_trace_entities()
return resp
It would be great if the docs on threading had a more complete example.
- 主要言語
- Python
- スター
- 339
- フォーク
- 148
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aws/aws-xray-sdk-python のほかの issue
-
psycopg connection context manager drops X-Ray tracing wrapper, so cursor execute calls are not traced対応中かも @reginaldalfret が 18 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
aws/aws-xray-sdk-python#490 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
aws/aws-xray-sdk-python#460 ·
-
Next releaseオープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
aws/aws-xray-sdk-python#457 · リアクション 1 件 ·
-
mysql-connector 9.2.0 - TypeError: 'MySQLConnection' object is not iterable対応中かも @reginaldalfret が 18 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
aws/aws-xray-sdk-python#453 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
aws/aws-xray-sdk-python#452 · リアクション 1 件 ·
aws/aws-xray-sdk-python の issue をすべて見る
似ている issue
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/semantic-kernel#14590 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
pinterest/pymemcache#662 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 62/100
gnocchixyz/gnocchi#1527 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
tenstorrent/tt-model-manager#181 ·
メンテナーはふだん 1 日以内に返信