@Override
    public void start() throws ModuleStartException {
        MetricsCreator metricCreator = getManager().find(TelemetryModule.NAME)
                                                   .provider()
                                                   .getService(MetricsCreator.class);
        HealthCheckMetrics healthChecker = metricCreator.createHealthCheckerGauge(
            "storage_elasticsearch", MetricsTag.EMPTY_KEY, MetricsTag.EMPTY_VALUE);
        elasticSearchClient.registerChecker(healthChecker);
        try {
            elasticSearchClient.connect();

            final ConfigService service = getManager().find(CoreModule.NAME).provider().getService(ConfigService.class);
            // Add 5s to make sure OAP has at least done persistent once.
            // By default, the persistent period is 25 seconds and ElasticSearch refreshes in every 30 seconds.
            modelInstaller.setIndexRefreshInterval(service.getPersistentPeriod() + 5);
            modelInstaller.start();

            getManager().find(CoreModule.NAME)
                        .provider()
                        .getService(ModelCreator.class)
                        .addModelListener(modelInstaller);
        } catch (Exception e) {
            throw new ModuleStartException(e.getMessage(), e);
        }
    }
The storage provider for ElasticSearch 6/7 and OpenSearch 1.x.
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchProvider.java