{"id":11084,"date":"2024-03-13T22:17:09","date_gmt":"2024-03-14T02:17:09","guid":{"rendered":"https:\/\/www.redline13.com\/blog\/?p=11084"},"modified":"2024-03-13T22:17:10","modified_gmt":"2024-03-14T02:17:10","slug":"tags-and-thresholds-in-k6","status":"publish","type":"post","link":"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/","title":{"rendered":"Tags and Thresholds in k6"},"content":{"rendered":"<p><a id=\"post-11084-_tkje6dyqlx1a\"><\/a> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-11085\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-1.png\" alt=\"Tags and Thresholds in k6\" width=\"340\" height=\"255\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-1.png 400w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-1-300x225.png 300w\" sizes=\"auto, (max-width: 340px) 100vw, 340px\" \/><\/p>\n<p>In this brief post, we will cover how to add individual requests to groups using the <a href=\"https:\/\/grafana.com\/docs\/k6\/latest\/using-k6\/tags-and-groups\/\" target=\"_blank\" rel=\"noopener\">tags<\/a> feature of k6. This feature can be used to label <a href=\"https:\/\/grafana.com\/docs\/k6\/latest\/using-k6\/thresholds\/\" target=\"_blank\" rel=\"noopener\">thresholds<\/a> for reporting on grouped requests. By separating result metrics generated by your k6 test, it can become possible to isolate the performance of individual or related requests.<\/p>\n<p>Suppose for a given test we have identified a performance issue; however the test is made up of several different requests. These separate requests each call essential endpoints for the process tested, and therefore would not be feasible to test them individually out of context. Nonetheless, we suspect that one of these requests is degrading the performance of the overall test.<\/p>\n<p>Using the <code>http_req_duration threshold<\/code>, the example below illustrates how we can create two groups named \u201c<code>Product_Listing<\/code>\u201d and \u201c<code>Product_Details<\/code>\u201d. These groups are referenced in the requests that follow using tags:<\/p>\n<figure id=\"attachment_11086\" class=\"wp-caption aligncenter\" style=\"max-width: 1147px\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-11086\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-2.png\" alt=\"Example k6 test plan script using tags to categorize requests into groups\" width=\"1147\" height=\"375\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-2.png 1147w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-2-300x98.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-2-1024x335.png 1024w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-2-768x251.png 768w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-2-425x139.png 425w\" sizes=\"auto, (max-width: 1147px) 100vw, 1147px\" \/><figcaption class=\"wp-caption-text\">Example k6 test plan script using tags to categorize requests into groups.<\/figcaption><\/figure>\n<p><span style=\"font-size: revert; color: initial;\">When we run our script, the <\/span><a style=\"font-size: revert;\" href=\"https:\/\/k6.io\/docs\/results-output\/end-of-test\/\" target=\"_blank\" rel=\"noopener\">test summary<\/a><span style=\"font-size: revert; color: initial;\"> will now reflect separate metrics for <code>http_req_duration<\/code><\/span><span style=\"font-size: revert; color: initial;\">\u00a0for each of our defined tag groups:<\/span><\/p>\n<figure id=\"attachment_11087\" class=\"wp-caption aligncenter\" style=\"max-width: 1235px\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-11087\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-3.png\" alt=\"k6 test summary detailing separation of line items by defined tag groups\" width=\"1235\" height=\"482\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-3.png 1235w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-3-300x117.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-3-1024x400.png 1024w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-3-768x300.png 768w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/word-image-11084-3-425x166.png 425w\" sizes=\"auto, (max-width: 1235px) 100vw, 1235px\" \/><figcaption class=\"wp-caption-text\">k6 test summary detailing separation of line items by defined tag groups.<\/figcaption><\/figure>\n<p>If you are running your test on RedLine13, you can download the test summary at the conclusion of the test as long as you have <a href=\"https:\/\/www.redline13.com\/blog\/docs\/output-files\/\" target=\"_blank\" rel=\"noopener\">output files<\/a> enabled. Analyzing this file, it is now possible to pinpoint performance discrepancies at the request level. In our hypothetical example, the \u201c<code>Product_Listing<\/code>\u201d endpoints are taking 5-10 times longer to complete than the \u201c<code>Product_Details<\/code>\u201d endpoints.<\/p>\n<hr \/>\n<p>Did you know that RedLine13 offers a full-featured, time-limited free trial?\u00a0 <a href=\"https:\/\/www.redline13.com\/Service\" target=\"_blank\" rel=\"noopener\">Sign up now<\/a>, and start testing today!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this brief post, we will cover how to add individual requests to groups using the tags feature of k6. This feature can be used to label thresholds for reporting on grouped requests. By separating result metrics generated by your k6 test, it can become possible to isolate the performance of individual or related requests. Suppose for a given test we have identified a performance issue; however the test is made up of several different requests.<a class=\"more-link\" href=\"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/\">Read More &rarr;<\/a><\/p>\n","protected":false},"author":11,"featured_media":11088,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,1],"tags":[128,596,696,671,699,697,698,318,424,493,494],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-dkoziel","4":"post-11084","6":"format-standard","7":"has-post-thumbnail","8":"category-blog","9":"category-uncategorized","10":"post_tag-cloud-load-testing","11":"post_tag-k6","12":"post_tag-k6-features","13":"post_tag-k6-load-tests","14":"post_tag-k6-summary","15":"post_tag-k6-tags","16":"post_tag-k6-thresholds","17":"post_tag-load-testing","18":"post_tag-redline13","19":"post_tag-tagging","20":"post_tag-tags"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tags and Thresholds in k6 - RedLine13<\/title>\n<meta name=\"description\" content=\"In this post, we will cover how to add individual requests to groups using the tags feature of k6 as a way to isolate performance issues.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tags and Thresholds in k6 - RedLine13\" \/>\n<meta property=\"og:description\" content=\"In this post, we will cover how to add individual requests to groups using the tags feature of k6 as a way to isolate performance issues.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/\" \/>\n<meta property=\"og:site_name\" content=\"RedLine13\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-14T02:17:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-14T02:17:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/Featured-image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"David Koziel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Koziel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/\"},\"author\":{\"name\":\"David Koziel\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\"},\"headline\":\"Tags and Thresholds in k6\",\"datePublished\":\"2024-03-14T02:17:09+00:00\",\"dateModified\":\"2024-03-14T02:17:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/\"},\"wordCount\":282,\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"keywords\":[\"Cloud Load Testing\",\"k6\",\"k6 features\",\"k6 load tests\",\"k6 summary\",\"k6 tags\",\"k6 thresholds\",\"Load Testing\",\"RedLine13\",\"tagging\",\"Tags\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/\",\"name\":\"Tags and Thresholds in k6 - RedLine13\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\"},\"datePublished\":\"2024-03-14T02:17:09+00:00\",\"dateModified\":\"2024-03-14T02:17:10+00:00\",\"description\":\"In this post, we will cover how to add individual requests to groups using the tags feature of k6 as a way to isolate performance issues.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.redline13.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tags and Thresholds in k6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"name\":\"RedLine13\",\"description\":\"(Almost) Free Load Testing in the Cloud\",\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.redline13.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\",\"name\":\"RedLine13\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"contentUrl\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"width\":300,\"height\":68,\"caption\":\"RedLine13\"},\"image\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\",\"name\":\"David Koziel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"caption\":\"David Koziel\"},\"url\":\"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tags and Thresholds in k6 - RedLine13","description":"In this post, we will cover how to add individual requests to groups using the tags feature of k6 as a way to isolate performance issues.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/","og_locale":"en_US","og_type":"article","og_title":"Tags and Thresholds in k6 - RedLine13","og_description":"In this post, we will cover how to add individual requests to groups using the tags feature of k6 as a way to isolate performance issues.","og_url":"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/","og_site_name":"RedLine13","article_published_time":"2024-03-14T02:17:09+00:00","article_modified_time":"2024-03-14T02:17:10+00:00","og_image":[{"width":400,"height":300,"url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/03\/Featured-image.png","type":"image\/png"}],"author":"David Koziel","twitter_card":"summary_large_image","twitter_misc":{"Written by":"David Koziel","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/#article","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/"},"author":{"name":"David Koziel","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20"},"headline":"Tags and Thresholds in k6","datePublished":"2024-03-14T02:17:09+00:00","dateModified":"2024-03-14T02:17:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/"},"wordCount":282,"publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"keywords":["Cloud Load Testing","k6","k6 features","k6 load tests","k6 summary","k6 tags","k6 thresholds","Load Testing","RedLine13","tagging","Tags"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/","url":"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/","name":"Tags and Thresholds in k6 - RedLine13","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/#website"},"datePublished":"2024-03-14T02:17:09+00:00","dateModified":"2024-03-14T02:17:10+00:00","description":"In this post, we will cover how to add individual requests to groups using the tags feature of k6 as a way to isolate performance issues.","breadcrumb":{"@id":"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.redline13.com\/blog\/2024\/03\/tags-and-thresholds-in-k6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redline13.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Tags and Thresholds in k6"}]},{"@type":"WebSite","@id":"https:\/\/www.redline13.com\/blog\/#website","url":"https:\/\/www.redline13.com\/blog\/","name":"RedLine13","description":"(Almost) Free Load Testing in the Cloud","publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.redline13.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.redline13.com\/blog\/#organization","name":"RedLine13","url":"https:\/\/www.redline13.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","contentUrl":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","width":300,"height":68,"caption":"RedLine13"},"image":{"@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20","name":"David Koziel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","caption":"David Koziel"},"url":"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/comments?post=11084"}],"version-history":[{"count":3,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11084\/revisions"}],"predecessor-version":[{"id":11091,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11084\/revisions\/11091"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media\/11088"}],"wp:attachment":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media?parent=11084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/categories?post=11084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/tags?post=11084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}