mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
* Add axios to telemetry_analytics in place of . * Remove axios in favor of fetch.
This commit is contained in:
parent
37caa6746e
commit
6a13a97375
1 changed files with 8 additions and 2 deletions
|
@ -47,14 +47,20 @@ interface AnalyicsReporterConfig {
|
|||
}
|
||||
|
||||
export function createAnalyticsReporter(config: AnalyicsReporterConfig) {
|
||||
const { localStorage, basePath, $http, debug } = config;
|
||||
const { localStorage, basePath, debug } = config;
|
||||
|
||||
return createReporter({
|
||||
debug,
|
||||
storage: localStorage,
|
||||
async http(report) {
|
||||
const url = `${basePath}/api/telemetry/report`;
|
||||
await $http.post(url, { report });
|
||||
await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'kbn-xsrf': 'true',
|
||||
},
|
||||
body: JSON.stringify({ report }),
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue