Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/k6/next/javascript-api/k6-net-grpc/params.md, or by sending Accept: text/markdown to https://grafana.com/docs/k6/next/javascript-api/k6-net-grpc/params/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
Params
Params is an object used by the gRPC methods that generate RPC requests. Params contains request-specific options like headers that should be inserted into the request.
| Name | Type | Description |
|---|---|---|
Params.authority | string | Specifies the value of the :authority pseudo-header and as the server name in authentication handshake. If missing this is derived from the hostname. |
Params.discardResponseMessage | boolean | Specify if response messages should be discarded. This reduces the amount of memory required, and the amount of garbage collection, which reduces the load on the testing machine and can help produce more reliable test results. Default is false. |
Params.metadata | object | Object with key-value pairs representing custom metadata the user would like to add to the request. Values of keys ending with -bin will be treated as binary data. |
Params.tags | object | Key-value pairs where the keys are names of tags and the values are tag values. Response time metrics generated as a result of the request will have these tags added to them, allowing the user to filter out those results specifically, when looking at results data. |
Params.timeout | string / number | Request timeout to use. Default timeout is 60 seconds ("60s").The type can also be a number, in which case k6 interprets it as milliseconds, e.g., 60000 is equivalent to "60s". |
Example of custom metadata headers and tags
import grpc from 'k6/net/grpc';
const client = new grpc.Client();
client.load([], 'route_guide.proto');
export default function () {
const req = {
latitude: 410248224,
longitude: -747127767,
};
const params = {
metadata: {
'x-my-header': 'k6test',
'x-my-header-bin': new Uint8Array([1, 2, 3]),
},
tags: { k6test: 'yes' },
};
const response = client.invoke('main.RouteGuide/GetFeature', req, params);
}Was this page helpful?
Related resources from Grafana Labs

