Skip to content

Commit 29b66d8

Browse files
authored
workflows: add start tracing and match sampling (#109)
Signed-off-by: Matt Klein <mklein@bitdrift.io>
1 parent 5dc5730 commit 29b66d8

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/bitdrift_public/protobuf/matcher/v1/log_matcher.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,19 @@ message LogMatcher {
5555
state.v1.StateValueMatch state_value_match = 3 [(validate.rules).message.required = true];
5656
}
5757

58+
message SampledMatch {
59+
// The % chance that a match will occur. This is the numerator of the percentage, with the
60+
// denominator being 1,000,000. For example, if the value is 10,000, then 1% of matches will
61+
// be sampled.
62+
uint32 sample_rate = 1;
63+
}
64+
5865
oneof match_type {
5966
option (validate.required) = true;
6067
MessageMatch message_match = 1;
6168
TagMatch tag_match = 2;
6269
StateMatch state_match = 4;
70+
SampledMatch sampled_match = 5;
6371
}
6472

6573
reserved 3;

src/bitdrift_public/protobuf/workflow/v1/workflow.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,14 @@ message Workflow {
190190
ActionEmitSankeyDiagram action_emit_sankey_diagram = 3;
191191
ActionTakeScreenshot action_take_screenshot = 4;
192192
ActionGenerateLog action_generate_log = 5;
193+
ActionStartTracing action_start_tracing = 6;
193194
}
194195

196+
// Specifies that the current session will start trace sampling. Tracing will stop when the
197+
// workflow run ends. The exception to this is if the run results in a flush. If this happens,
198+
// tracing will stay on until flush streaming completes.
199+
message ActionStartTracing {}
200+
195201
// Generates a new log message. This log will be injected into the workflow engine and processed
196202
// like any other log, either by this workflow or by another workflow.
197203
message ActionGenerateLog {

0 commit comments

Comments
 (0)