Environment Variables

PORT

The port to listen on. Defaults to 3003.

PROMETHEUS_EXPORTER_PORT

The port to listen on for Prometheus metrics. Defaults to 3004. Added in rizio/code-interpreter:0.6.0

RIZA_LICENSE_KEY

The license key to validate on startup. If the license is invalid, riza serve will return an error.

RIZA_API_KEY

The API key to use when talking to the Riza API. This is only necessary when using custom runtimes.

RIZA_SERVE_CONCURRENCY

The maximum number of concurrent requests to handle. When set, reqeusts will be processed in the order in which they’re receieved. By default there is no limit set.

TOKIO_WORKER_THREADS

The number of Tokio “core threads” to spawn. See https://docs.rs/tokio/latest/tokio/#cpu-bound-tasks-and-blocking-code for more information.

RIZA_SERVE_WORKERS

The number of Riza worker threads to run, for handling JavaScript executions in a custom runtime. Defaults to TOKIO_WORKER_THREADS divided by two.
Only applies when running Riza with a JavaScript custom runtime
Added in rizio/code-interpreter:0.4.6

RIZA_SERVE_QUEUE_SIZE

The size of the work queue shared among workers. Defaults to the number of workers.
Only applies when running Riza with a JavaScript custom runtime
Added in rizio/code-interpreter:0.5.0

RIZA_SERVE_QUEUE_SEND_TIMEOUT

The amount of time (in seconds) to wait for an item to be added to the work queue. If the timeout is reached, the server will send a 429 Too Many Requests response. If set to 0, return 429 Too Many Requests if the queue is full. Defaults to 5 (seconds).
Only applies when running Riza with a JavaScript custom runtime
Added in rizio/code-interpreter:0.5.0

Liveness and Readiness Endpoints

Use the /livez and /readyz endpoints for liveness and readiness probes when deploying into a Kubernetes cluster.

Prometheus Metrics Endpoint

The /metrics endpoint responds to requests with the following metrics:

http_requests_total

A counter for each HTTP request, grouped by {method, path, status}.
# TYPE http_requests_total counter
http_requests_total{path="/v1/execute",method="post",code="429"} 280 1741728377372
http_requests_total{path="/v1/execute",method="post",code="200"} 340 1741728377372

http_requests_inflight

A gauge for the number of current HTTP requests, including liveness and readiness probes and the metrics endpoint itself.
# TYPE http_requests_inflight gauge
http_requests_inflight 76 1741728377372

worker_queue_size

A gauge for the size of the worker queue.
# TYPE worker_queue_size gauge
worker_queue_size 10 1741728377372

num_workers

A gauge for the number of workers.
# TYPE num_workers gauge
num_workers 5 1741728377372

work_items_queued

A gauge for the number of work items waiting for a spot in the queue.
# TYPE work_items_queued gauge
work_items_queued 65 1741728377372

work_items_inflight

A gauge for the number of inflight work items, which includes items waiting for a spot in the queue.
# TYPE work_items_inflight gauge
work_items_inflight 75 1741728377372