mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Uptime] [Synthetics Service] adds Kibana version to service call for synthetics (#123434)
* uptime - adds kibana version to service call for synthetics * add kibana version to uptime server context
This commit is contained in:
parent
52e613a48e
commit
624a50abd7
4 changed files with 7 additions and 3 deletions
|
@ -50,6 +50,7 @@ export interface UptimeServerSetup {
|
|||
authSavedObjectsClient?: SavedObjectsClientContract;
|
||||
encryptedSavedObjects: EncryptedSavedObjectsPluginStart;
|
||||
syntheticsService: SyntheticsService;
|
||||
kibanaVersion: string;
|
||||
}
|
||||
|
||||
export interface UptimeCorePluginsSetup {
|
||||
|
|
|
@ -34,12 +34,14 @@ export class ServiceAPIClient {
|
|||
private locations: ServiceLocations;
|
||||
private logger: Logger;
|
||||
private readonly config: ServiceConfig;
|
||||
private readonly kibanaVersion: string;
|
||||
|
||||
constructor(logger: Logger, config: ServiceConfig) {
|
||||
constructor(logger: Logger, config: ServiceConfig, kibanaVersion: string) {
|
||||
this.config = config;
|
||||
const { username, password, manifestUrl, devUrl } = config;
|
||||
this.username = username;
|
||||
this.devUrl = devUrl;
|
||||
this.kibanaVersion = kibanaVersion;
|
||||
|
||||
if (username && password) {
|
||||
this.authorization = 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64');
|
||||
|
@ -102,7 +104,7 @@ export class ServiceAPIClient {
|
|||
return axios({
|
||||
method,
|
||||
url: (this.devUrl ?? url) + (runOnce ? '/run' : '/monitors'),
|
||||
data: { monitors: monitorsStreams, output },
|
||||
data: { monitors: monitorsStreams, output, stack_version: this.kibanaVersion },
|
||||
headers: this.authorization
|
||||
? {
|
||||
Authorization: this.authorization,
|
||||
|
|
|
@ -50,7 +50,7 @@ export class SyntheticsService {
|
|||
this.server = server;
|
||||
this.config = config;
|
||||
|
||||
this.apiClient = new ServiceAPIClient(logger, this.config);
|
||||
this.apiClient = new ServiceAPIClient(logger, this.config, this.server.kibanaVersion);
|
||||
|
||||
this.esHosts = getEsHosts({ config: this.config, cloud: server.cloud });
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@ export class Plugin implements PluginType {
|
|||
config,
|
||||
router: core.http.createRouter(),
|
||||
cloud: plugins.cloud,
|
||||
kibanaVersion: this.initContext.env.packageInfo.version,
|
||||
} as UptimeServerSetup;
|
||||
|
||||
if (this.server?.config?.service?.enabled) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue