syahra712 opened a new issue, #138:
URL: https://github.com/apache/solr-orbit/issues/138

   `docs/reference/telemetry.md` says `jfr`, `gc`, `jit` and `heapdump` work on 
the `docker` and `from-distribution` pipelines (e.g. `solr-orbit run --pipeline 
docker ... --telemetry gc,jfr`). On current `main` none of them reach the Solr 
JVM:
   
   - `SolrProvisioner` and `SolrDockerLauncher` both accept `telemetry_devices` 
and append each device's `instrument_java_opts()` to `SOLR_OPTS` 
(`solrorbit/builder/solr_provisioner.py`, the `jvm_extra` loops).
   - The pipelines in `solrorbit/test_run_orchestrator.py` 
(`solr_from_sources`, `solr_from_distribution`, `solr_docker`) never pass 
`telemetry_devices`, so the list is always empty. Nothing else builds 
`FlightRecorder`, `Gc` or `JitCompiler` from `cfg.opts("telemetry", "devices")`.
   
   So `--telemetry gc,jfr` is accepted, but no flags are added and no `gc.log` 
/ `profile.jfr` is written. I noticed this while going through the telemetry 
gaps listed in #5 (the other two are #134 and #136).
   
   Wiring the devices through is not quite enough for the Docker pipeline, 
though:
   
   1. **Docker log paths.** `SolrDockerLauncher.start` runs the container 
without any `-v` mounts. With the devices wired, 
`-Xlog:...:file=<log_root>/gc.log` and the JFR `filename=` would point inside 
the container and be lost at `docker rm -f`. One option is to bind-mount the 
log directory at the same path when a JVM device is enabled. The container's 
`solr` user (uid 8983) has to be able to write there.
   2. **heapdump.** `Heapdump` dumps in `detach_from_node(node, running)` and 
needs a node PID. The provisioner/launcher has no node objects and never calls 
that hook, so heapdump needs its own stop-time hook (e.g. `docker exec 
<container> jmap ...` / `jmap <pid>` before `stop()`).
   
   A possible split:
   - (a) Build the enabled JVM devices (`jfr`, `gc`, `jit`) from the telemetry 
config in one helper in `test_run_orchestrator.py`, pass them to 
`SolrProvisioner` / `SolrDockerLauncher`, and add the bind mount for Docker. 
Unit tests would check the constructed devices and the resulting `SOLR_OPTS` / 
`docker run` flags.
   - (b) heapdump on stop, as a follow-up.
   
   I'm happy to send a PR for (a) if this direction works for you. In 
particular: is a bind mount of the log dir acceptable for the Docker pipeline, 
or would you rather the files stay inside the container and get copied out with 
`docker cp` before teardown?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to