ElasticSearch: Neaten up vars/consts (#91989)

ElasticSearch: neaten up vars/consts
This commit is contained in:
Isabella Siu
2024-08-16 09:42:39 -04:00
committed by GitHub
parent a12b372556
commit 6000d6a1ad
5 changed files with 65 additions and 66 deletions

View File

@@ -46,6 +46,7 @@ const (
)
var searchWordsRegex = regexp.MustCompile(regexp.QuoteMeta(es.HighlightPreTagsString) + `(.*?)` + regexp.QuoteMeta(es.HighlightPostTagsString))
var aliasPatternRegex = regexp.MustCompile(`\{\{([\s\S]+?)\}\}`)
func parseResponse(ctx context.Context, responses []*es.SearchResponse, targets []*Query, configuredFields es.ConfiguredFields, keepLabelsInResponse bool, logger log.Logger) (*backend.QueryDataResponse, error) {
result := backend.QueryDataResponse{
@@ -923,8 +924,6 @@ func nameFields(queryResult backend.DataResponse, target *Query, keepLabelsInRes
}
}
var aliasPatternRegex = regexp.MustCompile(`\{\{([\s\S]+?)\}\}`)
func getFieldName(dataField data.Field, target *Query, metricTypeCount int) string {
metricType := dataField.Labels["metric"]
metricName := getMetricName(metricType)