-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support non-indexable high-cardinality metric tags / metadata #2584
Comments
While working on the latest iteration of this, I realized a few issues with the plan to make Here are the problems I saw:
So, my proposal to fix all of these issues is this:
This will leave us with (mostly) sensible defaults and with an easy way for users to avoid high-cardinality metrics. It will also minimize the disruption to users who already have thresholds on The code for this even looks relatively clean 😅 k6/lib/netext/httpext/transport.go Lines 84 to 108 in 6ed8668
And if everyone agrees with this approach, we should probably merge a small PR before k6 v0.40.0 is released that rolls back these parts of #2583: Lines 93 to 99 in b89a3aa
Lines 318 to 320 in b89a3aa
(edit: created PR for v0.40.0 to remove the warning: #2655) |
Can you remember the reasons we were particularly against this in the original discussion? |
No... 😞 I tried to find some discussion on the topic, but I don't think we delved that much into it, we mostly discussed other details. |
This was mistakenly added in k6 v0.39.0 (#2583), but it turns out we probably don't need it (see #2584 (comment))
I'm not getting when the |
To put it another way - with #2584 (comment), we get all of the benefits of #2584 (comment), but with a much smaller breaking change. We get a way to have low-cardinality URLs, users just have to set the So, only the people with many URLs or with dynamic URLs need to bother with In summary, it seems to me that it's a much smaller breaking change with basically the same benefits.
Setting a threshold on
Sure, I am not against adding it, but we don't have it yet. So, unless we add it right now and release it in v0.40.0, in both websocket APIs, there will be no transitional k6 version that has both |
This was mistakenly added in k6 v0.39.0 (#2583), but it turns out we probably don't need it (see #2584 (comment))
After some lengthy internal discussions, we didn't reach consensus if the JS APIs from #2654 are the best one for the job. I'll try to do a longer public summary later, but suffice it to say that there were some strong and valid internal objections when it came to its UX... 😅 However, the need to support some sort of high-cardinality metrics metadata is still there and needs to be handled, so we decided to do these things for now:
|
Currently, the k6 system metric tags are a mix of high-cardinality ones (
url
,error
,vu
anditer
) and relatively low-cardinality ones (everything else). This has already been a problem multiple times and has forced us to adopt some hacks to work around the issues, e.g. these workarounds in the built-in outputs: 1, 2, 3). On top of that, even the current high-cardinality tags are going be a big problem for the upcoming time series changes (#2580), but we'll need to add even more and higher cardinality tags for things like tracing (#2128), to store the trace and span IDs. Finally, k6 has no information whether user-defined custom tags have high or low cardinality.So, because of all of these reasons, we'll need to have some way to differentiate between two distinct types of metric sample tags/metadata:
Different outputs will be free to treat these high-cardinality tags/metadata however they want - they can discard it (probably the behavior of outputs like statsd, datadod, prometheus, etc. that work with time series), sample it (e.g. to export some tracing information), transform it (e.g. in
influxdb
this will correspond to data pointfields
) or output it directly like they do to tags (e.g.json
,csv
and other similar outputs can just write it to the disk, since we don't do any indexing or aggregation, just dump raw data). This will finally allow us to deprecate the hacks we currently have.The exact API changes on how we'll add this for custom tags in k6 are still under consideration, but the currently favored approach is to extend the tags API to support both strings and objects, something like this:
Unfortunately, we will probably have to do a minor breaking change in the k6 core and transform some of the currently problematic (because of their high cardinality) k6 system tags like
vu
,iter
,url
into non-indexable ones by default... So thresholds based on them will no longer work. Warnings about this very likely breaking change were added to k6 v0.39.0 (#2583) for scripts that have thresholds on them, and we mention them in the v0.39.0 release notes (#2581).The text was updated successfully, but these errors were encountered: