@@ -26,21 +26,21 @@ message StreamingMessage {
26
26
oneof content {
27
27
28
28
// Worker initiates stream
29
- StartStream start_stream = 20 ;
29
+ StartStream start_stream = 20 ;
30
30
31
31
// Host sends capabilities/init data to worker
32
32
WorkerInitRequest worker_init_request = 17 ;
33
33
// Worker responds after initializing with its capabilities & status
34
34
WorkerInitResponse worker_init_response = 16 ;
35
-
35
+
36
36
// Worker periodically sends empty heartbeat message to host
37
37
WorkerHeartbeat worker_heartbeat = 15 ;
38
38
39
39
// Host sends terminate message to worker.
40
40
// Worker terminates if it can, otherwise host terminates after a grace period
41
41
WorkerTerminate worker_terminate = 14 ;
42
42
43
- // Add any worker relevant status to response
43
+ // Host periodically sends status request to the worker
44
44
WorkerStatusRequest worker_status_request = 12 ;
45
45
WorkerStatusResponse worker_status_response = 13 ;
46
46
@@ -49,25 +49,25 @@ message StreamingMessage {
49
49
50
50
// Worker requests a desired action (restart worker, reload function)
51
51
WorkerActionResponse worker_action_response = 7 ;
52
-
52
+
53
53
// Host sends required metadata to worker to load function
54
54
FunctionLoadRequest function_load_request = 8 ;
55
55
// Worker responds after loading with the load result
56
56
FunctionLoadResponse function_load_response = 9 ;
57
-
57
+
58
58
// Host requests a given invocation
59
59
InvocationRequest invocation_request = 4 ;
60
60
61
61
// Worker responds to a given invocation
62
62
InvocationResponse invocation_response = 5 ;
63
63
64
- // Host sends cancel message to attempt to cancel an invocation.
64
+ // Host sends cancel message to attempt to cancel an invocation.
65
65
// If an invocation is cancelled, host will receive an invocation response with status cancelled.
66
66
InvocationCancel invocation_cancel = 21 ;
67
67
68
68
// Worker logs a message back to the host
69
69
RpcLog rpc_log = 2 ;
70
-
70
+
71
71
FunctionEnvironmentReloadRequest function_environment_reload_request = 25 ;
72
72
73
73
FunctionEnvironmentReloadResponse function_environment_reload_response = 26 ;
@@ -91,15 +91,15 @@ message StreamingMessage {
91
91
// Process.Start required info
92
92
// connection details
93
93
// protocol type
94
- // protocol version
94
+ // protocol version
95
95
96
96
// Worker sends the host information identifying itself
97
97
message StartStream {
98
98
// id of the worker
99
99
string worker_id = 2 ;
100
100
}
101
101
102
- // Host requests the worker to initialize itself
102
+ // Host requests the worker to initialize itself
103
103
message WorkerInitRequest {
104
104
// version of the host sending init request
105
105
string host_version = 1 ;
@@ -120,13 +120,35 @@ message WorkerInitRequest {
120
120
121
121
// Worker responds with the result of initializing itself
122
122
message WorkerInitResponse {
123
- // Version of worker
123
+ // NOT USED
124
+ // TODO: Remove from protobuf during next breaking change release
124
125
string worker_version = 1 ;
126
+
125
127
// A map of worker supported features/capabilities
126
128
map <string , string > capabilities = 2 ;
127
129
128
130
// Status of the response
129
131
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 ;
130
152
}
131
153
132
154
// Used by the host to determine success/failure/cancellation
@@ -137,6 +159,7 @@ message StatusResult {
137
159
Success = 1 ;
138
160
Cancelled = 2 ;
139
161
}
162
+
140
163
// Status for the given result
141
164
Status status = 4 ;
142
165
@@ -150,9 +173,8 @@ message StatusResult {
150
173
repeated RpcLog logs = 3 ;
151
174
}
152
175
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
156
178
message WorkerHeartbeat {}
157
179
158
180
// Warning before killing the process after grace_period
@@ -185,24 +207,25 @@ message FileChangeEventRequest {
185
207
186
208
// Indicates whether worker reloaded successfully or needs a restart
187
209
message WorkerActionResponse {
188
- // indicates whether a restart is needed, or reload succesfully
210
+ // indicates whether a restart is needed, or reload successfully
189
211
enum Action {
190
212
Restart = 0 ;
191
213
Reload = 1 ;
192
214
}
193
-
215
+
194
216
// action for this response
195
217
Action action = 1 ;
196
218
197
219
// text reason for the response
198
220
string reason = 2 ;
199
221
}
200
222
201
- // NOT USED
202
- message WorkerStatusRequest {
223
+ // Used by the host to determine worker health
224
+ message WorkerStatusRequest {
203
225
}
204
226
205
- // NOT USED
227
+ // Worker responds with status message
228
+ // TODO: Add any worker relevant status to response
206
229
message WorkerStatusResponse {
207
230
}
208
231
@@ -271,7 +294,7 @@ message RpcFunctionMetadata {
271
294
272
295
// base directory for the Function
273
296
string directory = 1 ;
274
-
297
+
275
298
// Script file specified
276
299
string script_file = 2 ;
277
300
@@ -298,6 +321,11 @@ message RpcFunctionMetadata {
298
321
299
322
// A flag indicating if managed dependency is enabled or not
300
323
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 ;
301
329
}
302
330
303
331
// Host tells worker it is ready to receive metadata
@@ -492,7 +520,7 @@ message BindingInfo {
492
520
DataType data_type = 4 ;
493
521
}
494
522
495
- // Used to send logs back to the Host
523
+ // Used to send logs back to the Host
496
524
message RpcLog {
497
525
// Matching ILogger semantics
498
526
// https://github.com/aspnet/Logging/blob/9506ccc3f3491488fe88010ef8b9eb64594abf95/src/Microsoft.Extensions.Logging/Logger.cs
@@ -543,7 +571,7 @@ message RpcLog {
543
571
map <string , TypedData > propertiesMap = 9 ;
544
572
}
545
573
546
- // Encapsulates an Exception
574
+ // Encapsulates an Exception
547
575
message RpcException {
548
576
// Source of the exception
549
577
string source = 3 ;
@@ -553,6 +581,14 @@ message RpcException {
553
581
554
582
// Textual message describing the exception
555
583
string message = 2 ;
584
+
585
+ // Worker specifies whether exception is a user exception,
586
+ // for purpose of application insights logging. Defaults to false.
587
+ bool is_user_exception = 4 ;
588
+
589
+ // Type of exception. If it's a user exception, the type is passed along to app insights.
590
+ // Otherwise, it's ignored for now.
591
+ string type = 5 ;
556
592
}
557
593
558
594
// Http cookie type. Note that only name and value are used for Http requests
@@ -597,7 +633,7 @@ message RpcHttpCookie {
597
633
// TODO - solidify this or remove it
598
634
message RpcHttp {
599
635
string method = 1 ;
600
- string url = 2 ;
636
+ string url = 2 ;
601
637
map <string ,string > headers = 3 ;
602
638
TypedData body = 4 ;
603
639
map <string ,string > params = 10 ;
0 commit comments