GoPLS Viewer

Home|gopls/internal/event/export/ocagent/wire/trace.go
1// Copyright 2019 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package wire
6
7type ExportTraceServiceRequest struct {
8    Node     *Node     `json:"node,omitempty"`
9    Spans    []*Span   `json:"spans,omitempty"`
10    Resource *Resource `json:"resource,omitempty"`
11}
12
13type Span struct {
14    TraceID                 []byte             `json:"trace_id,omitempty"`
15    SpanID                  []byte             `json:"span_id,omitempty"`
16    TraceState              *TraceState        `json:"tracestate,omitempty"`
17    ParentSpanID            []byte             `json:"parent_span_id,omitempty"`
18    Name                    *TruncatableString `json:"name,omitempty"`
19    Kind                    SpanKind           `json:"kind,omitempty"`
20    StartTime               Timestamp          `json:"start_time,omitempty"`
21    EndTime                 Timestamp          `json:"end_time,omitempty"`
22    Attributes              *Attributes        `json:"attributes,omitempty"`
23    StackTrace              *StackTrace        `json:"stack_trace,omitempty"`
24    TimeEvents              *TimeEvents        `json:"time_events,omitempty"`
25    Links                   *Links             `json:"links,omitempty"`
26    Status                  *Status            `json:"status,omitempty"`
27    Resource                *Resource          `json:"resource,omitempty"`
28    SameProcessAsParentSpan bool               `json:"same_process_as_parent_span,omitempty"`
29    ChildSpanCount          bool               `json:"child_span_count,omitempty"`
30}
31
32type TraceState struct {
33    Entries []*TraceStateEntry `json:"entries,omitempty"`
34}
35
36type TraceStateEntry struct {
37    Key   string `json:"key,omitempty"`
38    Value string `json:"value,omitempty"`
39}
40
41type SpanKind int32
42
43const (
44    UnspecifiedSpanKind SpanKind = 0
45    ServerSpanKind      SpanKind = 1
46    ClientSpanKind      SpanKind = 2
47)
48
49type TimeEvents struct {
50    TimeEvent                 []TimeEvent `json:"timeEvent,omitempty"`
51    DroppedAnnotationsCount   int32       `json:"dropped_annotations_count,omitempty"`
52    DroppedMessageEventsCount int32       `json:"dropped_message_events_count,omitempty"`
53}
54
55type TimeEvent struct {
56    Time         Timestamp     `json:"time,omitempty"`
57    MessageEvent *MessageEvent `json:"messageEvent,omitempty"`
58    Annotation   *Annotation   `json:"annotation,omitempty"`
59}
60
61type Annotation struct {
62    Description *TruncatableString `json:"description,omitempty"`
63    Attributes  *Attributes        `json:"attributes,omitempty"`
64}
65
66type MessageEvent struct {
67    Type             MessageEventType `json:"type,omitempty"`
68    ID               uint64           `json:"id,omitempty"`
69    UncompressedSize uint64           `json:"uncompressed_size,omitempty"`
70    CompressedSize   uint64           `json:"compressed_size,omitempty"`
71}
72
73type MessageEventType int32
74
75const (
76    UnspecifiedMessageEvent MessageEventType = iota
77    SentMessageEvent
78    ReceivedMessageEvent
79)
80
81type TimeEventValue interface {
82    labelTimeEventValue()
83}
84
85func (AnnotationlabelTimeEventValue()   {}
86func (MessageEventlabelTimeEventValue() {}
87
88type Links struct {
89    Link              []*Link `json:"link,omitempty"`
90    DroppedLinksCount int32   `json:"dropped_links_count,omitempty"`
91}
92
93type Link struct {
94    TraceID    []byte      `json:"trace_id,omitempty"`
95    SpanID     []byte      `json:"span_id,omitempty"`
96    Type       LinkType    `json:"type,omitempty"`
97    Attributes *Attributes `json:"attributes,omitempty"`
98    TraceState *TraceState `json:"tracestate,omitempty"`
99}
100
101type LinkType int32
102
103const (
104    UnspecifiedLinkType LinkType = 0
105    ChildLinkType       LinkType = 1
106    ParentLinkType      LinkType = 2
107)
108
109type Status struct {
110    Code    int32  `json:"code,omitempty"`
111    Message string `json:"message,omitempty"`
112}
113
MembersX
Span.TimeEvents
TraceState.Entries
Annotation.labelTimeEventValue
Status.Message
ExportTraceServiceRequest
ExportTraceServiceRequest.Node
TimeEvent.Annotation
LinkType
Span
TimeEvents.TimeEvent
UnspecifiedMessageEvent
TimeEventValue
Link
Link.Type
SpanKind
Annotation.Attributes
Annotation.Description
Link.SpanID
Span.Kind
TimeEvents
ParentLinkType
Status
Span.Links
ServerSpanKind
Span.TraceState
Span.Name
Span.StackTrace
Span.Resource
ClientSpanKind
TimeEvents.DroppedMessageEventsCount
ExportTraceServiceRequest.Spans
Span.SpanID
Annotation
Span.TraceID
Span.SameProcessAsParentSpan
TimeEvent.MessageEvent
UnspecifiedLinkType
Status.Code
Span.ParentSpanID
TimeEvent
TimeEvents.DroppedAnnotationsCount
Links.DroppedLinksCount
Link.TraceID
TraceStateEntry
TraceStateEntry.Key
Span.Status
MessageEvent.ID
TraceState
TimeEvent.Time
Link.Attributes
ChildLinkType
Span.StartTime
Span.ChildSpanCount
Span.Attributes
MessageEvent
MessageEvent.Type
Links
ExportTraceServiceRequest.Resource
TraceStateEntry.Value
Span.EndTime
UnspecifiedSpanKind
MessageEvent.labelTimeEventValue
Link.TraceState
MessageEvent.UncompressedSize
MessageEventType
MessageEvent.CompressedSize
Links.Link
Members
X