Skip to content

Commit

Permalink
CloudMonitoring: Correctly set title and text fields for annotations (#…
Browse files Browse the repository at this point in the history
…71888)

Correctly set title and text fields
  • Loading branch information
aangelisc authored and linoman committed Jul 24, 2023
1 parent ce5a560 commit f3ab583
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/tsdb/cloud-monitoring/annotation_query.go
Expand Up @@ -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
Expand Down

0 comments on commit f3ab583

Please sign in to comment.