Add heap snapshot flag to serverless Dockerfile (#168099)

## 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👈🏻
```
This commit is contained in:
Jean-Louis Leysens 2023-10-16 10:02:05 +02:00 committed by GitHub
parent 0ede530ae3
commit dcc3f86c41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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