-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CloudWatch: Deprecate dynamic labels feature toggle, remove support for Alias in backend #66494
Conversation
Backend code coverage report for PR #66494
|
Frontend code coverage report for PR #66494
|
a1467bb
to
907861d
Compare
907861d
to
d711d91
Compare
d711d91
to
6387dc4
Compare
deepLink, err := query.BuildDeepLink(startTime, endTime, false) | ||
deepLink, err := query.BuildDeepLink(startTime, endTime) | ||
require.NoError(t, err) | ||
assert.NotContains(t, deepLink, "label") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those were written backwards from what the test name described
deepLink, err := query.BuildDeepLink(startTime, endTime, false) | ||
deepLink, err := query.BuildDeepLink(startTime, endTime) | ||
require.NoError(t, err) | ||
assert.NotContains(t, deepLink, "label") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those were also written backwards from what the test name described
func TestQueryJSON(t *testing.T) { | ||
jsonString := []byte(`{ | ||
"type": "timeSeriesQuery" | ||
}`) | ||
var res metricsDataQuery | ||
err := json.Unmarshal(jsonString, &res) | ||
require.NoError(t, err) | ||
assert.Equal(t, "timeSeriesQuery", res.Type) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should have been removed in https://github.com/grafana/grafana/pull/66420/files#diff-2a558b494e9be887c5af055ab92ddda783a45e96b5d5a8addc8d8d276bc85e96L297
assert.Equal(t, "lb2", frame2.Fields[1].Labels["LoadBalancer"]) | ||
}) | ||
|
||
t.Run("Expand dimension value using substring", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to be a near-duplicate of the test above: asserts and acts on the same alias string
@@ -499,23 +249,4 @@ func TestCloudWatchResponseParser(t *testing.T) { | |||
assert.Equal(t, "Value", frame.Fields[1].Name) | |||
assert.Equal(t, "", frame.Fields[1].Config.DisplayName) | |||
}) | |||
|
|||
t.Run("buildDataFrames should use response label as frame name when dynamic label is enabled", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be covered in "buildDataFrames should use response label as frame name" now
|
||
t.Run("Expand dimension value using exact match", func(t *testing.T) { | ||
func Test_buildDataFrames_uses_response_label_as_frame_name(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests used to document how the Alias was transformed:
#21541
#22695
I'm reluctant to remove them as they continue to document different input queries.
The thing they document now is pretty mundane -- now all of the resulting frame names come from the response "label" from the GetMetricData API, not from the input alias.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of basic question on my part haha sorry, if the feature is enabled by default: https://github.com/grafana/grafana/blob/main/pkg/services/featuremgmt/registry.go#L124 then how does this pr make dynamic labels enabled by default? I thought it was already done? Would it be fair to reword this as removing support for alias or something like that instead?
Otherwise makes sense to me!
Good point, thanks @sarahzinger. I've removed the focus from making the dynamic labels default since you're right that was already the case. (Since the code will still do a one-time Alias->Label migration, I wasn't able to truly remove Alias from the code. I am working on getting the deprecated comment in.) |
sounds good maybe the title change can be something like |
@sarahzinger I've created an issue to deprecate Alias and its migration here #67315, let me know what you think. I guess it can be in Grafana 11? |
What is this feature?
In the backend of the CloudWatch plugin, this
The change of the frontend code will be in a separate PR.
The removal of the feature toggle itself will be in a separate PR.
Why do we need this feature?
This was slated for removal in Grafana 10
Which issue(s) does this PR fix?:
Contributes to #66437
Special notes for your reviewer:
Alias has been replaced by Dynamic Label in #48434
Testing notes:
Normal queries:
{{period}}
In alerts:
label
target in the panel yet, just use analias
target like:This simulates a "legacy alias" query.
label
. (In this example, alias would have been migrated to label equal to${PROP('Period')}
)Please check that: