Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add Runtime Info API

Open
#58 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api

Research direction

Start with the WIT interface and the generated bindings at stubs/wit_world/imports/compute_runtime.py, then trace how existing Python SDK APIs expose runtime information. Use Viceroy's mock values to verify return types, UUID formatting, boolean behavior, and reasonable numeric results; the work is done when the listed module-level getters are available and tested.

Written by the indexing model from the issue text.

Description

Overview

Add support for Fastly's Compute Runtime API, providing access to resource usage metrics and runtime environment information.

WIT Interface

interface compute-runtime {
  type vcpu-ms = u64;
  type memory-mib = u32;

  get-vcpu-ms: func() -> vcpu-ms;
  get-heap-mib: func() -> memory-mib;
  get-sandbox-id: func() -> string;
  get-hostname: func() -> string;
  get-pop: func() -> string;
  get-region: func() -> string;
  get-cache-generation: func() -> u64;
  get-customer-id: func() -> string;
  get-is-staging: func() -> bool;
  get-service-id: func() -> string;
  get-service-version: func() -> u64;
  get-namespace-id: func() -> string;
}

WIT bindings: stubs/wit_world/imports/compute_runtime.py

API Design

  • Simple function-based module API
  • Functions: vcpu_ms(), heap_usage_mib(), sandbox_id(), hostname(), pop(), region(), etc.
  • All functions are simple getters returning runtime information
  • No resource management needed (stateless queries)
  • Values equivalent to environment variables (FASTLY_HOSTNAME, FASTLY_SERVICE_ID, etc.)

Cross-SDK Comparison: All SDKs provide getter functions for CPU/memory/time info. Rust returns structured types, Go returns primitives, JS returns objects. Python should provide simple module-level getters (get_cpu_time_ns()).

Viceroy Testing

Viceroy provides default/mock values for runtime information. Tests can verify:

  • Function calls return expected types
  • Sandbox ID is a valid UUID format
  • Boolean flags work correctly
  • Numeric values are reasonable

Actual runtime values will differ between Viceroy and production. Tests should focus on API functionality rather than specific values.

Reference

Dominant language
Python
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fastly/compute-sdk-python

All issues in fastly/compute-sdk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.