Skip to content

Commit

Permalink
Add heap snapshot flag to serverless Dockerfile (#168099)
Browse files Browse the repository at this point in the history
## Summary

Adds the `--heapsnapshot-signal` to the `node.options` file in Kibana
serverless docker builds so that we can capture heapsnapshots.

So our `node.options` for serverless builds will look like:

```
kibana@docker-desktop:~$ cat config/node.options
## Node command line options
## See `node --help` and `node --v8-options` for available options
## Please note you should specify one option per line

## max size of old space in megabytes
#--max-old-space-size=4096

## do not terminate process on unhandled promise rejection
 --unhandled-rejections=warn

## restore < Node 16 default DNS lookup behavior
--dns-result-order=ipv4first

## enable OpenSSL 3 legacy provider
#--openssl-legacy-provider

👉🏻--heapsnapshot-signal=SIGUSR2👈🏻
```
  • Loading branch information
jloleysens authored Oct 16, 2023
1 parent 0ede530 commit dcc3f86
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ COPY --chown=1000:0 config/serverless.yml /usr/share/kibana/config/serverless.ym
COPY --chown=1000:0 config/serverless.es.yml /usr/share/kibana/config/serverless.es.yml
COPY --chown=1000:0 config/serverless.oblt.yml /usr/share/kibana/config/serverless.oblt.yml
COPY --chown=1000:0 config/serverless.security.yml /usr/share/kibana/config/serverless.security.yml
# Supportability enhancement: enable capturing heap snapshots. See https://nodejs.org/api/cli.html#--heapsnapshot-signalsignal
RUN echo '\n--heapsnapshot-signal=SIGUSR2' >> config/node.options
{{/serverless}}
{{^opensslLegacyProvider}}
RUN sed 's/\(--openssl-legacy-provider\)/#\1/' -i config/node.options
Expand Down

0 comments on commit dcc3f86

Please sign in to comment.