From ed4d70d379d0ee9d2686c935108f9d48510191c1 Mon Sep 17 00:00:00 2001 From: Spencer Judge Date: Thu, 18 Jun 2026 16:54:58 -0700 Subject: [PATCH 1/3] Add runtime type information to worker heartbeats --- temporal/api/worker/v1/message.proto | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/temporal/api/worker/v1/message.proto b/temporal/api/worker/v1/message.proto index a87142c78..875ce9e1d 100644 --- a/temporal/api/worker/v1/message.proto +++ b/temporal/api/worker/v1/message.proto @@ -130,6 +130,10 @@ message WorkerHeartbeat { // Storage drivers in use by this SDK. repeated StorageDriverInfo drivers = 24; + + // Runtime environments in use by this SDK. Often will only be one of these, but it's allowed to + // be repeated for scenarios like "Python inside a Lambda". + repeated RuntimeInfo runtimes = 25; } // Detailed worker information. @@ -194,6 +198,25 @@ message StorageDriverInfo { string type = 1; } +message RuntimeInfo { + enum RuntimeType { + RUNTIME_TYPE_UNSPECIFIED = 0; + RUNTIME_TYPE_JVM = 1; + RUNTIME_TYPE_PYTHON = 2; + RUNTIME_TYPE_NODE = 3; + RUNTIME_TYPE_BUN = 4; + RUNTIME_TYPE_RUBY = 5; + RUNTIME_TYPE_GO = 6; + RUNTIME_TYPE_DOCKER = 7; + RUNTIME_TYPE_LAMBDA = 8; + RUNTIME_TYPE_GCR = 9; + } + // The type of the runtime. + RuntimeType type = 1; + // The version of the runtime. + string version = 2; +} + // A command sent from the server to a worker. message WorkerCommand { oneof type { From f36da6e5dc265ec3f0f54ada76f745fabc398db8 Mon Sep 17 00:00:00 2001 From: Spencer Judge Date: Mon, 22 Jun 2026 14:40:35 -0700 Subject: [PATCH 2/3] Update with more comprehensive info --- temporal/api/worker/v1/message.proto | 109 ++++++++++++++++++++++----- 1 file changed, 90 insertions(+), 19 deletions(-) diff --git a/temporal/api/worker/v1/message.proto b/temporal/api/worker/v1/message.proto index 875ce9e1d..5a319e5fc 100644 --- a/temporal/api/worker/v1/message.proto +++ b/temporal/api/worker/v1/message.proto @@ -131,9 +131,8 @@ message WorkerHeartbeat { // Storage drivers in use by this SDK. repeated StorageDriverInfo drivers = 24; - // Runtime environments in use by this SDK. Often will only be one of these, but it's allowed to - // be repeated for scenarios like "Python inside a Lambda". - repeated RuntimeInfo runtimes = 25; + // Information about the environment this SDK is running in. + EnvironmentInfo environment = 25; } // Detailed worker information. @@ -198,23 +197,95 @@ message StorageDriverInfo { string type = 1; } -message RuntimeInfo { - enum RuntimeType { - RUNTIME_TYPE_UNSPECIFIED = 0; - RUNTIME_TYPE_JVM = 1; - RUNTIME_TYPE_PYTHON = 2; - RUNTIME_TYPE_NODE = 3; - RUNTIME_TYPE_BUN = 4; - RUNTIME_TYPE_RUBY = 5; - RUNTIME_TYPE_GO = 6; - RUNTIME_TYPE_DOCKER = 7; - RUNTIME_TYPE_LAMBDA = 8; - RUNTIME_TYPE_GCR = 9; +message EnvironmentInfo { + message Runtime { + enum RuntimeType { + RUNTIME_TYPE_UNSPECIFIED = 0; + RUNTIME_TYPE_JVM = 1; + RUNTIME_TYPE_PYTHON = 2; + RUNTIME_TYPE_NODE = 3; + RUNTIME_TYPE_BUN = 4; + RUNTIME_TYPE_RUBY = 5; + RUNTIME_TYPE_GO = 6; + RUNTIME_TYPE_DOTNET_FRAMEWORK = 7; + RUNTIME_TYPE_DOTNET_CORE = 8; + } + // The type of the runtime. + RuntimeType type = 1; + // The version of the runtime, if obtainable. + string version = 2; + } + + message HostingEnvironment { + enum HostingEnvironmentType { + HOSTING_ENVIRONMENT_TYPE_UNSPECIFIED = 0; + HOSTING_ENVIRONMENT_TYPE_DOCKER = 1; + HOSTING_ENVIRONMENT_TYPE_AWS_LAMBDA = 2; + HOSTING_ENVIRONMENT_TYPE_GOOGLE_CLOUD_RUN = 3; + } + // The type of hosting environment. + HostingEnvironmentType type = 1; + // The version of the hosting environment, if obtainable. + string version = 2; + } + + enum Architecture { + ARCHITECTURE_UNSPECIFIED = 0; + ARCHITECTURE_AMD64 = 1; + ARCHITECTURE_ARM64 = 2; + } + + message Platform { + oneof variant { + LinuxPlatform linux = 1; + MacOSPlatform macos = 2; + WindowsPlatform windows = 3; + } } - // The type of the runtime. - RuntimeType type = 1; - // The version of the runtime. - string version = 2; + + message LinuxPlatform { + enum Libc { + LIBC_UNSPECIFIED = 0; + LIBC_GLIBC = 1; + LIBC_MUSL = 2; + } + // The Linux kernel or distribution version, if obtainable. + string version = 1; + // The architecture of the worker process. + Architecture architecture = 2; + // The libc used by the worker process. + Libc libc = 3; + } + + message MacOSPlatform { + // The macOS version, if obtainable. + string version = 1; + // The architecture of the worker process. + Architecture architecture = 2; + } + + message WindowsPlatform { + enum Crt { + CRT_UNSPECIFIED = 0; + CRT_UCRT = 1; + CRT_MSVCRT = 2; + CRT_MINGW = 3; + CRT_CYGWIN = 4; + } + // The Windows version, if obtainable. + string version = 1; + // The architecture of the worker process. + Architecture architecture = 2; + // The C runtime used by the worker process, if obtainable. + Crt crt = 3; + } + + // The runtime(s) the SDK is operating in. + repeated Runtime runtimes = 1; + // The hosting environment(s) the SDK is operating in. + repeated HostingEnvironment hosting_environments = 2; + // The platform the SDK is operating on. + Platform platform = 3; } // A command sent from the server to a worker. From f1377e0862b1f39cd5e1f2e83444b46b1002c475 Mon Sep 17 00:00:00 2001 From: Spencer Judge Date: Wed, 24 Jun 2026 11:22:01 -0700 Subject: [PATCH 3/3] Update hosting environments with more complete list and method of detection --- temporal/api/worker/v1/message.proto | 33 +++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/temporal/api/worker/v1/message.proto b/temporal/api/worker/v1/message.proto index 5a319e5fc..05c9e5b45 100644 --- a/temporal/api/worker/v1/message.proto +++ b/temporal/api/worker/v1/message.proto @@ -200,15 +200,19 @@ message StorageDriverInfo { message EnvironmentInfo { message Runtime { enum RuntimeType { + // Should never actually be set, exists to follow convention of having a default. + // SDKs should just leave `runtimes` empty if none can be determined. RUNTIME_TYPE_UNSPECIFIED = 0; RUNTIME_TYPE_JVM = 1; - RUNTIME_TYPE_PYTHON = 2; + RUNTIME_TYPE_CPYTHON = 2; RUNTIME_TYPE_NODE = 3; RUNTIME_TYPE_BUN = 4; - RUNTIME_TYPE_RUBY = 5; + RUNTIME_TYPE_CRUBY = 5; RUNTIME_TYPE_GO = 6; RUNTIME_TYPE_DOTNET_FRAMEWORK = 7; RUNTIME_TYPE_DOTNET_CORE = 8; + RUNTIME_TYPE_NATIVE = 9; + RUNTIME_TYPE_ROADRUNNER = 10; } // The type of the runtime. RuntimeType type = 1; @@ -217,11 +221,30 @@ message EnvironmentInfo { } message HostingEnvironment { + // What kind of hosting environment we're running in. This list is about what can actually be + // detected reliably and is unrelated to what SDKs can actually run in. enum HostingEnvironmentType { + // Should never actually be set, exists to follow convention of having a default. + // SDKs should just leave `hosting_environments` empty if none can be determined. HOSTING_ENVIRONMENT_TYPE_UNSPECIFIED = 0; + // Should always be in the list if we're running inside a docker container HOSTING_ENVIRONMENT_TYPE_DOCKER = 1; - HOSTING_ENVIRONMENT_TYPE_AWS_LAMBDA = 2; - HOSTING_ENVIRONMENT_TYPE_GOOGLE_CLOUD_RUN = 3; + // Should always be in the list if we're running inside any k8s environment + HOSTING_ENVIRONMENT_TYPE_K8S = 2; + // Detect via `AWS_LAMBDA_FUNCTION_NAME` + HOSTING_ENVIRONMENT_TYPE_AWS_LAMBDA = 3; + // Detect via `ECS_CONTAINER_METADATA_URI_V4` or `ECS_CONTAINER_METADATA_URI` + HOSTING_ENVIRONMENT_TYPE_AWS_ECS = 4; + // Detect via `K_SERVICE` + HOSTING_ENVIRONMENT_TYPE_GOOGLE_CLOUD_RUN = 6; + // Detect via `GAE_SERVICE` + HOSTING_ENVIRONMENT_TYPE_GOOGLE_APP_ENGINE = 7; + // Detect via `WEBSITE_SITE_NAME` + HOSTING_ENVIRONMENT_TYPE_AZURE_APP_SERVICE = 8; + // Detect via `FUNCTIONS_EXTENSION_VERSION` + HOSTING_ENVIRONMENT_TYPE_AZURE_FUNCTIONS = 9; + // Detect via `CONTAINER_APP_NAME` + HOSTING_ENVIRONMENT_TYPE_AZURE_CONTAINER_APPS = 10; } // The type of hosting environment. HostingEnvironmentType type = 1; @@ -282,7 +305,7 @@ message EnvironmentInfo { // The runtime(s) the SDK is operating in. repeated Runtime runtimes = 1; - // The hosting environment(s) the SDK is operating in. + // The hosting environment(s) the SDK is operating in. Repeated to allow for layering (ex: Docker inside k8s). repeated HostingEnvironment hosting_environments = 2; // The platform the SDK is operating on. Platform platform = 3;