...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package trace
16
17 import (
18 "time"
19
20 "go.opentelemetry.io/otel/attribute"
21 "go.opentelemetry.io/otel/sdk/instrumentation"
22 "go.opentelemetry.io/otel/sdk/resource"
23 "go.opentelemetry.io/otel/trace"
24 )
25
26
27
28 type snapshot struct {
29 name string
30 spanContext trace.SpanContext
31 parent trace.SpanContext
32 spanKind trace.SpanKind
33 startTime time.Time
34 endTime time.Time
35 attributes []attribute.KeyValue
36 events []Event
37 links []Link
38 status Status
39 childSpanCount int
40 droppedAttributeCount int
41 droppedEventCount int
42 droppedLinkCount int
43 resource *resource.Resource
44 instrumentationScope instrumentation.Scope
45 }
46
47 var _ ReadOnlySpan = snapshot{}
48
49 func (s snapshot) private() {}
50
51
52 func (s snapshot) Name() string {
53 return s.name
54 }
55
56
57 func (s snapshot) SpanContext() trace.SpanContext {
58 return s.spanContext
59 }
60
61
62
63
64 func (s snapshot) Parent() trace.SpanContext {
65 return s.parent
66 }
67
68
69 func (s snapshot) SpanKind() trace.SpanKind {
70 return s.spanKind
71 }
72
73
74 func (s snapshot) StartTime() time.Time {
75 return s.startTime
76 }
77
78
79
80 func (s snapshot) EndTime() time.Time {
81 return s.endTime
82 }
83
84
85 func (s snapshot) Attributes() []attribute.KeyValue {
86 return s.attributes
87 }
88
89
90 func (s snapshot) Links() []Link {
91 return s.links
92 }
93
94
95
96 func (s snapshot) Events() []Event {
97 return s.events
98 }
99
100
101 func (s snapshot) Status() Status {
102 return s.status
103 }
104
105
106
107 func (s snapshot) InstrumentationScope() instrumentation.Scope {
108 return s.instrumentationScope
109 }
110
111
112
113 func (s snapshot) InstrumentationLibrary() instrumentation.Library {
114 return s.instrumentationScope
115 }
116
117
118 func (s snapshot) Resource() *resource.Resource {
119 return s.resource
120 }
121
122
123
124 func (s snapshot) DroppedAttributes() int {
125 return s.droppedAttributeCount
126 }
127
128
129
130 func (s snapshot) DroppedLinks() int {
131 return s.droppedLinkCount
132 }
133
134
135
136 func (s snapshot) DroppedEvents() int {
137 return s.droppedEventCount
138 }
139
140
141
142 func (s snapshot) ChildSpanCount() int {
143 return s.childSpanCount
144 }
145
View as plain text