File: trace.go

package info (click to toggle)
golang-golang-x-tools 1%3A0.5.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports
  • size: 16,592 kB
  • sloc: javascript: 2,011; asm: 1,635; sh: 192; yacc: 155; makefile: 52; ansic: 8
file content (112 lines) | stat: -rw-r--r-- 3,729 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package wire

type ExportTraceServiceRequest struct {
	Node     *Node     `json:"node,omitempty"`
	Spans    []*Span   `json:"spans,omitempty"`
	Resource *Resource `json:"resource,omitempty"`
}

type Span struct {
	TraceID                 []byte             `json:"trace_id,omitempty"`
	SpanID                  []byte             `json:"span_id,omitempty"`
	TraceState              *TraceState        `json:"tracestate,omitempty"`
	ParentSpanID            []byte             `json:"parent_span_id,omitempty"`
	Name                    *TruncatableString `json:"name,omitempty"`
	Kind                    SpanKind           `json:"kind,omitempty"`
	StartTime               Timestamp          `json:"start_time,omitempty"`
	EndTime                 Timestamp          `json:"end_time,omitempty"`
	Attributes              *Attributes        `json:"attributes,omitempty"`
	StackTrace              *StackTrace        `json:"stack_trace,omitempty"`
	TimeEvents              *TimeEvents        `json:"time_events,omitempty"`
	Links                   *Links             `json:"links,omitempty"`
	Status                  *Status            `json:"status,omitempty"`
	Resource                *Resource          `json:"resource,omitempty"`
	SameProcessAsParentSpan bool               `json:"same_process_as_parent_span,omitempty"`
	ChildSpanCount          bool               `json:"child_span_count,omitempty"`
}

type TraceState struct {
	Entries []*TraceStateEntry `json:"entries,omitempty"`
}

type TraceStateEntry struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

type SpanKind int32

const (
	UnspecifiedSpanKind SpanKind = 0
	ServerSpanKind      SpanKind = 1
	ClientSpanKind      SpanKind = 2
)

type TimeEvents struct {
	TimeEvent                 []TimeEvent `json:"timeEvent,omitempty"`
	DroppedAnnotationsCount   int32       `json:"dropped_annotations_count,omitempty"`
	DroppedMessageEventsCount int32       `json:"dropped_message_events_count,omitempty"`
}

type TimeEvent struct {
	Time         Timestamp     `json:"time,omitempty"`
	MessageEvent *MessageEvent `json:"messageEvent,omitempty"`
	Annotation   *Annotation   `json:"annotation,omitempty"`
}

type Annotation struct {
	Description *TruncatableString `json:"description,omitempty"`
	Attributes  *Attributes        `json:"attributes,omitempty"`
}

type MessageEvent struct {
	Type             MessageEventType `json:"type,omitempty"`
	ID               uint64           `json:"id,omitempty"`
	UncompressedSize uint64           `json:"uncompressed_size,omitempty"`
	CompressedSize   uint64           `json:"compressed_size,omitempty"`
}

type MessageEventType int32

const (
	UnspecifiedMessageEvent MessageEventType = iota
	SentMessageEvent
	ReceivedMessageEvent
)

type TimeEventValue interface {
	labelTimeEventValue()
}

func (Annotation) labelTimeEventValue()   {}
func (MessageEvent) labelTimeEventValue() {}

type Links struct {
	Link              []*Link `json:"link,omitempty"`
	DroppedLinksCount int32   `json:"dropped_links_count,omitempty"`
}

type Link struct {
	TraceID    []byte      `json:"trace_id,omitempty"`
	SpanID     []byte      `json:"span_id,omitempty"`
	Type       LinkType    `json:"type,omitempty"`
	Attributes *Attributes `json:"attributes,omitempty"`
	TraceState *TraceState `json:"tracestate,omitempty"`
}

type LinkType int32

const (
	UnspecifiedLinkType LinkType = 0
	ChildLinkType       LinkType = 1
	ParentLinkType      LinkType = 2
)

type Status struct {
	Code    int32  `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}