Debugging Kibana plugin server-side

Added NODE_OPTIONS="--debug-brk --inspect' and started kibana using npm start from my plugin source dir. After launching chrome://inspect, I can see Kibana server code listed in sources but not my plugin source code. How can I attach my plugin source to debugger?

Are you seeing in the Kibana console that optimization completed? Does the list of plugins that were optimized include your plugin?

I've previously attempted to do what you're trying, but I have always given up because the optimization process takes too long to be able to work this way. I usually just use console.log to debug my plugin in server-side code.

It worked for me with NODE_OPTIONS='--inspect --debug'. Following is the ouput when I run npm start. Lazy Optimization completed and my plugin code got listed in chrome://inspect and I was able to add break points to my plugin source. The last chrome-devtools url on port 5860 worked for me. I using Kibana 5.6.1.

Debugger listening on port 9229.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/afab0912-855c-402d-9799-f025b1add093
 watching for changes  (421 files)
  log   [01:22:43.616] [info][listening] basePath Proxy running at https://0.0.0.0:5601/abx
Debugger listening on port 5859.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5859/2120ca31-11b0-4143-89d2-acd909084a83
Debugger listening on port 5860.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5860/c30dbdb4-aa1d-4067-af56-d95c6ec70fdc
optmzr    log   [01:22:49.011] [info][status][ui settings] Status changed from uninitialized to disabled - uiSettings.enabled config is set to `false`
server    log   [01:22:50.788] [info][optimize] Waiting for optimizer completion
optmzr    log   [01:22:50.895] [info][optimize] Lazy optimization of bundles for logtrail, kibana, stateSessionStorageRedirect, timelion, sense-tests and status_page ready
optmzr    log   [01:22:50.914] [info] Plugin initialization disabled.
server    log   [01:22:50.986] [info][status][plugin:kibana@5.6.1] Status changed from uninitialized to green - Ready
server    log   [01:22:51.155] [info][status][plugin:elasticsearch@5.6.1] Status changed from uninitialized to yellow - Waiting for Elasticsearch
server    log   [01:22:51.222] [info][status][plugin:logtrail@0.1.21] Status changed from uninitialized to green - Ready
server    log   [01:22:51.257] [info][status][plugin:console@5.6.1] Status changed from uninitialized to green - Ready
server    log   [01:22:51.313] [info][status][plugin:metrics@5.6.1] Status changed from uninitialized to green - Ready
optmzr    log   [01:22:52.868] [info][optimize] Lazy optimization started
server    log   [01:22:55.231] [info][status] Loaded 773 source patterns from ES ...
server    log   [01:22:55.238] [error][status][plugin:elasticsearch@5.6.1] Status changed from yellow to red - Request Timeout after 3000ms
server    log   [01:22:55.240] [info][status][plugin:timelion@5.6.1] Status changed from uninitialized to green - Ready
server    log   [01:22:55.246] [info][listening] Server running at https://0.0.0.0:5603
server    log   [01:22:55.249] [error][status][ui settings] Status changed from uninitialized to red - Elasticsearch plugin is red
server    log   [01:22:57.783] [warning] You're running Kibana 5.6.1 with some different versions of Elasticsearch. Update Kibana or Elasticsearch to the same version to prevent compatibility issues: v5.6.0 @ 127.0.0.1:9200 (127.0.0.1)
server    log   [01:22:58.138] [info][status][plugin:elasticsearch@5.6.1] Status changed from red to green - Kibana index ready
server    log   [01:22:58.140] [info][status][ui settings] Status changed from red to green - Ready
Debugger attached.
optmzr    log   [01:24:00.354] [info][optimize] Lazy optimization success in 67.38 seconds
optmzr    log   [01:24:04.437] [info][optimize] Lazy optimization started
optmzr    log   [01:24:06.481] [info][optimize] Lazy optimization success in 2.04 seconds

Good to know! So maybe using --debug-brk does something that makes it not work as well compared to --debug

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.