Skip to content

Commit

Permalink
Remove the warning for thresholds on url sub-metrics
Browse files Browse the repository at this point in the history
This was mistakenly added in k6 v0.39.0 (#2583), but it turns out we probably don't need it (see #2584 (comment))
  • Loading branch information
na-- committed Aug 19, 2022
1 parent 8380fe7 commit e09bb87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
5 changes: 2 additions & 3 deletions cmd/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,8 @@ func TestThresholdDeprecationWarnings(t *testing.T) {
newRootCommand(ts.globalState).execute()

logs := ts.loggerHook.Drain()
assert.True(t, testutils.LogContains(logs, logrus.WarnLevel,
"Thresholds like 'http_req_duration{url:https://test.k6.io}', based on the high-cardinality 'url' metric tag, are deprecated",
))
assert.False(t, testutils.LogContains(logs, logrus.WarnLevel, "http_req_duration{url:https://test.k6.io}"))

assert.True(t, testutils.LogContains(logs, logrus.WarnLevel,
"Thresholds like 'http_req_duration{error:foo}', based on the high-cardinality 'error' metric tag, are deprecated",
))
Expand Down
9 changes: 0 additions & 9 deletions metrics/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,6 @@ func (me *MetricsEngine) getThresholdMetricOrSubmetric(name string) (*metrics.Me

// TODO: reword these from "will be deprecated" to "were deprecated" and
// maybe make them errors, not warnings, when we introduce un-indexable tags

if _, ok := sm.Tags.Get("url"); ok {
me.logger.Warnf("Thresholds like '%s', based on the high-cardinality 'url' metric tag, "+
"are deprecated and will not be supported in future k6 releases. "+
"To prevent breaking changes and reduce bugs, use the 'name' metric tag instead, see"+
"URL grouping (https://k6.io/docs/using-k6/http-requests/#url-grouping) for more information.", name,
)
}

if _, ok := sm.Tags.Get("error"); ok {
me.logger.Warnf("Thresholds like '%s', based on the high-cardinality 'error' metric tag, "+
"are deprecated and will not be supported in future k6 releases. "+
Expand Down

0 comments on commit e09bb87

Please sign in to comment.