Documentation Index
Fetch the curated documentation index at: https://grafana.com/llms.txt
Fetch the complete documentation index at: https://grafana.com/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: https://grafana.com/docs/k6/next/javascript-api/k6-net-grpc/constants.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/k6/next/javascript-api/k6-net-grpc/constants/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use https://grafana.com/llms-full.txt.
Menu
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
Open source
Constants
Define constants to distinguish between gRPC Response statuses.
| Constant | Description |
|---|---|
StatusOK | OK is returned on success. |
StatusCanceled | Canceled indicates the operation was canceled (typically by the caller). |
StatusUnknown | Unknown error. |
StatusInvalidArgument | InvalidArgument indicates the client specified an invalid argument. |
StatusDeadlineExceeded | DeadlineExceeded means operation expired before completion. |
StatusNotFound | NotFound means some requested entity (e.g., file or directory) was not found. |
StatusAlreadyExists | AlreadyExists means an attempt to create an entity failed because one already exists. |
StatusPermissionDenied | PermissionDenied indicates the caller does not have permission to execute the specified operation. |
StatusResourceExhausted | ResourceExhausted indicates some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. |
StatusFailedPrecondition | FailedPrecondition indicates operation was rejected because the system is not in a state required for the operation’s execution. |
StatusAborted | Aborted indicates the operation was aborted, typically due to a concurrency issue like sequencer check failures, transaction aborts, etc. |
StatusOutOfRange | OutOfRange means operation was attempted past the valid range. E.g., seeking or reading past end of file. |
StatusUnimplemented | Unimplemented indicates operation is not implemented or not supported/enabled in this service. |
StatusInternal | Internal errors. Means some invariants expected by the underlying system have been broken. |
StatusUnavailable | Unavailable indicates the service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations. |
StatusDataLoss | DataLoss indicates unrecoverable data loss or corruption. |
StatusUnauthenticated | Unauthenticated indicates the request does not have valid authentication credentials for the operation. |
Example
JavaScript
import grpc from 'k6/net/grpc';
import { check, sleep } from 'k6';
const client = new grpc.Client();
client.load(null, 'quickpizza.proto');
export default () => {
client.connect('grpc-quickpizza.grafana.com:443', {
// plaintext: false
});
const data = { ingredients: ['Cheese'], dough: 'Thick' };
const response = client.invoke('quickpizza.GRPC/RatePizza', data);
check(response, {
'status is OK': (r) => r && r.status === grpc.StatusOK,
});
client.close();
sleep(1);
};Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
Video

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.
Events

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.
Choose a product
Viewing: next
Find another version
Scroll for more