attach
Connect to a running JVM by PID or inside a Docker container to record CPU, JDBC, HTTP, and other performance data until you stop recording or capture allocation data.
Instructions
Attach to a running JVM by PID or to a JVM inside a Docker container. Records performance data for the following subsystems: cpu, jdbc, jpa, mongo_db, cassandra, http_server, http_client, ws, jndi, jms, kafka_consumer, rmi, grpc, ai, process until check_status is called with 'stopRecording: true', or allocation data when "recordingConfig": {"recordAllocations": true} is passed. Pass "recordingConfig": {"recordMonitors": true} to additionally record monitor and lock events. You can use list_jvms to discover JVMs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | No | The PID of a local JVM process, or the container PID (NSpid) of a JVM inside the specified container. If a container is specified and this is omitted, the topmost JVM in the container is used. | |
| recordingConfig | No | What to record in this session. Every key is optional and omitted keys keep their defaults - set only the keys this analysis needs, such as recordMonitors for lock contention analysis, recordAllocations for allocation sites, triggers for automatic captures during the recording, or advanced.methodCallRecordingType instrumentation when invocation counts are needed. | |
| containerNameOrId | No | The name or ID of a Docker container. When specified, profiling attaches to a JVM inside this container. |