Skip to content

Commit f4bedd8

Browse files
committed
mux: debug data API
Introduce a debugging specific mux request/response. Move bd tail control into this message vs. including it in the configuration update. Signed-off-by: Matt Klein <mklein@bitdrift.io>
1 parent f5219a3 commit f4bedd8

File tree

1 file changed

+56
-7
lines changed
  • src/bitdrift_public/protobuf/client/v1

1 file changed

+56
-7
lines changed

src/bitdrift_public/protobuf/client/v1/api.proto

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ message HandshakeRequest {
4141
// TODO(snowp): Improve the story for this when parameters change during a
4242
// logging period, e.g. if we capture multiple process restarts that may span
4343
// versions.
44-
map<string, bitdrift_public.protobuf.logging.v1.Data> static_device_metadata = 1;
44+
map<string, logging.v1.Data> static_device_metadata = 1;
4545

4646
// This was never used by the client. Reserve it for now to avoid implementing it. We can bring
4747
// it back later if needed.
@@ -146,6 +146,11 @@ message LogUploadRequest {
146146

147147
// The UUID (v4) of the buffer that is producing the logs.
148148
string buffer_uuid = 3 [(validate.rules).string = {min_len: 1}];
149+
150+
// Whether the server should not respond to this upload. This is used for high
151+
// throughput, low value logs where the client does not need to know whether
152+
// the upload succeeded or failed.
153+
bool ackless = 4;
149154
}
150155

151156
// Empty message to maintain a application layer keep alive mechanism.
@@ -195,6 +200,8 @@ message ApiRequest {
195200
SankeyIntentRequest sankey_intent = 11;
196201
UploadArtifactRequest artifact_upload = 12;
197202
UploadArtifactIntentRequest artifact_intent = 13;
203+
ConfigurationUpdateAck debug_control_ack = 14;
204+
DebugDataRequest debug_data = 15;
198205
}
199206

200207
reserved 8;
@@ -289,7 +296,7 @@ message UploadArtifactRequest {
289296

290297
// An optional set of key-value data indicating the state of the device at the time of artifact emission. For example,
291298
// this may capture information about the device at the time of a crash.
292-
map<string, bitdrift_public.protobuf.logging.v1.Data> state_metadata = 5;
299+
map<string, logging.v1.Data> state_metadata = 5;
293300

294301
// The timestamp associated with this upload. This allows us to possibly reject the upload of very old artifacts.
295302
google.protobuf.Timestamp time = 6 [(validate.rules).message = {required: true}];
@@ -425,19 +432,19 @@ message ConfigurationUpdate {
425432
reserved 2;
426433

427434
// The list of buffers.
428-
bitdrift_public.protobuf.config.v1.BufferConfigList buffer_config_list = 3;
435+
config.v1.BufferConfigList buffer_config_list = 3;
429436

430437
// The workflows configuration.
431-
bitdrift_public.protobuf.workflow.v1.WorkflowsConfiguration workflows_configuration = 4;
438+
workflow.v1.WorkflowsConfiguration workflows_configuration = 4;
432439

433-
// The list of active bdtail sessions.
434-
bitdrift_public.protobuf.bdtail.v1.BdTailConfigurations bdtail_configuration = 6;
440+
reserved "bdtail_configuration";
441+
reserved 6;
435442

436443
reserved "insights_configuration";
437444
reserved 7;
438445

439446
// The filters configuration.
440-
bitdrift_public.protobuf.filter.v1.FiltersConfiguration filters_configuration = 8;
447+
filter.v1.FiltersConfiguration filters_configuration = 8;
441448
}
442449

443450
// A version nonce that can be used for both tracking the last applied update as well as for
@@ -516,6 +523,47 @@ message SankeyIntentResponse {
516523
}
517524
}
518525

526+
// Debug data that is periodically sent when instructed via the DebugControlResponse message.
527+
message DebugDataRequest {
528+
message WorkflowStateDebugData {
529+
// The ID of the state being reported on.
530+
string state_id = 1;
531+
532+
// The number of times this state has been transitioned into.
533+
uint64 transition_count = 2;
534+
535+
// The last time this state was transitioned into.
536+
google.protobuf.Timestamp last_transition_time = 3;
537+
}
538+
539+
message WorkflowDebugData {
540+
// The ID of the workflow being debugged.
541+
string workflow_id = 1;
542+
543+
// The state debug data for each state in the workflow that has been transitioned.
544+
repeated WorkflowStateDebugData states = 2;
545+
}
546+
547+
// If instructed to debug workflows, this will contain the debug data for each workflow being
548+
// debugged.
549+
repeated WorkflowDebugData workflow_debug_data = 1;
550+
}
551+
552+
// This is the state of the world for debug instructions for the client. The client is not meant
553+
// to cache any debug instructions locally. They should be cleaned up when the client restarts and
554+
// the server is always meant to send any pertinent debug instructions on stream creation.
555+
message DebugControlUpdate {
556+
// The list of active bdtail sessions. Logs will be sent via the LogUploadRequest message in
557+
// "ackless" mode. This is meant to optimize for throughput vs. reliability.
558+
bdtail.v1.BdTailConfigurations bdtail_configuration = 1;
559+
560+
// The list of workflows to debug. If the workflow is already deployed, debug data will be
561+
// generated for it alongside the deployed workflow. If the workflow is not deployed, the workflow
562+
// will be executed in debug mode, however actions will *not* be executed (metrics, flushes, and
563+
// so on).
564+
workflow.v1.WorkflowsConfiguration debug_workflows = 2;
565+
}
566+
519567
// A multiplexed response sent over the bitdrift API.
520568
message ApiResponse {
521569
oneof response_type {
@@ -534,6 +582,7 @@ message ApiResponse {
534582
SankeyIntentResponse sankey_intent_response = 13;
535583
UploadArtifactResponse artifact_upload = 14;
536584
UploadArtifactIntentResponse artifact_intent = 15;
585+
DebugControlUpdate debug_control = 16;
537586
}
538587

539588
reserved 10;

0 commit comments

Comments
 (0)