Skip to content

Commit

Permalink
adjust uptime server plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiqueclarke committed Jul 14, 2021
1 parent 1cf9f33 commit ee2468b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion x-pack/plugins/uptime/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class Plugin implements PluginType {

const ready = once(async () => {
const componentTemplateName = ruleDataService.getFullAssetName('synthetics-mappings');
const alertsIndexPattern = ruleDataService.getFullAssetName('observability.synthetics*');

if (!ruleDataService.isWriteEnabled()) {
return;
Expand All @@ -57,13 +58,15 @@ export class Plugin implements PluginType {
await ruleDataService.createOrUpdateIndexTemplate({
name: ruleDataService.getFullAssetName('synthetics-index-template'),
body: {
index_patterns: [ruleDataService.getFullAssetName('observability.synthetics*')],
index_patterns: [alertsIndexPattern],
composed_of: [
ruleDataService.getFullAssetName(TECHNICAL_COMPONENT_TEMPLATE_NAME),
componentTemplateName,
],
},
});

await ruleDataService.updateIndexMappingsMatchingPattern(alertsIndexPattern);
});

// initialize eagerly
Expand Down

0 comments on commit ee2468b

Please sign in to comment.