k6-docs icon indicating copy to clipboard operation
k6-docs copied to clipboard

Document the metadata column in the CSV output

Open immavalls opened this issue 3 years ago • 7 comments

In the docs we have the output columns as below:

metric_name,timestamp,metric_value,check,error,error_code,group,method,name,proto,scenario,status,subproto,tls_version,url,extra_tags
http_reqs,1595325560,1.000000,,,,,GET,http://test.k6.io,HTTP/1.1,default,200,,,http://test.k6.io,

Currently, the output is adding a metadata column:

metric_name,timestamp,metric_value,check,error,error_code,expected_response,group,method,name,proto,scenario,service,status,subproto,tls_version,url,extra_tags,metadata
http_reqs,1669309480,1.000000,,,,true,,POST,https://httpbin.test.k6.io/post,HTTP/1.1,default,,200,,tls1.3,https://httpbin.test.k6.io/post,,

We should change the example and also review where the fieldNames are documented. Is it under metrics? I am not finding the metadata field in the docs. Could this be the metadata in the requests?

Decide if it's worth documenting the output columns as in k6-learn.

And also review the JSON and other outputs to see if it's clear. Or we can document the columns in general for "all" the outputs.

immavalls avatar Dec 01 '22 11:12 immavalls

This was probably introduced with the v0.41.0 release , https://github.com/grafana/k6/pull/2726. Based on the release notes. Not sure if we want to document or reference it. Or simply change the example in the docs to add this column.

Internal support for high-cardinality metrics metadata (https://github.com/grafana/k6/pull/2726, https://github.com/grafana/k6/pull/2727)

As described in the previous section, the efficient grouping of metric samples into time series works well for relatively low-cardinality data. However, k6 needed some way to attach high-cardinality metadata as well. This is necessary for data that's unique or random, such as Trace and Span IDs in distributed tracing or user IDs in tests with huge data sets.

k6 v0.41.0 has added support for attaching high-cardinality metadata to metric samples, and the vu and iter system tags have been transformed into such metadata (see the breaking changes section above), but it is not yet accessible from user scripts. There is no JavaScript API to modify this metadata, only built-in k6 Go modules and xk6 Go extensions can make use of it, for now.

immavalls avatar Feb 03 '23 12:02 immavalls

If we take the CSV headers metric_name,timestamp,metric_value,check,error,error_code,group,method,name,proto,scenario,status,subproto,tls_version,url,extra_tags,metadata, the docs point to metrics and error codes.

I'd like to see all the headers clearly documented, either pointing to the corresponding metric or explaining what we'll find there (proto is the protocol? subproto, extra_tags are the custom tags?...). What to expect for each output: https://k6.io/docs/results-output/real-time/.

We could convert this issue to better document what to expect when writing to files vs streaming. At least for the outputs maintained in the core. What do you think @MattDodsonEnglish ?

immavalls avatar Feb 28 '23 11:02 immavalls

I think it's a great Idea to add tabbed references for the major OSs here. :+1: . Especially since it's an introductory doc.

MattDodsonEnglish avatar Mar 16 '23 18:03 MattDodsonEnglish

Thank! Is this comment maybe for https://github.com/grafana/k6-docs/issues/1078 @MattDodsonEnglish ?

immavalls avatar Mar 16 '23 18:03 immavalls

Haha, yes :facepalm: .

I need to be a little slower in going through my issues

MattDodsonEnglish avatar Mar 16 '23 18:03 MattDodsonEnglish

:facepalm:

MattDodsonEnglish avatar Mar 16 '23 18:03 MattDodsonEnglish

Do you plan to create a new issue for this @MattDodsonEnglish

We could convert this issue to better document what to expect when writing to files vs streaming. At least for the outputs maintained in the core.

immavalls avatar Mar 16 '23 18:03 immavalls