-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into vis_editors_gauge-custom_color
- Loading branch information
Showing
259 changed files
with
4,308 additions
and
75,868 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_kibana_client.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import fetch from 'node-fetch'; | ||
import { Logger } from '../../utils/create_logger'; | ||
|
||
export class ApmSynthtraceKibanaClient { | ||
constructor(private readonly logger: Logger) {} | ||
|
||
async migrateCloudToManagedApm(cloudId: string, username: string, password: string) { | ||
await this.logger.perf('migrate_apm_on_cloud', async () => { | ||
this.logger.info('attempting to migrate cloud instance over to managed APM'); | ||
const cloudUrls = Buffer.from(cloudId.split(':')[1], 'base64').toString().split('$'); | ||
const kibanaCloudUrl = `https://${cloudUrls[2]}.${cloudUrls[0]}`; | ||
const response = await fetch( | ||
kibanaCloudUrl + '/internal/apm/fleet/cloud_apm_package_policy', | ||
{ | ||
method: 'POST', // *GET, POST, PUT, DELETE, etc. | ||
headers: { | ||
Authorization: 'Basic ' + Buffer.from(username + ':' + password).toString('base64'), | ||
Accept: 'application/json', | ||
'Content-Type': 'application/json', | ||
'kbn-xsrf': 'kibana', | ||
}, | ||
} | ||
); | ||
const responseJson = await response.json(); | ||
if (responseJson.message) { | ||
this.logger.info(`Cloud Instance already migrated to managed APM: ${responseJson.message}`); | ||
} | ||
if (responseJson.cloudApmPackagePolicy) { | ||
this.logger.info( | ||
`Cloud Instance migrated to managed APM: ${responseJson.cloudApmPackagePolicy.package.version}` | ||
); | ||
} | ||
}); | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
packages/elastic-apm-synthtrace/src/lib/apm/defaults/get_observer_defaults.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.