How to get KCL NodeJs Thread dump

  amazon-kcl, amazon-kinesis, docker, java, node.js

I have a NodeJs app that consumes kinesis stream data using KCL for NodeJs.
This app is run as a docker container in AWS ECS. The log driver is configured to cloudwatch logs.

I want a way to get the thread dump for this app.

This is how I start the consumer app

const child = spawn("../bin/kcl-bootstrap --java /usr/local/openjdk-8/bin/java --log-configuration ./properties/logback.xml -e -p ./properties/kcl.properties", {
    shell: true,
    cwd: './src/amazon-kinesis-client-nodejs/consumer'
  });

 child.stdout.on('data', function(data) {
      Logger.instance().info("data: " + data);
  })

 child.on('exit', function (code, signal) {
      Logger.instance().info('child process exited with ' +
                  `code ${code} and signal ${signal}`);
  });

I cannot figure out a way to get a thread dump for this?

I tried killing the docker container using below method. Did not work. It did not save any log files .

https://medium.com/@subhasisray/java-thread-dump-alpine-docker-container-5e7c50eeacd4

Source: Docker Questions

LEAVE A COMMENT