@@ -26,21 +26,21 @@ message StreamingMessage {
2626 oneof content {
2727
2828 // Worker initiates stream
29- StartStream start_stream = 20 ;
29+ StartStream start_stream = 20 ;
3030
3131 // Host sends capabilities/init data to worker
3232 WorkerInitRequest worker_init_request = 17 ;
3333 // Worker responds after initializing with its capabilities & status
3434 WorkerInitResponse worker_init_response = 16 ;
35-
35+
3636 // Worker periodically sends empty heartbeat message to host
3737 WorkerHeartbeat worker_heartbeat = 15 ;
3838
3939 // Host sends terminate message to worker.
4040 // Worker terminates if it can, otherwise host terminates after a grace period
4141 WorkerTerminate worker_terminate = 14 ;
4242
43- // Add any worker relevant status to response
43+ // Host periodically sends status request to the worker
4444 WorkerStatusRequest worker_status_request = 12 ;
4545 WorkerStatusResponse worker_status_response = 13 ;
4646
@@ -49,25 +49,25 @@ message StreamingMessage {
4949
5050 // Worker requests a desired action (restart worker, reload function)
5151 WorkerActionResponse worker_action_response = 7 ;
52-
52+
5353 // Host sends required metadata to worker to load function
5454 FunctionLoadRequest function_load_request = 8 ;
5555 // Worker responds after loading with the load result
5656 FunctionLoadResponse function_load_response = 9 ;
57-
57+
5858 // Host requests a given invocation
5959 InvocationRequest invocation_request = 4 ;
6060
6161 // Worker responds to a given invocation
6262 InvocationResponse invocation_response = 5 ;
6363
64- // Host sends cancel message to attempt to cancel an invocation.
64+ // Host sends cancel message to attempt to cancel an invocation.
6565 // If an invocation is cancelled, host will receive an invocation response with status cancelled.
6666 InvocationCancel invocation_cancel = 21 ;
6767
6868 // Worker logs a message back to the host
6969 RpcLog rpc_log = 2 ;
70-
70+
7171 FunctionEnvironmentReloadRequest function_environment_reload_request = 25 ;
7272
7373 FunctionEnvironmentReloadResponse function_environment_reload_response = 26 ;
@@ -91,15 +91,15 @@ message StreamingMessage {
9191// Process.Start required info
9292// connection details
9393// protocol type
94- // protocol version
94+ // protocol version
9595
9696// Worker sends the host information identifying itself
9797message StartStream {
9898 // id of the worker
9999 string worker_id = 2 ;
100100}
101101
102- // Host requests the worker to initialize itself
102+ // Host requests the worker to initialize itself
103103message WorkerInitRequest {
104104 // version of the host sending init request
105105 string host_version = 1 ;
@@ -120,13 +120,35 @@ message WorkerInitRequest {
120120
121121// Worker responds with the result of initializing itself
122122message WorkerInitResponse {
123- // Version of worker
123+ // NOT USED
124+ // TODO: Remove from protobuf during next breaking change release
124125 string worker_version = 1 ;
126+
125127 // A map of worker supported features/capabilities
126128 map <string , string > capabilities = 2 ;
127129
128130 // Status of the response
129131 StatusResult result = 3 ;
132+
133+ // Worker metadata captured for telemetry purposes
134+ WorkerMetadata worker_metadata = 4 ;
135+ }
136+
137+ message WorkerMetadata {
138+ // The runtime/stack name
139+ string runtime_name = 1 ;
140+
141+ // The version of the runtime/stack
142+ string runtime_version = 2 ;
143+
144+ // The version of the worker
145+ string worker_version = 3 ;
146+
147+ // The worker bitness/architecture
148+ string worker_bitness = 4 ;
149+
150+ // Optional additional custom properties
151+ map <string , string > custom_properties = 5 ;
130152}
131153
132154// Used by the host to determine success/failure/cancellation
@@ -137,6 +159,7 @@ message StatusResult {
137159 Success = 1 ;
138160 Cancelled = 2 ;
139161 }
162+
140163 // Status for the given result
141164 Status status = 4 ;
142165
@@ -150,9 +173,8 @@ message StatusResult {
150173 repeated RpcLog logs = 3 ;
151174}
152175
153- // TODO: investigate grpc heartbeat - don't limit to grpc implemention
154-
155- // Message is empty by design - Will add more fields in future if needed
176+ // NOT USED
177+ // TODO: Remove from protobuf during next breaking change release
156178message WorkerHeartbeat {}
157179
158180// Warning before killing the process after grace_period
@@ -185,24 +207,25 @@ message FileChangeEventRequest {
185207
186208// Indicates whether worker reloaded successfully or needs a restart
187209message WorkerActionResponse {
188- // indicates whether a restart is needed, or reload succesfully
210+ // indicates whether a restart is needed, or reload successfully
189211 enum Action {
190212 Restart = 0 ;
191213 Reload = 1 ;
192214 }
193-
215+
194216 // action for this response
195217 Action action = 1 ;
196218
197219 // text reason for the response
198220 string reason = 2 ;
199221}
200222
201- // NOT USED
202- message WorkerStatusRequest {
223+ // Used by the host to determine worker health
224+ message WorkerStatusRequest {
203225}
204226
205- // NOT USED
227+ // Worker responds with status message
228+ // TODO: Add any worker relevant status to response
206229message WorkerStatusResponse {
207230}
208231
@@ -271,7 +294,7 @@ message RpcFunctionMetadata {
271294
272295 // base directory for the Function
273296 string directory = 1 ;
274-
297+
275298 // Script file specified
276299 string script_file = 2 ;
277300
@@ -298,6 +321,11 @@ message RpcFunctionMetadata {
298321
299322 // A flag indicating if managed dependency is enabled or not
300323 bool managed_dependency_enabled = 14 ;
324+
325+ // Properties for function metadata
326+ // They're usually specific to a worker and largely passed along to the controller API for use
327+ // outside the host
328+ map <string ,string > Properties = 16 ;
301329}
302330
303331// Host tells worker it is ready to receive metadata
@@ -492,7 +520,7 @@ message BindingInfo {
492520 DataType data_type = 4 ;
493521}
494522
495- // Used to send logs back to the Host
523+ // Used to send logs back to the Host
496524message RpcLog {
497525 // Matching ILogger semantics
498526 // https://github.com/aspnet/Logging/blob/9506ccc3f3491488fe88010ef8b9eb64594abf95/src/Microsoft.Extensions.Logging/Logger.cs
@@ -543,7 +571,7 @@ message RpcLog {
543571 map <string , TypedData > propertiesMap = 9 ;
544572}
545573
546- // Encapsulates an Exception
574+ // Encapsulates an Exception
547575message RpcException {
548576 // Source of the exception
549577 string source = 3 ;
@@ -556,11 +584,11 @@ message RpcException {
556584
557585 // Worker specifies whether exception is a user exception,
558586 // for purpose of application insights logging. Defaults to false.
559- optional bool is_user_exception = 4 ;
587+ bool is_user_exception = 4 ;
560588
561589 // Type of exception. If it's a user exception, the type is passed along to app insights.
562590 // Otherwise, it's ignored for now.
563- optional string type = 5 ;
591+ string type = 5 ;
564592}
565593
566594// Http cookie type. Note that only name and value are used for Http requests
@@ -605,7 +633,7 @@ message RpcHttpCookie {
605633// TODO - solidify this or remove it
606634message RpcHttp {
607635 string method = 1 ;
608- string url = 2 ;
636+ string url = 2 ;
609637 map <string ,string > headers = 3 ;
610638 TypedData body = 4 ;
611639 map <string ,string > params = 10 ;
0 commit comments