mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 10:20:29 -06:00
Azure: Remove data plane feature toggle (#77754)
* Remove feature toggle * Fix test and lint
This commit is contained in:
parent
fa468fb17c
commit
6df5b30fa3
@ -49,7 +49,6 @@ Some features are enabled by default. You can disable these feature by setting t
|
||||
| `cloudWatchLogsMonacoEditor` | Enables the Monaco editor for CloudWatch Logs queries | Yes |
|
||||
| `recordedQueriesMulti` | Enables writing multiple items from a single query within Recorded Queries | Yes |
|
||||
| `transformationsRedesign` | Enables the transformations redesign | Yes |
|
||||
| `azureMonitorDataplane` | Adds dataplane compliant frame metadata in the Azure Monitor datasource | Yes |
|
||||
| `prometheusConfigOverhaulAuth` | Update the Prometheus configuration page with the new auth component | Yes |
|
||||
| `dashgpt` | Enable AI powered features in dashboards | Yes |
|
||||
| `newBrowseDashboards` | New browse/manage dashboards UI | Yes |
|
||||
|
@ -110,7 +110,6 @@ export interface FeatureToggles {
|
||||
featureToggleAdminPage?: boolean;
|
||||
awsAsyncQueryCaching?: boolean;
|
||||
splitScopes?: boolean;
|
||||
azureMonitorDataplane?: boolean;
|
||||
traceToProfiles?: boolean;
|
||||
permissionsFilterRemoveSubquery?: boolean;
|
||||
prometheusConfigOverhaulAuth?: boolean;
|
||||
|
@ -670,14 +670,6 @@ var (
|
||||
Owner: identityAccessTeam,
|
||||
RequiresRestart: true,
|
||||
},
|
||||
{
|
||||
Name: "azureMonitorDataplane",
|
||||
Description: "Adds dataplane compliant frame metadata in the Azure Monitor datasource",
|
||||
Stage: FeatureStageGeneralAvailability,
|
||||
Owner: grafanaPartnerPluginsSquad,
|
||||
Expression: "true", // on by default
|
||||
AllowSelfServe: falsePtr,
|
||||
},
|
||||
{
|
||||
Name: "traceToProfiles",
|
||||
Description: "Enables linking between traces and profiles",
|
||||
|
@ -91,7 +91,6 @@ grafanaAPIServerWithExperimentalAPIs,experimental,@grafana/grafana-app-platform-
|
||||
featureToggleAdminPage,experimental,@grafana/grafana-operator-experience-squad,false,false,true,false
|
||||
awsAsyncQueryCaching,preview,@grafana/aws-datasources,false,false,false,false
|
||||
splitScopes,preview,@grafana/identity-access-team,false,false,true,false
|
||||
azureMonitorDataplane,GA,@grafana/partner-datasources,false,false,false,false
|
||||
traceToProfiles,experimental,@grafana/observability-traces-and-profiling,false,false,false,true
|
||||
permissionsFilterRemoveSubquery,experimental,@grafana/backend-platform,false,false,false,false
|
||||
prometheusConfigOverhaulAuth,GA,@grafana/observability-metrics,false,false,false,false
|
||||
|
|
@ -375,10 +375,6 @@ const (
|
||||
// Support faster dashboard and folder search by splitting permission scopes into parts
|
||||
FlagSplitScopes = "splitScopes"
|
||||
|
||||
// FlagAzureMonitorDataplane
|
||||
// Adds dataplane compliant frame metadata in the Azure Monitor datasource
|
||||
FlagAzureMonitorDataplane = "azureMonitorDataplane"
|
||||
|
||||
// FlagTraceToProfiles
|
||||
// Enables linking between traces and profiles
|
||||
FlagTraceToProfiles = "traceToProfiles"
|
||||
|
@ -393,9 +393,7 @@ func (e *AzureMonitorDatasource) parseResponse(amr types.AzureMonitorResponse, q
|
||||
}
|
||||
|
||||
frame := data.NewFrameOfFieldTypes("", len(series.Data), data.FieldTypeTime, data.FieldTypeNullableFloat64)
|
||||
if e.Features.IsEnabled(featuremgmt.FlagAzureMonitorDataplane) {
|
||||
frame.Meta = &data.FrameMeta{Type: data.FrameTypeTimeSeriesMulti, TypeVersion: data.FrameTypeVersion{0, 1}}
|
||||
}
|
||||
frame.Meta = &data.FrameMeta{Type: data.FrameTypeTimeSeriesMulti, TypeVersion: data.FrameTypeVersion{0, 1}}
|
||||
frame.RefID = query.RefID
|
||||
timeField := frame.Fields[0]
|
||||
timeField.Name = data.TimeSeriesTimeFieldName
|
||||
|
@ -365,20 +365,11 @@ func TestCustomNamespace(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
type fakeFeatureToggles struct {
|
||||
flags map[string]bool
|
||||
}
|
||||
|
||||
func (f *fakeFeatureToggles) IsEnabled(feature string) bool {
|
||||
return f.flags[feature]
|
||||
}
|
||||
|
||||
func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
resources := map[string]dataquery.AzureMonitorResource{}
|
||||
resources["/subscriptions/12345678-aaaa-bbbb-cccc-123456789abc/resourceGroups/grafanastaging/providers/Microsoft.Compute/virtualMachines/grafana"] =
|
||||
dataquery.AzureMonitorResource{ResourceGroup: strPtr("grafanastaging"), ResourceName: strPtr("grafana")}
|
||||
subscription := "12345678-aaaa-bbbb-cccc-123456789abc"
|
||||
datasource := &AzureMonitorDatasource{Features: &fakeFeatureToggles{flags: map[string]bool{"azureMonitorDataplane": true}}}
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
@ -386,7 +377,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
mockQuery *types.AzureMonitorQuery
|
||||
expectedFrames data.Frames
|
||||
queryIntervalMS int64
|
||||
datasource *AzureMonitorDatasource
|
||||
}{
|
||||
{
|
||||
name: "average aggregate time series response",
|
||||
@ -399,7 +389,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "total aggregate time series response",
|
||||
@ -412,7 +401,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "maximum aggregate time series response",
|
||||
@ -425,7 +413,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "minimum aggregate time series response",
|
||||
@ -438,7 +425,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "count aggregate time series response",
|
||||
@ -451,7 +437,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "single dimension time series response",
|
||||
@ -464,7 +449,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "with alias patterns in the query",
|
||||
@ -478,7 +462,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "single dimension with alias",
|
||||
@ -492,7 +475,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "multiple dimension time series response with label alias",
|
||||
@ -506,7 +488,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: map[string]dataquery.AzureMonitorResource{"/subscriptions/12345678-aaaa-bbbb-cccc-123456789abc/resourceGroups/grafanatest/providers/Microsoft.Storage/storageAccounts/testblobaccount/blobServices/default/providers/Microsoft.Insights/metrics": {ResourceGroup: strPtr("grafanatest"), ResourceName: strPtr("testblobaccount")}},
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "unspecified unit with alias should not panic",
|
||||
@ -520,7 +501,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "with legacy azure monitor query properties and without a resource uri",
|
||||
@ -534,7 +514,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "with legacy azure monitor query properties and with a resource uri it should use the resource uri",
|
||||
@ -548,7 +527,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "multiple time series response",
|
||||
@ -561,7 +539,6 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "multiple time series response with multiple dimensions",
|
||||
@ -574,27 +551,14 @@ func TestAzureMonitorParseResponse(t *testing.T) {
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: datasource,
|
||||
},
|
||||
{
|
||||
name: "non-dataplane compliant response",
|
||||
responseFile: "azuremonitor/11-azure-monitor-non-dataplane-response.json",
|
||||
mockQuery: &types.AzureMonitorQuery{
|
||||
URL: "/subscriptions/12345678-aaaa-bbbb-cccc-123456789abc/resourceGroups/grafanastaging/providers/Microsoft.Compute/virtualMachines/grafana/providers/microsoft.insights/metrics",
|
||||
Params: url.Values{
|
||||
"aggregation": {"Average"},
|
||||
},
|
||||
Resources: resources,
|
||||
Subscription: subscription,
|
||||
},
|
||||
datasource: &AzureMonitorDatasource{Features: &fakeFeatureToggles{flags: map[string]bool{"azureMonitorDataplane": false}}},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
azData := loadTestFile(t, tt.responseFile)
|
||||
dframes, err := tt.datasource.parseResponse(azData, tt.mockQuery, "http://ds", "")
|
||||
datasource := &AzureMonitorDatasource{}
|
||||
dframes, err := datasource.parseResponse(azData, tt.mockQuery, "http://ds", "")
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, dframes)
|
||||
|
||||
|
@ -1,47 +0,0 @@
|
||||
{
|
||||
"cost": 0,
|
||||
"timespan": "2019-02-08T10:13:50Z\/2019-02-08T16:13:50Z",
|
||||
"interval": "PT1M",
|
||||
"value": [
|
||||
{
|
||||
"id": "\/subscriptions\/xxx\/resourceGroups\/grafanastaging\/providers\/Microsoft.Compute\/virtualMachines\/grafana\/providers\/Microsoft.Insights\/metrics\/Percentage CPU",
|
||||
"type": "Microsoft.Insights\/metrics",
|
||||
"name": {
|
||||
"value": "Percentage CPU",
|
||||
"localizedValue": "Percentage CPU"
|
||||
},
|
||||
"unit": "Percent",
|
||||
"timeseries": [
|
||||
{
|
||||
"metadatavalues": [
|
||||
|
||||
],
|
||||
"data": [
|
||||
{
|
||||
"timeStamp": "2019-02-08T10:13:00Z",
|
||||
"average": 2.0875
|
||||
},
|
||||
{
|
||||
"timeStamp": "2019-02-08T10:14:00Z",
|
||||
"average": 2.1525
|
||||
},
|
||||
{
|
||||
"timeStamp": "2019-02-08T10:15:00Z",
|
||||
"average": 2.155
|
||||
},
|
||||
{
|
||||
"timeStamp": "2019-02-08T10:16:00Z",
|
||||
"average": 3.6925
|
||||
},
|
||||
{
|
||||
"timeStamp": "2019-02-08T10:17:00Z",
|
||||
"average": 2.44
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"namespace": "Microsoft.Compute\/virtualMachines",
|
||||
"resourceregion": "westeurope"
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0]
|
||||
// Name:
|
||||
// Dimensions: 2 Fields by 5 Rows
|
||||
// +-------------------------------+----------------------+
|
||||
// | Name: Time | Name: Percentage CPU |
|
||||
// | Labels: | Labels: |
|
||||
// | Type: []time.Time | Type: []*float64 |
|
||||
// +-------------------------------+----------------------+
|
||||
// | 2019-02-08 10:13:00 +0000 UTC | 2.0875 |
|
||||
// | 2019-02-08 10:14:00 +0000 UTC | 2.1525 |
|
||||
// | 2019-02-08 10:15:00 +0000 UTC | 2.155 |
|
||||
// | 2019-02-08 10:16:00 +0000 UTC | 3.6925 |
|
||||
// | 2019-02-08 10:17:00 +0000 UTC | 2.44 |
|
||||
// +-------------------------------+----------------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"fields": [
|
||||
{
|
||||
"name": "Time",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time"
|
||||
},
|
||||
"config": {
|
||||
"links": [
|
||||
{
|
||||
"title": "View in Azure Portal",
|
||||
"targetBlank": true,
|
||||
"url": "http://ds/#blade/Microsoft_Azure_MonitoringMetrics/Metrics.ReactView/Referer/MetricsExplorer/TimeContext/%7B%22absolute%22%3A%7B%22startTime%22%3A%220001-01-01T00%3A00%3A00Z%22%2C%22endTime%22%3A%220001-01-01T00%3A00%3A00Z%22%7D%7D/ChartDefinition/%7B%22v2charts%22%3A%5B%7B%22metrics%22%3A%5B%7B%22resourceMetadata%22%3A%7B%22id%22%3A%22%2Fsubscriptions%2F12345678-aaaa-bbbb-cccc-123456789abc%2FresourceGroups%2Fgrafanastaging%2Fproviders%2FMicrosoft.Compute%2FvirtualMachines%2Fgrafana%22%7D%2C%22name%22%3A%22%22%2C%22aggregationType%22%3A4%2C%22namespace%22%3A%22%22%2C%22metricVisualization%22%3A%7B%22displayName%22%3A%22%22%2C%22resourceDisplayName%22%3A%22grafana%22%7D%7D%5D%7D%5D%7D"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Percentage CPU",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {},
|
||||
"config": {
|
||||
"unit": "percent",
|
||||
"links": [
|
||||
{
|
||||
"title": "View in Azure Portal",
|
||||
"targetBlank": true,
|
||||
"url": "http://ds/#blade/Microsoft_Azure_MonitoringMetrics/Metrics.ReactView/Referer/MetricsExplorer/TimeContext/%7B%22absolute%22%3A%7B%22startTime%22%3A%220001-01-01T00%3A00%3A00Z%22%2C%22endTime%22%3A%220001-01-01T00%3A00%3A00Z%22%7D%7D/ChartDefinition/%7B%22v2charts%22%3A%5B%7B%22metrics%22%3A%5B%7B%22resourceMetadata%22%3A%7B%22id%22%3A%22%2Fsubscriptions%2F12345678-aaaa-bbbb-cccc-123456789abc%2FresourceGroups%2Fgrafanastaging%2Fproviders%2FMicrosoft.Compute%2FvirtualMachines%2Fgrafana%22%7D%2C%22name%22%3A%22%22%2C%22aggregationType%22%3A4%2C%22namespace%22%3A%22%22%2C%22metricVisualization%22%3A%7B%22displayName%22%3A%22%22%2C%22resourceDisplayName%22%3A%22grafana%22%7D%7D%5D%7D%5D%7D"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1549620780000,
|
||||
1549620840000,
|
||||
1549620900000,
|
||||
1549620960000,
|
||||
1549621020000
|
||||
],
|
||||
[
|
||||
2.0875,
|
||||
2.1525,
|
||||
2.155,
|
||||
3.6925,
|
||||
2.44
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user