fabaccess-bffh/runtime/console-api/schema/trace.capnp
Nadja Reitzenstein 0ba44e4a1d make compile
2023-05-05 14:14:33 +02:00

81 lines
1.8 KiB
Cap'n Proto

@0xb021b19fd5986342;
using Common = import "common.capnp";
using Stream = import "streaming.capnp";
interface Trace {
watch @0 (request :WatchRequest, receiver :Stream.Receiver(TraceEvent)) -> (stream :Stream.Sender);
}
struct WatchRequest {
# Start watching trace events with the provided filter
filter @0 :Text;
# Filters which trace events should be streamed
}
struct TraceEvent {
union {
registerThread @0 :RegisterThreads;
# A new thread was registered
registerMetadata @1 :Common.RegisterMetadata;
# A new span metadata was registered
newSpan @2 :Common.Span;
# A span was created
enterSpan @3 :Enter;
# A span was entered
exitSpan @4 :Exit;
# A span was exited
closeSpan @5 :Close;
# A span was closed
}
struct RegisterThreads {
# Signals that a new thread was registered
names @0 :Common.IntMap(Text);
# Maps the registered thread id's to their associated name
}
struct Enter {
# Signals that a span was entered
spanId @0 :Common.SpanId;
# Identified the span that was entered
threadId @1 :UInt64;
# Identifies who entered the span
at @2 :Common.Timestamp;
# Identifies when the span was entered
}
struct Exit {
# Signals that a span was exited
spanId @0 :Common.SpanId;
# Identifies the spawn that was exited
threadId @1 :UInt64;
# Identifies who exited the span
at @2 :Common.Timestamp;
# Identifies when the span was exited
}
struct Close {
# Signals that a span was closed
spanId @0 :Common.SpanId;
# Identifies the span that was closed
at @1 :Common.Timestamp;
# Identifies when the span was closed
}
}