[Synthetics] Add warning if TLS config not set for Synthetics (#195395)

## Summary

Recently while debugging a production issue where the Synthetics plugin
was receiving 401 errors while trying to reach the Synthetics Service
health endpoint, we isolated that there was an issue with the mTLS
handshake between Kibana and the service.

Unfortunately, we were unsure if there was some missing custom config
(especially relevant in Serverless Kibana), or if the certificate values
were not present in the first place.

Adding this warning will help us make this determination better in the
future when reviewing Kibana logs, as we will be assured if the config
is not defined via this warning.
This commit is contained in:
Justin Kambic 2024-10-09 13:27:49 -04:00 committed by GitHub
parent 3f75a1d3d5
commit 8e986a6dd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -143,6 +143,10 @@ export class ServiceAPIClient {
cert: tlsConfig.certificate,
key: tlsConfig.key,
});
} else if (!this.server.isDev) {
this.logger.warn(
'TLS certificate and key are not provided. Falling back to default HTTPS agent.'
);
}
return baseHttpsAgent;