03.pprof_goroutine_label

command
v0.5.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

runtime/pprof のラベルが Go 1.27 では goroutine のトレースバックにも 表示されることを確認するサンプルです。

pprof.Do の動的スコープ内で実行される goroutine のスタック表示へ、pprof ラベルが反映されるようになりました。

pprof.Do で ID ラベルを付与した goroutine 内から runtime.Stack を実行し、 スタックトレースの先頭に {id: "..."} が出力されることを確認します。 これにより、障害調査時に goroutine をリクエスト ID やジョブ ID などの 処理コンテキストと対応付けやすくなります。

REFERENCES

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL