diff --git a/internal/server/mock/trace/stream_traces.go b/internal/server/mock/trace/stream_traces.go index 09da708..8c1c488 100644 --- a/internal/server/mock/trace/stream_traces.go +++ b/internal/server/mock/trace/stream_traces.go @@ -20,32 +20,63 @@ func (s *Server) StreamTraces(_ *pb.StreamTracesRequest, server pb.Trace_StreamT // ~6ms realistic function execution time latency := 6 * time.Millisecond - // Function calls generator with Duration + timestamp - makeFunctionCalls := func(base time.Time) []*pb.TraceFunctionCall { + // Function calls generator, placed relative to the start of the request. + makeFunctionCalls := func() []*pb.TraceFunctionCall { return []*pb.TraceFunctionCall{ { - Name: "PDOStatement::execute", - StartTime: timestamppb.New(base), - Elapsed: durationpb.New(latency), + Name: "PDOStatement::execute", + Offset: durationpb.New(0), + Elapsed: durationpb.New(latency), + Memory: 1048576, }, { - Name: "Drupal\\Core\\Database\\StatementPrefetchIterator::execute", - StartTime: timestamppb.New(base.Add(500 * time.Microsecond)), - Elapsed: durationpb.New(latency), + Name: "Drupal\\Core\\Database\\StatementPrefetchIterator::execute", + Offset: durationpb.New(500 * time.Microsecond), + Elapsed: durationpb.New(latency), + Memory: 2097152, }, { - Name: "Drupal\\sqlite\\Driver\\Database\\sqlite\\Statement::execute", - StartTime: timestamppb.New(base.Add(1 * time.Millisecond)), - Elapsed: durationpb.New(latency), + Name: "Drupal\\sqlite\\Driver\\Database\\sqlite\\Statement::execute", + Offset: durationpb.New(1 * time.Millisecond), + Elapsed: durationpb.New(latency), + Memory: 524288, }, { - Name: "Drupal\\Core\\Database\\Query\\Upsert::execute", - StartTime: timestamppb.New(base.Add(1500 * time.Microsecond)), - Elapsed: durationpb.New(latency), + Name: "Drupal\\Core\\Database\\Query\\Upsert::execute", + Offset: durationpb.New(1500 * time.Microsecond), + Elapsed: durationpb.New(latency), + Memory: 786432, }, } } + makeDrupal := func() *pb.TraceDrupal { + return &pb.TraceDrupal{ + CacheEvents: []*pb.TraceDrupalCacheEvent{ + { + Origin: pb.TraceDrupalCacheOrigin_TRACE_DRUPAL_CACHE_ORIGIN_RENDER_ARRAY, + Caller: "Drupal\\Core\\Render\\Renderer::doRender", + MaxAge: -1, + Tags: []string{"node:1", "node_list"}, + Contexts: []string{"url.path", "user.permissions"}, + Offset: durationpb.New(2 * time.Millisecond), + Calls: 12, + }, + { + Origin: pb.TraceDrupalCacheOrigin_TRACE_DRUPAL_CACHE_ORIGIN_OBJECT, + Caller: "Drupal\\Core\\Cache\\CacheableMetadata::createFromObject", + ObjectType: "Drupal\\node\\Entity\\Node", + MaxAge: 3600, + Tags: []string{"node:1"}, + Contexts: []string{"user.roles"}, + Offset: durationpb.New(4 * time.Millisecond), + Calls: 3, + }, + }, + CacheEventsDropped: 0, + } + } + // Create 3 traces with increasing offsets traces := make([]*pb.Trace, 0, 3) @@ -56,12 +87,20 @@ func (s *Server) StreamTraces(_ *pb.StreamTracesRequest, server pb.Trace_StreamT traces = append(traces, &pb.Trace{ Metadata: &pb.TraceMetadata{ RequestId: gofakeit.UUID(), - Method: http.MethodGet, - Uri: "/sites/default/files/styles/scale_crop_7_3_wide/public/veggie-pasta-bake-hero-umami.jpg.webp?itok=CYsHBUlX", StartTime: timestamppb.New(start), EndTime: timestamppb.New(end), + Source: pb.TraceSource_TRACE_SOURCE_HTTP, + Runtime: pb.TraceRuntime_TRACE_RUNTIME_PHP, + Http: &pb.TraceMetadataHTTP{ + Method: http.MethodGet, + Uri: "/sites/default/files/styles/scale_crop_7_3_wide/public/veggie-pasta-bake-hero-umami.jpg.webp?itok=CYsHBUlX", + }, + }, + FunctionCalls: makeFunctionCalls(), + ResourceUtilisation: &pb.TraceResourceUtilisation{ + MaxMemory: 33554432, }, - FunctionCalls: makeFunctionCalls(start), + Drupal: makeDrupal(), }) } diff --git a/pb/trace.pb.go b/pb/trace.pb.go index 9ade859..d867476 100644 --- a/pb/trace.pb.go +++ b/pb/trace.pb.go @@ -24,6 +24,156 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// The invocation mechanism which produced the trace. +type TraceSource int32 + +const ( + TraceSource_TRACE_SOURCE_UNSPECIFIED TraceSource = 0 + TraceSource_TRACE_SOURCE_HTTP TraceSource = 1 // Trace was collected from a HTTP request. + TraceSource_TRACE_SOURCE_CLI TraceSource = 2 // Trace was collected from the command line interface. +) + +// Enum value maps for TraceSource. +var ( + TraceSource_name = map[int32]string{ + 0: "TRACE_SOURCE_UNSPECIFIED", + 1: "TRACE_SOURCE_HTTP", + 2: "TRACE_SOURCE_CLI", + } + TraceSource_value = map[string]int32{ + "TRACE_SOURCE_UNSPECIFIED": 0, + "TRACE_SOURCE_HTTP": 1, + "TRACE_SOURCE_CLI": 2, + } +) + +func (x TraceSource) Enum() *TraceSource { + p := new(TraceSource) + *p = x + return p +} + +func (x TraceSource) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TraceSource) Descriptor() protoreflect.EnumDescriptor { + return file_trace_proto_enumTypes[0].Descriptor() +} + +func (TraceSource) Type() protoreflect.EnumType { + return &file_trace_proto_enumTypes[0] +} + +func (x TraceSource) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TraceSource.Descriptor instead. +func (TraceSource) EnumDescriptor() ([]byte, []int) { + return file_trace_proto_rawDescGZIP(), []int{0} +} + +// The language runtime which produced the trace. +type TraceRuntime int32 + +const ( + TraceRuntime_TRACE_RUNTIME_UNSPECIFIED TraceRuntime = 0 + TraceRuntime_TRACE_RUNTIME_PHP TraceRuntime = 1 // Trace was collected from a PHP process. + TraceRuntime_TRACE_RUNTIME_NODE TraceRuntime = 2 // Trace was collected from a Node.js process. +) + +// Enum value maps for TraceRuntime. +var ( + TraceRuntime_name = map[int32]string{ + 0: "TRACE_RUNTIME_UNSPECIFIED", + 1: "TRACE_RUNTIME_PHP", + 2: "TRACE_RUNTIME_NODE", + } + TraceRuntime_value = map[string]int32{ + "TRACE_RUNTIME_UNSPECIFIED": 0, + "TRACE_RUNTIME_PHP": 1, + "TRACE_RUNTIME_NODE": 2, + } +) + +func (x TraceRuntime) Enum() *TraceRuntime { + p := new(TraceRuntime) + *p = x + return p +} + +func (x TraceRuntime) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TraceRuntime) Descriptor() protoreflect.EnumDescriptor { + return file_trace_proto_enumTypes[1].Descriptor() +} + +func (TraceRuntime) Type() protoreflect.EnumType { + return &file_trace_proto_enumTypes[1] +} + +func (x TraceRuntime) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TraceRuntime.Descriptor instead. +func (TraceRuntime) EnumDescriptor() ([]byte, []int) { + return file_trace_proto_rawDescGZIP(), []int{1} +} + +// Which Drupal API produced a cache event. +type TraceDrupalCacheOrigin int32 + +const ( + TraceDrupalCacheOrigin_TRACE_DRUPAL_CACHE_ORIGIN_UNSPECIFIED TraceDrupalCacheOrigin = 0 + TraceDrupalCacheOrigin_TRACE_DRUPAL_CACHE_ORIGIN_RENDER_ARRAY TraceDrupalCacheOrigin = 1 // Cacheability was collected from a render array. + TraceDrupalCacheOrigin_TRACE_DRUPAL_CACHE_ORIGIN_OBJECT TraceDrupalCacheOrigin = 2 // Cacheability was collected from an object. +) + +// Enum value maps for TraceDrupalCacheOrigin. +var ( + TraceDrupalCacheOrigin_name = map[int32]string{ + 0: "TRACE_DRUPAL_CACHE_ORIGIN_UNSPECIFIED", + 1: "TRACE_DRUPAL_CACHE_ORIGIN_RENDER_ARRAY", + 2: "TRACE_DRUPAL_CACHE_ORIGIN_OBJECT", + } + TraceDrupalCacheOrigin_value = map[string]int32{ + "TRACE_DRUPAL_CACHE_ORIGIN_UNSPECIFIED": 0, + "TRACE_DRUPAL_CACHE_ORIGIN_RENDER_ARRAY": 1, + "TRACE_DRUPAL_CACHE_ORIGIN_OBJECT": 2, + } +) + +func (x TraceDrupalCacheOrigin) Enum() *TraceDrupalCacheOrigin { + p := new(TraceDrupalCacheOrigin) + *p = x + return p +} + +func (x TraceDrupalCacheOrigin) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TraceDrupalCacheOrigin) Descriptor() protoreflect.EnumDescriptor { + return file_trace_proto_enumTypes[2].Descriptor() +} + +func (TraceDrupalCacheOrigin) Type() protoreflect.EnumType { + return &file_trace_proto_enumTypes[2] +} + +func (x TraceDrupalCacheOrigin) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TraceDrupalCacheOrigin.Descriptor instead. +func (TraceDrupalCacheOrigin) EnumDescriptor() ([]byte, []int) { + return file_trace_proto_rawDescGZIP(), []int{2} +} + // * // Input for StreamTraces. type StreamTracesRequest struct { @@ -129,8 +279,10 @@ type Trace struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Metadata *TraceMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // Metadata about the trace. - FunctionCalls []*TraceFunctionCall `protobuf:"bytes,2,rep,name=function_calls,json=functionCalls,proto3" json:"function_calls,omitempty"` // List of function calls in the trace. + Metadata *TraceMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // Metadata about the trace. + FunctionCalls []*TraceFunctionCall `protobuf:"bytes,2,rep,name=function_calls,json=functionCalls,proto3" json:"function_calls,omitempty"` // List of function calls in the trace. + ResourceUtilisation *TraceResourceUtilisation `protobuf:"bytes,3,opt,name=resource_utilisation,json=resourceUtilisation,proto3" json:"resource_utilisation,omitempty"` // Resources consumed by the request. + Drupal *TraceDrupal `protobuf:"bytes,4,opt,name=drupal,proto3,oneof" json:"drupal,omitempty"` // Drupal specific data. Only populated for PHP traces which called into the Drupal APIs. } func (x *Trace) Reset() { @@ -179,6 +331,20 @@ func (x *Trace) GetFunctionCalls() []*TraceFunctionCall { return nil } +func (x *Trace) GetResourceUtilisation() *TraceResourceUtilisation { + if x != nil { + return x.ResourceUtilisation + } + return nil +} + +func (x *Trace) GetDrupal() *TraceDrupal { + if x != nil { + return x.Drupal + } + return nil +} + // * // Metadata which contains information about the trace. type TraceMetadata struct { @@ -186,11 +352,19 @@ type TraceMetadata struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // Request identifier for tracking. - Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"` // URI of the request being traced. - Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` // HTTP method of the request (e.g., GET, POST). - StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` // Start time of the trace in unix format. - EndTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` // End time of the trace in unix format. + // Request identifier for tracking. + // + // Compass sends "UNKNOWN" when the request carried no HTTP_X_REQUEST_ID + // header. That is a sentinel, not an identifier: two traces reading UNKNOWN + // are not the same request, so anything correlating on this must treat it as + // absent. + RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + StartTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` // Start time of the trace. + EndTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` // End time of the trace. + Source TraceSource `protobuf:"varint,4,opt,name=source,proto3,enum=workflow.TraceSource" json:"source,omitempty"` // How the traced request was invoked. + Runtime TraceRuntime `protobuf:"varint,5,opt,name=runtime,proto3,enum=workflow.TraceRuntime" json:"runtime,omitempty"` // Language runtime which produced the trace. + Http *TraceMetadataHTTP `protobuf:"bytes,6,opt,name=http,proto3,oneof" json:"http,omitempty"` // Request details. Only set when source is TRACE_SOURCE_HTTP. + Cli *TraceMetadataCLI `protobuf:"bytes,7,opt,name=cli,proto3,oneof" json:"cli,omitempty"` // Command details. Only set when source is TRACE_SOURCE_CLI. } func (x *TraceMetadata) Reset() { @@ -232,34 +406,203 @@ func (x *TraceMetadata) GetRequestId() string { return "" } -func (x *TraceMetadata) GetUri() string { +func (x *TraceMetadata) GetStartTime() *timestamppb.Timestamp { if x != nil { - return x.Uri + return x.StartTime } - return "" + return nil } -func (x *TraceMetadata) GetMethod() string { +func (x *TraceMetadata) GetEndTime() *timestamppb.Timestamp { if x != nil { - return x.Method + return x.EndTime } - return "" + return nil } -func (x *TraceMetadata) GetStartTime() *timestamppb.Timestamp { +func (x *TraceMetadata) GetSource() TraceSource { if x != nil { - return x.StartTime + return x.Source + } + return TraceSource_TRACE_SOURCE_UNSPECIFIED +} + +func (x *TraceMetadata) GetRuntime() TraceRuntime { + if x != nil { + return x.Runtime + } + return TraceRuntime_TRACE_RUNTIME_UNSPECIFIED +} + +func (x *TraceMetadata) GetHttp() *TraceMetadataHTTP { + if x != nil { + return x.Http } return nil } -func (x *TraceMetadata) GetEndTime() *timestamppb.Timestamp { +func (x *TraceMetadata) GetCli() *TraceMetadataCLI { if x != nil { - return x.EndTime + return x.Cli } return nil } +// * +// Metadata for a trace which was invoked by a HTTP request. +type TraceMetadataHTTP struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` // HTTP method of the request (e.g., GET, POST). + Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"` // URI of the request being traced. +} + +func (x *TraceMetadataHTTP) Reset() { + *x = TraceMetadataHTTP{} + if protoimpl.UnsafeEnabled { + mi := &file_trace_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceMetadataHTTP) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceMetadataHTTP) ProtoMessage() {} + +func (x *TraceMetadataHTTP) ProtoReflect() protoreflect.Message { + mi := &file_trace_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TraceMetadataHTTP.ProtoReflect.Descriptor instead. +func (*TraceMetadataHTTP) Descriptor() ([]byte, []int) { + return file_trace_proto_rawDescGZIP(), []int{4} +} + +func (x *TraceMetadataHTTP) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *TraceMetadataHTTP) GetUri() string { + if x != nil { + return x.Uri + } + return "" +} + +// * +// Metadata for a trace which was invoked from the command line. +type TraceMetadataCLI struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` // Command which was executed. +} + +func (x *TraceMetadataCLI) Reset() { + *x = TraceMetadataCLI{} + if protoimpl.UnsafeEnabled { + mi := &file_trace_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceMetadataCLI) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceMetadataCLI) ProtoMessage() {} + +func (x *TraceMetadataCLI) ProtoReflect() protoreflect.Message { + mi := &file_trace_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TraceMetadataCLI.ProtoReflect.Descriptor instead. +func (*TraceMetadataCLI) Descriptor() ([]byte, []int) { + return file_trace_proto_rawDescGZIP(), []int{5} +} + +func (x *TraceMetadataCLI) GetCommand() string { + if x != nil { + return x.Command + } + return "" +} + +// * +// Resources consumed over the course of the traced request. +type TraceResourceUtilisation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MaxMemory int64 `protobuf:"varint,1,opt,name=max_memory,json=maxMemory,proto3" json:"max_memory,omitempty"` // Peak memory used by the request, in bytes. +} + +func (x *TraceResourceUtilisation) Reset() { + *x = TraceResourceUtilisation{} + if protoimpl.UnsafeEnabled { + mi := &file_trace_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceResourceUtilisation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceResourceUtilisation) ProtoMessage() {} + +func (x *TraceResourceUtilisation) ProtoReflect() protoreflect.Message { + mi := &file_trace_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TraceResourceUtilisation.ProtoReflect.Descriptor instead. +func (*TraceResourceUtilisation) Descriptor() ([]byte, []int) { + return file_trace_proto_rawDescGZIP(), []int{6} +} + +func (x *TraceResourceUtilisation) GetMaxMemory() int64 { + if x != nil { + return x.MaxMemory + } + return 0 +} + // * // Function call data within a trace. type TraceFunctionCall struct { @@ -267,15 +610,16 @@ type TraceFunctionCall struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Name of the function being traced. - StartTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` // Start time of the function call in unix format. - Elapsed *durationpb.Duration `protobuf:"bytes,3,opt,name=elapsed,proto3" json:"elapsed,omitempty"` // Elapsed time for the function call in milliseconds. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Name of the function being traced. + Offset *durationpb.Duration `protobuf:"bytes,2,opt,name=offset,proto3" json:"offset,omitempty"` // Offset from the start of the request at which the call began. + Elapsed *durationpb.Duration `protobuf:"bytes,3,opt,name=elapsed,proto3" json:"elapsed,omitempty"` // How long the call ran for. + Memory int64 `protobuf:"varint,4,opt,name=memory,proto3" json:"memory,omitempty"` // Memory used by the call, in bytes. } func (x *TraceFunctionCall) Reset() { *x = TraceFunctionCall{} if protoimpl.UnsafeEnabled { - mi := &file_trace_proto_msgTypes[4] + mi := &file_trace_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -288,7 +632,7 @@ func (x *TraceFunctionCall) String() string { func (*TraceFunctionCall) ProtoMessage() {} func (x *TraceFunctionCall) ProtoReflect() protoreflect.Message { - mi := &file_trace_proto_msgTypes[4] + mi := &file_trace_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -301,7 +645,7 @@ func (x *TraceFunctionCall) ProtoReflect() protoreflect.Message { // Deprecated: Use TraceFunctionCall.ProtoReflect.Descriptor instead. func (*TraceFunctionCall) Descriptor() ([]byte, []int) { - return file_trace_proto_rawDescGZIP(), []int{4} + return file_trace_proto_rawDescGZIP(), []int{7} } func (x *TraceFunctionCall) GetName() string { @@ -311,9 +655,9 @@ func (x *TraceFunctionCall) GetName() string { return "" } -func (x *TraceFunctionCall) GetStartTime() *timestamppb.Timestamp { +func (x *TraceFunctionCall) GetOffset() *durationpb.Duration { if x != nil { - return x.StartTime + return x.Offset } return nil } @@ -325,6 +669,183 @@ func (x *TraceFunctionCall) GetElapsed() *durationpb.Duration { return nil } +func (x *TraceFunctionCall) GetMemory() int64 { + if x != nil { + return x.Memory + } + return 0 +} + +// * +// Drupal specific data collected for a trace. +// +// Only populated for PHP traces where the application called into the Drupal +// APIs which Compass probes, so it is absent for Node traces, PHP CLI traces +// and non-Drupal PHP applications. +type TraceDrupal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CacheEvents []*TraceDrupalCacheEvent `protobuf:"bytes,1,rep,name=cache_events,json=cacheEvents,proto3" json:"cache_events,omitempty"` // Cache events which occurred during this trace, aggregated by their contents. + CacheEventsDropped int64 `protobuf:"varint,2,opt,name=cache_events_dropped,json=cacheEventsDropped,proto3" json:"cache_events_dropped,omitempty"` // How many distinct cache events were discarded because the trace reached its retention limit. Reported so that a truncated trace is not mistaken for a complete one. +} + +func (x *TraceDrupal) Reset() { + *x = TraceDrupal{} + if protoimpl.UnsafeEnabled { + mi := &file_trace_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceDrupal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceDrupal) ProtoMessage() {} + +func (x *TraceDrupal) ProtoReflect() protoreflect.Message { + mi := &file_trace_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TraceDrupal.ProtoReflect.Descriptor instead. +func (*TraceDrupal) Descriptor() ([]byte, []int) { + return file_trace_proto_rawDescGZIP(), []int{8} +} + +func (x *TraceDrupal) GetCacheEvents() []*TraceDrupalCacheEvent { + if x != nil { + return x.CacheEvents + } + return nil +} + +func (x *TraceDrupal) GetCacheEventsDropped() int64 { + if x != nil { + return x.CacheEventsDropped + } + return 0 +} + +// * +// Cacheability metadata that Drupal derived at a point in the request. +// +// Drupal derives cacheability far more often than a request has interesting +// function calls, so identical events are aggregated into a single entry with a +// call count rather than retained individually. +type TraceDrupalCacheEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Origin TraceDrupalCacheOrigin `protobuf:"varint,1,opt,name=origin,proto3,enum=workflow.TraceDrupalCacheOrigin" json:"origin,omitempty"` // Origin of the cacheability metadata. + Caller string `protobuf:"bytes,2,opt,name=caller,proto3" json:"caller,omitempty"` // Caller which asked Drupal for the cacheability metadata. + ObjectType string `protobuf:"bytes,3,opt,name=object_type,json=objectType,proto3" json:"object_type,omitempty"` // Type the metadata was derived from. Only set for TRACE_DRUPAL_CACHE_ORIGIN_OBJECT. + MaxAge int64 `protobuf:"varint,4,opt,name=max_age,json=maxAge,proto3" json:"max_age,omitempty"` // Max age in seconds, where -1 means cacheable forever. + Tags []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` // Tags which the cached item is invalidated by. + Contexts []string `protobuf:"bytes,6,rep,name=contexts,proto3" json:"contexts,omitempty"` // Contexts which the cached item varies by. + Offset *durationpb.Duration `protobuf:"bytes,7,opt,name=offset,proto3" json:"offset,omitempty"` // Offset from the start of the request at which the first of these events occurred. + Calls int64 `protobuf:"varint,8,opt,name=calls,proto3" json:"calls,omitempty"` // How many identical events were aggregated into this one. +} + +func (x *TraceDrupalCacheEvent) Reset() { + *x = TraceDrupalCacheEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_trace_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceDrupalCacheEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceDrupalCacheEvent) ProtoMessage() {} + +func (x *TraceDrupalCacheEvent) ProtoReflect() protoreflect.Message { + mi := &file_trace_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TraceDrupalCacheEvent.ProtoReflect.Descriptor instead. +func (*TraceDrupalCacheEvent) Descriptor() ([]byte, []int) { + return file_trace_proto_rawDescGZIP(), []int{9} +} + +func (x *TraceDrupalCacheEvent) GetOrigin() TraceDrupalCacheOrigin { + if x != nil { + return x.Origin + } + return TraceDrupalCacheOrigin_TRACE_DRUPAL_CACHE_ORIGIN_UNSPECIFIED +} + +func (x *TraceDrupalCacheEvent) GetCaller() string { + if x != nil { + return x.Caller + } + return "" +} + +func (x *TraceDrupalCacheEvent) GetObjectType() string { + if x != nil { + return x.ObjectType + } + return "" +} + +func (x *TraceDrupalCacheEvent) GetMaxAge() int64 { + if x != nil { + return x.MaxAge + } + return 0 +} + +func (x *TraceDrupalCacheEvent) GetTags() []string { + if x != nil { + return x.Tags + } + return nil +} + +func (x *TraceDrupalCacheEvent) GetContexts() []string { + if x != nil { + return x.Contexts + } + return nil +} + +func (x *TraceDrupalCacheEvent) GetOffset() *durationpb.Duration { + if x != nil { + return x.Offset + } + return nil +} + +func (x *TraceDrupalCacheEvent) GetCalls() int64 { + if x != nil { + return x.Calls + } + return 0 +} + var File_trace_proto protoreflect.FileDescriptor var file_trace_proto_rawDesc = []byte{ @@ -341,7 +862,7 @@ var file_trace_proto_rawDesc = []byte{ 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x06, 0x54, 0x72, 0x61, 0x63, - 0x65, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x08, + 0x65, 0x73, 0x22, 0x96, 0x02, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, @@ -349,36 +870,115 @@ var file_trace_proto_rawDesc = []byte{ 0x6c, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x22, 0xca, 0x01, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x63, 0x65, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, - 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, - 0x6d, 0x65, 0x22, 0x97, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x63, 0x65, 0x46, 0x75, 0x6e, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, + 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x55, 0x0a, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x54, + 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x74, 0x69, 0x6c, + 0x69, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x55, 0x74, 0x69, 0x6c, 0x69, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x06, + 0x64, 0x72, 0x75, 0x70, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x77, + 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x44, 0x72, 0x75, + 0x70, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x06, 0x64, 0x72, 0x75, 0x70, 0x61, 0x6c, 0x88, 0x01, 0x01, + 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x64, 0x72, 0x75, 0x70, 0x61, 0x6c, 0x22, 0xfb, 0x02, 0x0a, 0x0d, + 0x54, 0x72, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x65, 0x6c, 0x61, 0x70, 0x73, - 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x6c, 0x61, 0x70, 0x73, 0x65, 0x64, 0x32, 0x5a, 0x0a, 0x05, - 0x74, 0x72, 0x61, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, - 0x72, 0x61, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, - 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2d, + 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, + 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x30, 0x0a, + 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, + 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, + 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, + 0x34, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x54, 0x54, 0x50, 0x48, 0x00, 0x52, 0x04, 0x68, 0x74, + 0x74, 0x70, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x03, 0x63, 0x6c, 0x69, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x54, 0x72, + 0x61, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x43, 0x4c, 0x49, 0x48, 0x01, + 0x52, 0x03, 0x63, 0x6c, 0x69, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x68, 0x74, 0x74, + 0x70, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x63, 0x6c, 0x69, 0x22, 0x3d, 0x0a, 0x11, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x54, 0x54, 0x50, 0x12, 0x16, + 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x22, 0x2c, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x63, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x43, 0x4c, 0x49, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, 0x39, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x74, 0x69, 0x6c, 0x69, 0x73, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, + 0x79, 0x22, 0xa7, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x63, 0x65, 0x46, 0x75, 0x6e, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x33, + 0x0a, 0x07, 0x65, 0x6c, 0x61, 0x70, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x6c, 0x61, 0x70, + 0x73, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x22, 0x83, 0x01, 0x0a, 0x0b, + 0x54, 0x72, 0x61, 0x63, 0x65, 0x44, 0x72, 0x75, 0x70, 0x61, 0x6c, 0x12, 0x42, 0x0a, 0x0c, 0x63, + 0x61, 0x63, 0x68, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x44, 0x72, 0x75, 0x70, 0x61, 0x6c, 0x43, 0x61, 0x63, 0x68, 0x65, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x61, 0x63, 0x68, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x30, 0x0a, 0x14, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, + 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x63, + 0x61, 0x63, 0x68, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x44, 0x72, 0x6f, 0x70, 0x70, 0x65, + 0x64, 0x22, 0x9c, 0x02, 0x0a, 0x15, 0x54, 0x72, 0x61, 0x63, 0x65, 0x44, 0x72, 0x75, 0x70, 0x61, + 0x6c, 0x43, 0x61, 0x63, 0x68, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x06, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x77, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x44, 0x72, 0x75, 0x70, + 0x61, 0x6c, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x06, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1f, 0x0a, + 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, + 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x6d, 0x61, 0x78, 0x41, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x12, 0x31, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x61, + 0x6c, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x61, 0x6c, 0x6c, 0x73, + 0x2a, 0x58, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x1c, 0x0a, 0x18, 0x54, 0x52, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, + 0x11, 0x54, 0x52, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x48, 0x54, + 0x54, 0x50, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x52, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x4f, + 0x55, 0x52, 0x43, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x10, 0x02, 0x2a, 0x5c, 0x0a, 0x0c, 0x54, 0x72, + 0x61, 0x63, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x54, 0x52, + 0x41, 0x43, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x52, 0x41, + 0x43, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x50, 0x48, 0x50, 0x10, 0x01, + 0x12, 0x16, 0x0a, 0x12, 0x54, 0x52, 0x41, 0x43, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, + 0x45, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x02, 0x2a, 0x95, 0x01, 0x0a, 0x16, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x44, 0x72, 0x75, 0x70, 0x61, 0x6c, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x12, 0x29, 0x0a, 0x25, 0x54, 0x52, 0x41, 0x43, 0x45, 0x5f, 0x44, 0x52, 0x55, + 0x50, 0x41, 0x4c, 0x5f, 0x43, 0x41, 0x43, 0x48, 0x45, 0x5f, 0x4f, 0x52, 0x49, 0x47, 0x49, 0x4e, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2a, + 0x0a, 0x26, 0x54, 0x52, 0x41, 0x43, 0x45, 0x5f, 0x44, 0x52, 0x55, 0x50, 0x41, 0x4c, 0x5f, 0x43, + 0x41, 0x43, 0x48, 0x45, 0x5f, 0x4f, 0x52, 0x49, 0x47, 0x49, 0x4e, 0x5f, 0x52, 0x45, 0x4e, 0x44, + 0x45, 0x52, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x01, 0x12, 0x24, 0x0a, 0x20, 0x54, 0x52, + 0x41, 0x43, 0x45, 0x5f, 0x44, 0x52, 0x55, 0x50, 0x41, 0x4c, 0x5f, 0x43, 0x41, 0x43, 0x48, 0x45, + 0x5f, 0x4f, 0x52, 0x49, 0x47, 0x49, 0x4e, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02, + 0x32, 0x5a, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x0c, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x77, 0x6f, 0x72, 0x6b, + 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, 0x72, 0x61, 0x63, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, 0x72, 0x61, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -393,31 +993,49 @@ func file_trace_proto_rawDescGZIP() []byte { return file_trace_proto_rawDescData } -var file_trace_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_trace_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_trace_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_trace_proto_goTypes = []interface{}{ - (*StreamTracesRequest)(nil), // 0: workflow.StreamTracesRequest - (*StreamTracesResponse)(nil), // 1: workflow.StreamTracesResponse - (*Trace)(nil), // 2: workflow.Trace - (*TraceMetadata)(nil), // 3: workflow.TraceMetadata - (*TraceFunctionCall)(nil), // 4: workflow.TraceFunctionCall - (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 6: google.protobuf.Duration + (TraceSource)(0), // 0: workflow.TraceSource + (TraceRuntime)(0), // 1: workflow.TraceRuntime + (TraceDrupalCacheOrigin)(0), // 2: workflow.TraceDrupalCacheOrigin + (*StreamTracesRequest)(nil), // 3: workflow.StreamTracesRequest + (*StreamTracesResponse)(nil), // 4: workflow.StreamTracesResponse + (*Trace)(nil), // 5: workflow.Trace + (*TraceMetadata)(nil), // 6: workflow.TraceMetadata + (*TraceMetadataHTTP)(nil), // 7: workflow.TraceMetadataHTTP + (*TraceMetadataCLI)(nil), // 8: workflow.TraceMetadataCLI + (*TraceResourceUtilisation)(nil), // 9: workflow.TraceResourceUtilisation + (*TraceFunctionCall)(nil), // 10: workflow.TraceFunctionCall + (*TraceDrupal)(nil), // 11: workflow.TraceDrupal + (*TraceDrupalCacheEvent)(nil), // 12: workflow.TraceDrupalCacheEvent + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 14: google.protobuf.Duration } var file_trace_proto_depIdxs = []int32{ - 2, // 0: workflow.StreamTracesResponse.Traces:type_name -> workflow.Trace - 3, // 1: workflow.Trace.metadata:type_name -> workflow.TraceMetadata - 4, // 2: workflow.Trace.function_calls:type_name -> workflow.TraceFunctionCall - 5, // 3: workflow.TraceMetadata.start_time:type_name -> google.protobuf.Timestamp - 5, // 4: workflow.TraceMetadata.end_time:type_name -> google.protobuf.Timestamp - 5, // 5: workflow.TraceFunctionCall.start_time:type_name -> google.protobuf.Timestamp - 6, // 6: workflow.TraceFunctionCall.elapsed:type_name -> google.protobuf.Duration - 0, // 7: workflow.trace.StreamTraces:input_type -> workflow.StreamTracesRequest - 1, // 8: workflow.trace.StreamTraces:output_type -> workflow.StreamTracesResponse - 8, // [8:9] is the sub-list for method output_type - 7, // [7:8] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 5, // 0: workflow.StreamTracesResponse.Traces:type_name -> workflow.Trace + 6, // 1: workflow.Trace.metadata:type_name -> workflow.TraceMetadata + 10, // 2: workflow.Trace.function_calls:type_name -> workflow.TraceFunctionCall + 9, // 3: workflow.Trace.resource_utilisation:type_name -> workflow.TraceResourceUtilisation + 11, // 4: workflow.Trace.drupal:type_name -> workflow.TraceDrupal + 13, // 5: workflow.TraceMetadata.start_time:type_name -> google.protobuf.Timestamp + 13, // 6: workflow.TraceMetadata.end_time:type_name -> google.protobuf.Timestamp + 0, // 7: workflow.TraceMetadata.source:type_name -> workflow.TraceSource + 1, // 8: workflow.TraceMetadata.runtime:type_name -> workflow.TraceRuntime + 7, // 9: workflow.TraceMetadata.http:type_name -> workflow.TraceMetadataHTTP + 8, // 10: workflow.TraceMetadata.cli:type_name -> workflow.TraceMetadataCLI + 14, // 11: workflow.TraceFunctionCall.offset:type_name -> google.protobuf.Duration + 14, // 12: workflow.TraceFunctionCall.elapsed:type_name -> google.protobuf.Duration + 12, // 13: workflow.TraceDrupal.cache_events:type_name -> workflow.TraceDrupalCacheEvent + 2, // 14: workflow.TraceDrupalCacheEvent.origin:type_name -> workflow.TraceDrupalCacheOrigin + 14, // 15: workflow.TraceDrupalCacheEvent.offset:type_name -> google.protobuf.Duration + 3, // 16: workflow.trace.StreamTraces:input_type -> workflow.StreamTracesRequest + 4, // 17: workflow.trace.StreamTraces:output_type -> workflow.StreamTracesResponse + 17, // [17:18] is the sub-list for method output_type + 16, // [16:17] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_trace_proto_init() } @@ -475,6 +1093,42 @@ func file_trace_proto_init() { } } file_trace_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceMetadataHTTP); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_trace_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceMetadataCLI); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_trace_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceResourceUtilisation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_trace_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TraceFunctionCall); i { case 0: return &v.state @@ -486,19 +1140,46 @@ func file_trace_proto_init() { return nil } } + file_trace_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceDrupal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_trace_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceDrupalCacheEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } + file_trace_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_trace_proto_msgTypes[3].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_trace_proto_rawDesc, - NumEnums: 0, - NumMessages: 5, + NumEnums: 3, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, GoTypes: file_trace_proto_goTypes, DependencyIndexes: file_trace_proto_depIdxs, + EnumInfos: file_trace_proto_enumTypes, MessageInfos: file_trace_proto_msgTypes, }.Build() File_trace_proto = out.File diff --git a/trace.proto b/trace.proto index fb18057..b6ceaab 100644 --- a/trace.proto +++ b/trace.proto @@ -27,31 +27,114 @@ message StreamTracesResponse { repeated Trace Traces = 1; // List of traces. } +// The invocation mechanism which produced the trace. +enum TraceSource { + TRACE_SOURCE_UNSPECIFIED = 0; + TRACE_SOURCE_HTTP = 1; // Trace was collected from a HTTP request. + TRACE_SOURCE_CLI = 2; // Trace was collected from the command line interface. +} + +// The language runtime which produced the trace. +enum TraceRuntime { + TRACE_RUNTIME_UNSPECIFIED = 0; + TRACE_RUNTIME_PHP = 1; // Trace was collected from a PHP process. + TRACE_RUNTIME_NODE = 2; // Trace was collected from a Node.js process. +} + /** * Trace data provided by Compass. */ message Trace { - TraceMetadata metadata = 1; // Metadata about the trace. - repeated TraceFunctionCall function_calls = 2; // List of function calls in the trace. + TraceMetadata metadata = 1; // Metadata about the trace. + repeated TraceFunctionCall function_calls = 2; // List of function calls in the trace. + TraceResourceUtilisation resource_utilisation = 3; // Resources consumed by the request. + optional TraceDrupal drupal = 4; // Drupal specific data. Only populated for PHP traces which called into the Drupal APIs. } /** * Metadata which contains information about the trace. */ message TraceMetadata { - string request_id = 1; // Request identifier for tracking. - string uri = 2; // URI of the request being traced. - string method = 3; // HTTP method of the request (e.g., GET, POST). - google.protobuf.Timestamp start_time = 4; // Start time of the trace in unix format. - google.protobuf.Timestamp end_time = 5; // End time of the trace in unix format. + // Request identifier for tracking. + // + // Compass sends "UNKNOWN" when the request carried no HTTP_X_REQUEST_ID + // header. That is a sentinel, not an identifier: two traces reading UNKNOWN + // are not the same request, so anything correlating on this must treat it as + // absent. + string request_id = 1; + google.protobuf.Timestamp start_time = 2; // Start time of the trace. + google.protobuf.Timestamp end_time = 3; // End time of the trace. + TraceSource source = 4; // How the traced request was invoked. + TraceRuntime runtime = 5; // Language runtime which produced the trace. + optional TraceMetadataHTTP http = 6; // Request details. Only set when source is TRACE_SOURCE_HTTP. + optional TraceMetadataCLI cli = 7; // Command details. Only set when source is TRACE_SOURCE_CLI. +} + +/** + * Metadata for a trace which was invoked by a HTTP request. + */ +message TraceMetadataHTTP { + string method = 1; // HTTP method of the request (e.g., GET, POST). + string uri = 2; // URI of the request being traced. +} + +/** + * Metadata for a trace which was invoked from the command line. + */ +message TraceMetadataCLI { + string command = 1; // Command which was executed. +} + +/** + * Resources consumed over the course of the traced request. + */ +message TraceResourceUtilisation { + int64 max_memory = 1; // Peak memory used by the request, in bytes. } /** * Function call data within a trace. */ message TraceFunctionCall { - string name = 1; // Name of the function being traced. - google.protobuf.Timestamp start_time = 2; // Start time of the function call in unix format. - google.protobuf.Duration elapsed = 3; // Elapsed time for the function call in milliseconds. + string name = 1; // Name of the function being traced. + google.protobuf.Duration offset = 2; // Offset from the start of the request at which the call began. + google.protobuf.Duration elapsed = 3; // How long the call ran for. + int64 memory = 4; // Memory used by the call, in bytes. +} + +// Which Drupal API produced a cache event. +enum TraceDrupalCacheOrigin { + TRACE_DRUPAL_CACHE_ORIGIN_UNSPECIFIED = 0; + TRACE_DRUPAL_CACHE_ORIGIN_RENDER_ARRAY = 1; // Cacheability was collected from a render array. + TRACE_DRUPAL_CACHE_ORIGIN_OBJECT = 2; // Cacheability was collected from an object. +} + +/** + * Drupal specific data collected for a trace. + * + * Only populated for PHP traces where the application called into the Drupal + * APIs which Compass probes, so it is absent for Node traces, PHP CLI traces + * and non-Drupal PHP applications. + */ +message TraceDrupal { + repeated TraceDrupalCacheEvent cache_events = 1; // Cache events which occurred during this trace, aggregated by their contents. + int64 cache_events_dropped = 2; // How many distinct cache events were discarded because the trace reached its retention limit. Reported so that a truncated trace is not mistaken for a complete one. } +/** + * Cacheability metadata that Drupal derived at a point in the request. + * + * Drupal derives cacheability far more often than a request has interesting + * function calls, so identical events are aggregated into a single entry with a + * call count rather than retained individually. + */ +message TraceDrupalCacheEvent { + TraceDrupalCacheOrigin origin = 1; // Origin of the cacheability metadata. + string caller = 2; // Caller which asked Drupal for the cacheability metadata. + string object_type = 3; // Type the metadata was derived from. Only set for TRACE_DRUPAL_CACHE_ORIGIN_OBJECT. + int64 max_age = 4; // Max age in seconds, where -1 means cacheable forever. + repeated string tags = 5; // Tags which the cached item is invalidated by. + repeated string contexts = 6; // Contexts which the cached item varies by. + google.protobuf.Duration offset = 7; // Offset from the start of the request at which the first of these events occurred. + int64 calls = 8; // How many identical events were aggregated into this one. +}