Commit 5da0a22
authored
RPC: continuous profiling for Python/JS/Go subprocesses (#7558)
Each language's RPC server now starts the Pyroscope SDK when
PYROSCOPE_SERVER_ADDRESS is set in the environment, with PYROSCOPE_TAGS
forwarded verbatim and a runtime=python/node/go tag added so flame
graphs in a shared `modcli` Pyroscope application can be sliced by
which subprocess produced them. Env vars propagate from the parent JVM
via ProcessBuilder.environment() inheritance, so the saas-side
CliProcessEnvContributor that already drives the JVM agent transparently
reaches all four runtimes once these inits land.
Python: pyroscope-io is a new optional dep ([profiling] extra) so local
dev and CI without the package don't break — _init_pyroscope() warns
and no-ops on ImportError.
JS: @pyroscope/nodejs is a new optionalDependency so npm install
doesn't fail when the binding's native components aren't available;
initPyroscope() catches the require and warns.
Go: github.com/grafana/pyroscope-go is a regular dep (Go has no optional
deps; the SDK is small and pure-Go via stdlib pprof). initPyroscope()
short-circuits on missing env so non-profiled deployments pay only one
os.Getenv at startup.
C# requires no rewrite-side change: CoreCLR loads the Pyroscope native
profiler purely from CORECLR_ENABLE_PROFILING / CORECLR_PROFILER /
CORECLR_PROFILER_PATH env vars, which the same saas-side contributor
sets alongside PYROSCOPE_*.1 parent bbe3b20 commit 5da0a22
8 files changed
Lines changed: 284 additions & 1 deletion
File tree
- rewrite-go
- cmd/rpc
- rewrite-javascript/rewrite
- src/rpc
- rewrite-python/rewrite
- src/rewrite/rpc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
260 | 287 | | |
| 288 | + | |
261 | 289 | | |
262 | 290 | | |
263 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
34 | 61 | | |
35 | 62 | | |
36 | 63 | | |
| |||
97 | 124 | | |
98 | 125 | | |
99 | 126 | | |
| 127 | + | |
| 128 | + | |
100 | 129 | | |
101 | 130 | | |
102 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
0 commit comments