private String getMetricNamesFromES ( final String tenant , final String regexMetricName ) throws IOException { String metricNamesFromElasticsearchQueryString = String . format ( queryToFetchMetricNamesFromElasticsearchFormat , tenant , regexMetricName , regexMetricName ) ; return elasticsearchRestHelper . fetchDocuments ( ELASTICSEARCH_INDEX_NAME_READ , ELASTICSEARCH_DOCUMENT_TYPE , tenant , metricNamesFromElasticsearchQueryString ) ; }
Performs terms aggregation by metric_name which returns doc_count by metric_name index that matches the given regex .