"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/tsdb/azuremonitor/azure-resource-graph-datasource.go" between
grafana-8.0.0.tar.gz and grafana-8.0.1.tar.gz

About: Grafana is a visualization tool for monitoring, metric analytics and dashboards for Graphite, InfluxDB, Prometheus and many more.

azure-resource-graph-datasource.go  (grafana-8.0.0):azure-resource-graph-datasource.go  (grafana-8.0.1)
skipping to change at line 45 skipping to change at line 45
// AzureResourceGraphQuery is the query request that is built from the saved val ues for // AzureResourceGraphQuery is the query request that is built from the saved val ues for
// from the UI // from the UI
type AzureResourceGraphQuery struct { type AzureResourceGraphQuery struct {
RefID string RefID string
ResultFormat string ResultFormat string
URL string URL string
Model *simplejson.Json Model *simplejson.Json
InterpolatedQuery string InterpolatedQuery string
} }
const argAPIVersion = "2018-09-01-preview" const argAPIVersion = "2021-03-01"
const argQueryProviderName = "/providers/Microsoft.ResourceGraph/resources" const argQueryProviderName = "/providers/Microsoft.ResourceGraph/resources"
// executeTimeSeriesQuery does the following: // executeTimeSeriesQuery does the following:
// 1. builds the AzureMonitor url and querystring for each query // 1. builds the AzureMonitor url and querystring for each query
// 2. executes each query by calling the Azure Monitor API // 2. executes each query by calling the Azure Monitor API
// 3. parses the responses for each query into the timeseries format // 3. parses the responses for each query into the timeseries format
func (e *AzureResourceGraphDatasource) executeTimeSeriesQuery(ctx context.Contex t, originalQueries []plugins.DataSubQuery, func (e *AzureResourceGraphDatasource) executeTimeSeriesQuery(ctx context.Contex t, originalQueries []plugins.DataSubQuery,
timeRange plugins.DataTimeRange) (backend.QueryDataResponse, error) { timeRange plugins.DataTimeRange) (backend.QueryDataResponse, error) {
result := backend.QueryDataResponse{ result := backend.QueryDataResponse{
Responses: map[string]backend.DataResponse{}, Responses: map[string]backend.DataResponse{},
skipping to change at line 135 skipping to change at line 135
}, },
}, },
} }
queryResult.Frames = frames queryResult.Frames = frames
return queryResult return queryResult
} }
reqBody, err := json.Marshal(map[string]interface{}{ reqBody, err := json.Marshal(map[string]interface{}{
"subscriptions": query.Model.Get("subscriptions").MustStringArray (), "subscriptions": query.Model.Get("subscriptions").MustStringArray (),
"query": query.InterpolatedQuery, "query": query.InterpolatedQuery,
"options": map[string]string{"resultFormat": "table"},
}) })
if err != nil { if err != nil {
queryResult.Error = err queryResult.Error = err
return queryResult return queryResult
} }
req, err := e.createRequest(ctx, e.dsInfo, reqBody) req, err := e.createRequest(ctx, e.dsInfo, reqBody)
if err != nil { if err != nil {
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)