diff --git a/temporal/api/worker/v1/message.proto b/temporal/api/worker/v1/message.proto index a87142c78..05c9e5b45 100644 --- a/temporal/api/worker/v1/message.proto +++ b/temporal/api/worker/v1/message.proto @@ -130,6 +130,9 @@ message WorkerHeartbeat { // Storage drivers in use by this SDK. repeated StorageDriverInfo drivers = 24; + + // Information about the environment this SDK is running in. + EnvironmentInfo environment = 25; } // Detailed worker information. @@ -194,6 +197,120 @@ message StorageDriverInfo { string type = 1; } +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_CPYTHON = 2; + RUNTIME_TYPE_NODE = 3; + RUNTIME_TYPE_BUN = 4; + 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; + // The version of the runtime, if obtainable. + string version = 2; + } + + 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; + // 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; + // 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; + } + } + + 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 to allow for layering (ex: Docker inside k8s). + repeated HostingEnvironment hosting_environments = 2; + // The platform the SDK is operating on. + Platform platform = 3; +} + // A command sent from the server to a worker. message WorkerCommand { oneof type {