Try using Grot AI Grot AI for this query ->
Promo banner icon

Grafana 12.4 is here — faster and easier data visualization, Git Sync for observability as code updates, and more.

Learn more
DownloadsContact Us
Logo
  • Pricing
  • Docs
Sign inSign up
Menu
Technical documentation Plugin catalog
Choose a product
Viewing: v0.49.x Find another version
  • Grafana k6
  • Get started
    • Installation
      • Troubleshooting
    • Running k6
    • Results output
    • k6 resources
  • Using k6
    • HTTP Requests
    • Metrics
      • Built-in metrics
      • Create custom metrics
    • Checks
    • Thresholds
    • Options
      • How to use options
      • Options reference
    • Test lifecycle
    • Modules
    • Tags and Groups
    • Cookies
    • Protocols
      • HTTP/2
      • WebSockets
      • gRPC
      • SSL/TLS
        • Online Certificate Status Protocol (OCSP)
        • SSL/TLS client certificates
        • SSL/TLS version and ciphers
    • Environment variables
    • Execution context variables
    • Scenarios
      • Concepts
        • Graceful stop
        • Arrival-rate VU allocation
        • Dropped iterations
        • Open and closed models
      • Executors
        • Shared iterations
        • Per VU iterations
        • Constant VUs
        • Ramping VUs
        • Constant arrival rate
        • Ramping arrival rate
        • Externally controlled
      • Advanced Examples
    • Test authoring
      • Test builder
      • Create tests from recordings
        • Using the browser recorder
        • Using the HAR converter
  • Using k6 browser
    • Running browser tests
    • Browser metrics
    • Migrating to k6 v0.46
    • Recommended practices
      • Hybrid approach to performance
      • Page object model
      • Selecting elements
  • Results output
    • End of test
      • Custom summary
    • Real time
      • Amazon CloudWatch
      • Apache Kafka
      • CSV
      • Datadog
      • Dynatrace
      • Elasticsearch
      • Grafana Cloud k6
      • Grafana Cloud Prometheus
      • InfluxDB
      • JSON
      • Netdata
      • New Relic
      • Prometheus remote write
      • StatsD
      • TimescaleDB
    • Web dashboard
    • Grafana dashboards
  • Testing guides
    • Load test types
      • Smoke testing
      • Average-load testing
      • Stress testing
      • Soak testing
      • Spike testing
      • Breakpoint testing
    • API load testing
    • Automated performance testing
    • Load testing websites
    • Running large tests
    • Running distributed tests
    • Injecting faults with xk6-disruptor
      • xk6-disruptor first steps
      • Requirements
      • Installation
      • Expose your application
      • How xk6-disruptor works
      • xk6-disruptor examples
        • Inject gRPC faults into Service
        • Inject HTTP faults into Pod
        • Interactive demo
  • JavaScript API
    • Init context
      • open( filePath, [mode] )
    • k6
      • check( val, sets, [tags] )
      • fail( [err] )
      • group( name, fn )
      • randomSeed( int )
      • sleep( t )
    • k6/crypto
      • createHash( algorithm )
      • createHMAC( algorithm, secret )
      • hmac( algorithm, secret, data, outputEncoding )
      • md4( input, outputEncoding )
      • md5( input, outputEncoding )
      • randomBytes( int )
      • ripemd160( input, outputEncoding )
      • sha1( input, outputEncoding )
      • sha256( input, outputEncoding )
      • sha384( input, outputEncoding )
      • sha512( input, outputEncoding )
      • sha512_256( input, outputEncoding )
      • sha512_224( input, outputEncoding )
      • Hasher
    • k6/data
      • SharedArray
    • k6/encoding
      • b64decode( input, [encoding], [format] )
      • b64encode( input, [encoding] )
    • k6/execution
    • k6/experimental
      • browser
        • BrowserContext
          • addCookies()
          • addInitScript()
          • clearCookies()
          • clearPermissions()
          • close()
          • Cookie
          • cookies([urls])
          • grantPermissions(permissions[, options])
          • newPage()
          • pages()
          • setDefaultNavigationTimeout(timeout)
          • setDefaultTimeout(timeout)
          • setGeolocation(geolocation)
          • setOffline(offline)
          • waitForEvent(event[, optionsOrPredicate])
        • ConsoleMessage
        • ElementHandle
          • dblclick([, options])
          • isHidden()
          • isVisible()
        • Frame
          • dblclick(selector[, options])
          • isHidden(selector[, options])
          • isVisible(selector[, options])
        • JSHandle
        • Keyboard
        • Locator
          • check([options])
          • clear([options])
          • click([options])
          • dblclick([options])
          • dispatchEvent(type, eventInit, [options])
          • fill(value, [options])
          • focus([options])
          • getAttribute(name, [options])
          • hover([options])
          • innerHTML([options])
          • innerText([options])
          • inputValue([options])
          • isChecked([options])
          • isDisabled([options])
          • isEditable([options])
          • isEnabled([options])
          • isHidden()
          • isVisible()
          • press(key, [options])
          • selectOption(values, [options])
          • tap([options])
          • textContent([options])
          • type(text, [options])
          • uncheck([options])
          • waitFor([options])
        • Mouse
        • Page
          • $(selector)
          • $$(selector)
          • bringToFront()
          • check(selector[, options])
          • click(selector[, options])
          • close()
          • content()
          • context()
          • dblclick(selector[, options])
          • dispatchEvent(selector, type, eventInit[, options])
          • emulateMedia([options])
          • emulateVisionDeficiency(type)
          • evaluate(pageFunction[, arg])
          • evaluateHandle(pageFunction[, arg])
          • fill(selector, value[, options])
          • focus(selector[, options])
          • frames()
          • getAttribute(selector, name[, options])
          • goto(url[, options])
          • hover(selector[, options])
          • innerHTML(selector[, options])
          • innerText(selector[, options])
          • inputValue(selector[, options])
          • isChecked(selector[, options])
          • isClosed()
          • isDisabled(selector[, options])
          • isEditable(selector[, options])
          • isEnabled(selector[, options])
          • isHidden(selector[, options])
          • isVisible(selector[, options])
          • keyboard
          • locator(selector)
          • mainFrame()
          • mouse
          • on(event, handler)
          • opener()
          • press(selector, key[, options])
          • reload([options])
          • screenshot([options])
          • selectOption(selector, values[, options])
          • setContent(html[, options])
          • setDefaultNavigationTimeout(timeout)
          • setDefaultTimeout(timeout)
          • setExtraHTTPHeaders(headers)
          • setViewportSize(viewportSize)
          • tap(selector[, options])
          • textContent(selector[, options])
          • throttleCPU(cpuProfile)
          • throttleNetwork(networkProfile)
          • title()
          • touchScreen
          • type(selector, text[, options])
          • uncheck(selector[, options])
          • url()
          • viewportSize()
          • waitForFunction(pageFunction, arg[, options])
          • waitForLoadState(state[, options])
          • waitForNavigation([options])
          • waitForSelector(selector[, options])
          • waitForTimeout(timeout)
          • workers()
        • Request
          • size()
        • Response
        • Touchscreen
        • Worker
        • closeContext()
        • context()
        • isConnected()
        • newContext([options])
        • newPage([options])
        • version()
      • grpc
        • Client
          • Client.load(importPaths, ...protoFiles)
          • Client.loadProtoset(protosetPath)
          • Client.connect(address [,params])
          • Client.invoke(url, request [,params])
          • Client.close()
        • Params
        • Response
        • Stream
          • Stream.on()
          • Error
          • Stream.end()
          • Stream.write()
        • Constants
      • redis
        • Client
          • Client.decr(key)
          • Client.decrBy(key, decrement)
          • Client.del(keys)
          • Client.exists(keys)
          • Client.expire(key, seconds)
          • Client.get(key)
          • Client.getDel(key)
          • Client.getSet(key, value)
          • Client.hdel(key, fields)
          • Client.hget(key, field)
          • Client.hgetall(key)
          • Client.hincrby(key, field, increment)
          • Client.hkeys(key)
          • Client.hlen(key)
          • Client.hset(key, field, value)
          • Client.hsetnx(key, field, value)
          • Client.hvals(key)
          • Client.incr(key)
          • Client.incrBy(key, increment)
          • Client.lindex(key)
          • Client.llen(key)
          • Client.lpop(key)
          • Client.lpush(key, values)
          • Client.lrange(key, start, stop)
          • Client.lrem(key, count, value)
          • Client.lset(key, index, element)
          • Client.mget(keys)
          • Client.persist(key)
          • Client.randomKey()
          • Client.rpop(key)
          • Client.rpush(key, values)
          • Client.sadd(key, members)
          • Client.sendCommand(command, args)
          • Client.set(key, value, expiration)
          • Client.sismember(key, member)
          • Client.smembers(key)
          • Client.spop(key)
          • Client.srandmember(key)
          • Client.srem(key, members)
          • Client.ttl(key)
        • Options
      • timers
      • tracing
        • instrumentHTTP
        • Client
        • Options
      • websockets
        • WebSocket
          • WebSocket.addEventListener(event, handler)
          • WebSocket.send(data)
          • WebSocket.close([code])
          • WebSocket.ping()
          • WebSocket.onclose
          • WebSocket.onerror
          • WebSocket.onmessage
          • WebSocket.onopen
          • WebSocket.onping
          • WebSocket.onpong
        • Params
      • webcrypto
        • Crypto
          • getRandomValues
          • randomUUID
        • SubtleCrypto
          • decrypt
          • digest
          • encrypt
          • exportKey
          • generateKey
          • importKey
          • sign
          • verify
        • CryptoKey
        • AesKeyGenParams
        • HmacKeyGenParams
        • AesCtrParams
        • AesCbcParams
        • AesGcmParams
      • fs
        • File
          • read
          • seek
          • stat
        • open
        • FileInfo
        • SeekMode
    • k6/html
      • parseHTML( src )
      • Element
        • Element.selection()
      • Selection
        • Selection.attr(name)
        • Selection.children([selector])
        • Selection.closest(selector)
        • Selection.contents()
        • Selection.data([key])
        • Selection.each(fn)
        • Selection.eq(index)
        • Selection.filter(selector)
        • Selection.find(selector)
        • Selection.first()
        • Selection.get(index)
        • Selection.has(selector)
        • Selection.html()
        • Selection.is(selector)
        • Selection.last()
        • Selection.map(fn)
        • Selection.next([selector])
        • Selection.nextAll([selector])
        • Selection.nextUntil([selector], [filter])
        • Selection.not(selector)
        • Selection.parent([selector])
        • Selection.parents([selector])
        • Selection.parentsUntil([selector], [filter])
        • Selection.prev([selector])
        • Selection.prevAll([selector])
        • Selection.prevUntil([selector], [filter])
        • Selection.serialize()
        • Selection.serializeArray()
        • Selection.serializeObject()
        • Selection.size()
        • Selection.slice(start [, end])
        • Selection.text()
        • Selection.toArray()
        • Selection.val()
    • k6/http
      • asyncRequest( method, url, [body], [params] )
      • batch( requests )
      • del( url, [body], [params] )
      • file( data, [filename], [contentType] )
      • get( url, [params] )
      • head( url, [params] )
      • options( url, [body], [params] )
      • patch( url, [body], [params] )
      • post( url, [body], [params] )
      • put( url, [body], [params] )
      • request( method, url, [body], [params] )
      • setResponseCallback( callback )
      • url\`url\`
      • expectedStatuses( statuses )
      • CookieJar
        • CookieJar.clear(url)
        • CookieJar.cookiesForURL(url)
        • CookieJar.delete(url, name)
        • CookieJar.set(url, name, value, [options])
      • FileData
      • Params
      • Response
        • Response.clickLink( [params] )
        • Response.html()
        • Response.json( [selector] )
        • Response.submitForm( [params] )
    • k6/metrics
      • Counter
        • Counter.add(value, [tags])
      • Gauge
        • Gauge.add(value, [tags])
      • Rate
        • Rate.add(value, [tags])
      • Trend
        • Trend.add(value, [tags])
    • k6/net/grpc
      • Client
        • Client.load(importPaths, ...protoFiles)
        • Client.loadProtoset(protosetPath)
        • Client.connect(address [,params])
        • Client.invoke(url, request [,params])
        • Client.close()
      • Params
      • Response
      • Stream
        • Stream.on()
        • Error
        • Stream.end()
        • Stream.write()
      • Constants
    • k6/ws
      • connect( url, params, callback )
      • Params
      • Socket
        • Socket.close([code])
        • Socket.on(event, callback)
        • Socket.ping()
        • Socket.send(data)
        • Socket.sendBinary(data)
        • Socket.setInterval(callback, interval)
        • Socket.setTimeout(callback, delay)
    • Error Codes
    • xk6-disruptor API
      • Get started
      • Faults
        • gRPC
        • HTTP
        • Pod Termination
      • PodDisruptor
        • Constructor
        • injectGrpcFaults()
        • injectHTTPFaults()
        • terminatePods()
      • ServiceDisruptor
        • Constructor
        • injectGrpcFaults
        • injectHTTPFaults
        • terminatePods()
    • jslib
      • aws
        • AWSConfig
        • EventBridgeClient
          • putEvents
        • KMSClient
          • generateDataKey
          • listKeys
          • KMSDataKey
          • KMSKey
        • LambdaClient
          • invoke
        • S3Client
          • abortMultipartUpload
          • completeMultipartUpload
          • copyObject
          • createMultipartUpload
          • deleteObject
          • getObject
          • listBuckets
          • listObjects
          • putObject
          • uploadPart
          • Bucket
          • Object
          • S3MultipartUpload
          • S3Part
          • S3UploadedObject
        • SecretsManagerClient
          • createSecret
          • deleteSecret
          • getSecret
          • listSecrets
          • putSecretValue
          • Secret
        • SignatureV4
          • presign
          • sign
        • SQSClient
          • deleteMessage
          • listQueues
          • receiveMessages
          • sendMessage
          • sendMessageBatch
        • SystemsManagerClient
          • getParameter
          • SystemsManagerParameter
      • httpx
        • asyncRequest(method, url, [body], [params])
        • request(method, url, [body], [params])
        • get(url, [body], [params])
        • post(url, [body], [params])
        • put(url, [body], [params])
        • patch(url, [body], [params])
        • delete(url, [body], [params])
        • options(url, [body], [params])
        • head(url, [body], [params])
        • trace(url, [body], [params])
        • batch( requests )
        • setBaseUrl( url )
        • addHeader( key, value )
        • addHeaders( object )
        • clearHeader( name )
        • addTag( key, value )
        • addTags( object )
        • clearTag( name )
      • k6chaijs
        • config
        • describe( name, function )
        • expect()
        • Error handling
      • utils
        • randomIntBetween(min, max)
        • randomItem(array)
        • randomString(length, [charset])
        • uuidv4()
        • findBetween(content, left, right, [repeat])
        • normalDistributionStages(maxVus, durationSeconds, [numberOfStages])
  • Extensions
    • Explore extensions
    • Build a k6 binary using Go
    • Build a k6 binary using Docker
    • Create an extension
      • JavaScript Extensions
      • Output Extensions
    • Explanations
      • About the Extensions Registry
      • About the Go-to-JS bridge
      • Extension Graduation
  • Examples
    • Get started with k6
      • Test for functional behavior
      • Test for performance
      • Analyze results
      • Reuse and re-run tests
    • Single request
    • HTTP Authentication
    • OAuth Authentication
    • Correlation and Dynamic Data
    • Data parameterization
    • Parse HTML
    • HTML Forms
    • Cookies Example
    • Data Uploads
    • API CRUD Operations
    • Generating UUIDs
    • HTTP2
    • WebSockets
    • SOAP
    • Transport Layer Security (TLS)
    • Generating realistic data
    • Crawl a web page
    • Bundling and transpilation
    • Functional testing
    • Track transmitted data per URL
    • URLs with query parameters
    • Instant load increase
    • Get timings for an HTTP metric
    • Distribute workloads across VUs
    • Error handler
    • Tutorials
  • Misc
    • Integrations & Tools
    • Usage collection
    • IntelliSense
    • Fine-tuning OS
    • Archive Command
    • Release notes
    • Glossary
  • Copyright notice
Scroll for more

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Documentationbreadcrumb arrow Grafana k6breadcrumb arrow Examples
Open source RSS

Examples

  • Get started with k6
  • Single request
  • HTTP Authentication
  • OAuth Authentication
  • Correlation and Dynamic Data
  • Data parameterization
  • Parse HTML
  • HTML Forms
  • Cookies Example
  • Data Uploads
  • API CRUD Operations
  • Generating UUIDs
  • HTTP2
  • WebSockets
  • SOAP
  • Transport Layer Security (TLS)
  • Generating realistic data
  • Crawl a web page
  • Bundling and transpilation
  • Functional testing
  • Track transmitted data per URL
  • URLs with query parameters
  • Instant load increase
  • Get timings for an HTTP metric
  • Distribute workloads across VUs
  • Error handler
  • Tutorials

Was this page helpful?

Create a GitHub issue
Email docs@grafana.com
Help and support
Community

Related resources from Grafana Labs

Additional helpful documentation, links, and articles:
video icon
Video
Performance testing and observability in Grafana Cloud
Performance testing and observability in Grafana Cloud
Optimize user experiences with Grafana Cloud. Learn real-time insights, performance testing with k6, and continuous validation with Synthetic Monitoring.
video icon
Events
User-centered observability: load testing, real user monitoring, and synthetics
User-centered observability: load testing, real user monitoring, and synthetics
Learn how to use load testing, synthetic monitoring, and real user monitoring (RUM) to understand end users' experience of your apps. Watch on demand.

Is this page helpful?

Still have questions?

Ask your questions. Let AI do the heavy lifting.

Ask AI icon
Newsletter icon

Get every update

Subscribe to our newsletter

By submitting, you agree to our Privacy policy

Grafana Cloud

  • Overview
  • Pricing
  • What's in the free tier?
  • AI Assistant
  • Application Observability
  • Kubernetes Monitoring
  • Dashboards & Visualization
  • Database Observability
  • Frontend Observability
  • Synthetic Monitoring
  • Performance & Load Testing
  • Incident Response & Management
  • What’s New
  • Grafana Cloud Status

Solutions

  • AI Observability
  • Full-Stack Observability
  • Infrastructure & Cloud Observability
  • Digital Experience Monitoring
  • Scaled Prometheus
  • Cost Management & Optimization
  • Site Reliability
  • Log Management
  • Migrate to OpenTelemetry

Integrations

  • All Integrations
  • AWS
  • Google Cloud
  • Microsoft Azure
  • Kubernetes
  • Datadog
  • New Relic

Open Source

  • Our Projects
  • GitHub
  • Downloads
  • Dashboard Templates

Learn

  • Documentation
  • Blog
  • Community
  • Events
  • Observability Survey & Reports

Company

  • About Grafana Labs
  • Open Positions
  • Partnerships
  • Newsroom
  • Success Stories
  • Contact Us
  • Getting Help
  • Professional Services
  • Hey AI

Compare

  • Datadog vs. Grafana Labs
  • Dynatrace vs Grafana Cloud
  • Elasticsearch vs Grafana Cloud
  • New Relic vs Grafana Cloud
  • PagerDuty vs Grafana Cloud
  • Splunk vs Grafana Cloud
Grafana Labs x unique logomark

Donut take our word for it. Try Grafana Cloud today.

Grafana Cloud StatusLegal & SecurityTerms of ServicePrivacy PolicyTrademark Policy

Copyright 2026 © Grafana Labs

FacebookXLinkedinGithubYoutubeReddit
Grafana Labs uses cookies for the normal operation of this website. Learn more.