mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 16:45:43 -06:00
CloudMonitoring: Correctly set title and text fields for annotations (#71888)
Correctly set title and text fields
This commit is contained in:
parent
8c86a46440
commit
c4d6509145
@ -26,19 +26,19 @@ func (s *Service) executeAnnotationQuery(ctx context.Context, req *backend.Query
|
||||
return resp, err
|
||||
}
|
||||
|
||||
mq := struct {
|
||||
MetricQuery struct {
|
||||
tslq := struct {
|
||||
TimeSeriesList struct {
|
||||
Title string `json:"title"`
|
||||
Text string `json:"text"`
|
||||
} `json:"metricQuery"`
|
||||
} `json:"timeSeriesList"`
|
||||
}{}
|
||||
|
||||
firstQuery := req.Queries[0]
|
||||
err = json.Unmarshal(firstQuery.JSON, &mq)
|
||||
err = json.Unmarshal(firstQuery.JSON, &tslq)
|
||||
if err != nil {
|
||||
return resp, nil
|
||||
}
|
||||
err = parseToAnnotations(req.Queries[0].RefID, queryRes, dr, mq.MetricQuery.Title, mq.MetricQuery.Text)
|
||||
err = parseToAnnotations(req.Queries[0].RefID, queryRes, dr, tslq.TimeSeriesList.Title, tslq.TimeSeriesList.Text)
|
||||
resp.Responses[firstQuery.RefID] = *queryRes
|
||||
|
||||
return resp, err
|
||||
|
Loading…
Reference in New Issue
Block a user