Skip to content

Commit c14a1fb

Browse files
committed
Create apm static index pattern on ux page visit
1 parent 8fa93bc commit c14a1fb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

x-pack/plugins/apm/public/application/csmApp.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { ConfigSchema } from '../index';
2828
import { ApmPluginSetupDeps, ApmPluginStartDeps } from '../plugin';
2929
import { createCallApmApi } from '../services/rest/createCallApmApi';
3030
import { px, units } from '../style/variables';
31+
import { createStaticIndexPattern } from '../services/rest/index_pattern';
3132

3233
const CsmMainContainer = styled.div`
3334
padding: ${px(units.plus)};
@@ -114,6 +115,12 @@ export const renderApp = (
114115
) => {
115116
createCallApmApi(core.http);
116117

118+
// Automatically creates static index pattern and stores as saved object
119+
createStaticIndexPattern().catch((e) => {
120+
// eslint-disable-next-line no-console
121+
console.log('Error creating static index pattern', e);
122+
});
123+
117124
ReactDOM.render(
118125
<CsmAppRoot
119126
core={core}

0 commit comments

Comments
 (0)