Skip to content

Commit cc9569f

Browse files
Format and reorder otel.stef content by signal (#290)
This is just a formatting change, the content is logically equivalent.
1 parent 036a678 commit cc9569f

File tree

3 files changed

+135
-310
lines changed

3 files changed

+135
-310
lines changed

go/otel/otel.stef

Lines changed: 133 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -5,199 +5,211 @@
55

66
package com.example.otelstef
77

8+
////////////////////////////////////////////////////////////////
9+
// Schema that is common across all signals.
10+
////////////////////////////////////////////////////////////////
11+
812
multimap Attributes {
9-
key string dict(AttributeKey)
13+
key string dict(AttributeKey)
1014
value AnyValue
1115
}
1216

13-
multimap EnvelopeAttributes {
14-
key string
15-
value bytes
17+
oneof AnyValue {
18+
String string dict(AnyValueString)
19+
Bool bool
20+
Int64 int64
21+
Float64 float64
22+
Array []AnyValue
23+
KVList KeyValueList
24+
Bytes bytes
1625
}
1726

1827
multimap KeyValueList {
19-
key string
28+
key string
2029
value AnyValue
2130
}
2231

2332
struct Resource dict(Resource) {
2433
// All SchemaURL fields use the same (shared) dict.
25-
SchemaURL string dict(SchemaURL)
26-
Attributes Attributes
34+
SchemaURL string dict(SchemaURL)
35+
Attributes Attributes
2736
DroppedAttributesCount uint64
2837
}
2938

30-
// Point represents a metric data point.
31-
struct Point {
32-
StartTimestamp uint64
33-
Timestamp uint64
34-
Value PointValue
35-
Exemplars []Exemplar
39+
struct Scope dict(Scope) {
40+
Name string dict(ScopeName)
41+
Version string dict(ScopeVersion)
42+
SchemaURL string dict(SchemaURL)
43+
Attributes Attributes
44+
DroppedAttributesCount uint64
3645
}
3746

38-
struct Span {
39-
TraceID bytes
40-
SpanID bytes
41-
TraceState string
42-
ParentSpanID bytes
43-
Flags uint64
44-
Name string dict(SpanName)
45-
Kind SpanKind
46-
StartTimeUnixNano uint64
47-
EndTimeUnixNano uint64
48-
Attributes Attributes
49-
DroppedAttributesCount uint64
50-
Events []Event
51-
Links []Link
52-
Status SpanStatus
47+
struct Envelope {
48+
Attributes EnvelopeAttributes
5349
}
5450

55-
enum SpanKind {
56-
Unspecified = 0
57-
Internal = 1
58-
Server = 2
59-
Client = 3
60-
Producer = 4
61-
Consumer = 5
51+
multimap EnvelopeAttributes {
52+
key string
53+
value bytes
6254
}
6355

64-
oneof PointValue {
65-
Int64 int64
66-
Float64 float64
67-
Histogram HistogramValue
68-
ExpHistogram ExpHistogramValue
69-
Summary SummaryValue
56+
////////////////////////////////////////////////////////////////
57+
// Metric signal schema.
58+
////////////////////////////////////////////////////////////////
59+
60+
struct Metrics root {
61+
Envelope Envelope
62+
Metric Metric
63+
Resource Resource
64+
Scope Scope
65+
Attributes Attributes
66+
Point Point
7067
}
7168

7269
struct Metric dict(Metric) {
73-
Name string dict(MetricName)
74-
Description string dict(MetricDescription)
75-
Unit string dict(MetricUnit)
76-
Type MetricType
77-
Metadata Attributes
78-
HistogramBounds []float64
70+
Name string dict(MetricName)
71+
Description string dict(MetricDescription)
72+
Unit string dict(MetricUnit)
73+
Type MetricType
74+
Metadata Attributes
75+
HistogramBounds []float64
7976
AggregationTemporality AggregationTemporality
80-
Monotonic bool
77+
Monotonic bool
8178
}
8279

8380
enum MetricType {
84-
Gauge = 0
85-
Sum = 1
86-
Histogram = 2
81+
Gauge = 0
82+
Sum = 1
83+
Histogram = 2
8784
ExpHistogram = 3
88-
Summary = 4
85+
Summary = 4
8986
}
9087

9188
enum AggregationTemporality {
9289
Unspecified = 0
93-
Delta = 1
94-
Cumulative = 2
90+
Delta = 1
91+
Cumulative = 2
9592
}
9693

97-
struct Metrics root {
98-
Envelope Envelope
99-
Metric Metric
100-
Resource Resource
101-
Scope Scope
102-
Attributes Attributes
103-
Point Point
104-
}
105-
106-
struct Scope dict(Scope) {
107-
Name string dict(ScopeName)
108-
Version string dict(ScopeVersion)
109-
SchemaURL string dict(SchemaURL)
110-
Attributes Attributes
111-
DroppedAttributesCount uint64
94+
// Point represents a metric data point.
95+
struct Point {
96+
StartTimestamp uint64
97+
Timestamp uint64
98+
Value PointValue
99+
Exemplars []Exemplar
112100
}
113101

114-
struct Link {
115-
TraceID bytes
116-
SpanID bytes
117-
TraceState string
118-
Flags uint64
119-
Attributes Attributes
120-
DroppedAttributesCount uint64
102+
oneof PointValue {
103+
Int64 int64
104+
Float64 float64
105+
Histogram HistogramValue
106+
ExpHistogram ExpHistogramValue
107+
Summary SummaryValue
121108
}
122109

123110
struct HistogramValue {
124-
Count int64
125-
Sum float64 optional
126-
Min float64 optional
127-
Max float64 optional
111+
Count int64
112+
Sum float64 optional
113+
Min float64 optional
114+
Max float64 optional
128115
BucketCounts []uint64
129116
}
130117

131118
struct ExpHistogramValue {
132-
Count uint64
133-
Sum float64 optional
134-
Min float64 optional
135-
Max float64 optional
136-
Scale int64
137-
ZeroCount uint64
119+
Count uint64
120+
Sum float64 optional
121+
Min float64 optional
122+
Max float64 optional
123+
Scale int64
124+
ZeroCount uint64
138125
PositiveBuckets ExpHistogramBuckets
139126
NegativeBuckets ExpHistogramBuckets
140-
ZeroThreshold float64
127+
ZeroThreshold float64
141128
}
142129

143130
struct ExpHistogramBuckets {
144-
Offset int64
131+
Offset int64
145132
BucketCounts []uint64
146133
}
147134

148135
struct SummaryValue {
149-
Count uint64
150-
Sum float64
136+
Count uint64
137+
Sum float64
151138
QuantileValues []QuantileValue
152139
}
153140

154141
struct QuantileValue {
155142
Quantile float64
156-
Value float64
143+
Value float64
157144
}
158145

159-
oneof AnyValue {
160-
String string dict(AnyValueString)
161-
Bool bool
162-
Int64 int64
163-
Float64 float64
164-
Array []AnyValue
165-
KVList KeyValueList
166-
Bytes bytes
146+
struct Exemplar {
147+
Timestamp uint64
148+
Value ExemplarValue
149+
SpanID bytes
150+
TraceID bytes
151+
FilteredAttributes Attributes
167152
}
168153

169-
struct Event {
170-
Name string dict(SpanEventName)
171-
TimeUnixNano uint64
172-
Attributes Attributes
173-
DroppedAttributesCount uint64
154+
oneof ExemplarValue {
155+
Int64 int64
156+
Float64 float64
174157
}
175158

176-
struct SpanStatus {
177-
Message string
178-
Code uint64
179-
}
159+
////////////////////////////////////////////////////////////////
160+
// Trace signal schema.
161+
////////////////////////////////////////////////////////////////
180162

181163
struct Spans root {
182164
Envelope Envelope
183165
Resource Resource
184-
Scope Scope
185-
Span Span
166+
Scope Scope
167+
Span Span
186168
}
187169

188-
struct Envelope {
189-
Attributes EnvelopeAttributes
170+
struct Span {
171+
TraceID bytes
172+
SpanID bytes
173+
TraceState string
174+
ParentSpanID bytes
175+
Flags uint64
176+
Name string dict(SpanName)
177+
Kind SpanKind
178+
StartTimeUnixNano uint64
179+
EndTimeUnixNano uint64
180+
Attributes Attributes
181+
DroppedAttributesCount uint64
182+
Events []Event
183+
Links []Link
184+
Status SpanStatus
190185
}
191186

192-
struct Exemplar {
193-
Timestamp uint64
194-
Value ExemplarValue
195-
SpanID bytes
196-
TraceID bytes
197-
FilteredAttributes Attributes
187+
enum SpanKind {
188+
Unspecified = 0
189+
Internal = 1
190+
Server = 2
191+
Client = 3
192+
Producer = 4
193+
Consumer = 5
198194
}
199195

200-
oneof ExemplarValue {
201-
Int64 int64
202-
Float64 float64
196+
struct Link {
197+
TraceID bytes
198+
SpanID bytes
199+
TraceState string
200+
Flags uint64
201+
Attributes Attributes
202+
DroppedAttributesCount uint64
203+
}
204+
205+
struct Event {
206+
Name string dict(SpanEventName)
207+
TimeUnixNano uint64
208+
Attributes Attributes
209+
DroppedAttributesCount uint64
210+
}
211+
212+
struct SpanStatus {
213+
Message string
214+
Code uint64
203215
}

go/otel/otelstef/common.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)