-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch generator to use STEF IDL (#53)
The generator now uses STEF IDL format as the input instead of JSON. I regenerated all serializers and the diff is 0, we got exact match. There are a few remaining schema tests that still use the JSON format as testdata. I will clean this up in a future PR, it will require a bit of refactoring.
- Loading branch information
1 parent
2d112e0
commit 636488c
Showing
8 changed files
with
166 additions
and
758 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
// This is Otel/STEF schema: a representation of OpenTelemetry data model | ||
// as STEF records. Data model is virtually a direct mapping from OpenTelemetry | ||
// Protobuf IDL for metrics and traces, see: https://github.com/open-telemetry/opentelemetry-proto/tree/main/opentelemetry/proto | ||
// TODO: add Logs and Profiles. | ||
|
||
package oteltef | ||
|
||
multimap Attributes { | ||
key string dict(AttributeKey) | ||
value AnyValue | ||
} | ||
|
||
multimap EnvelopeAttributes { | ||
key string | ||
value bytes | ||
} | ||
|
||
multimap KeyValueList { | ||
key string | ||
value AnyValue | ||
} | ||
|
||
struct Resource dict(Resource) { | ||
// All SchemaURL fields use the same (shared) dict. | ||
SchemaURL string dict(SchemaURL) | ||
Attributes Attributes | ||
DroppedAttributesCount uint64 | ||
} | ||
|
||
// Point represents a metric data point. | ||
struct Point { | ||
StartTimestamp uint64 | ||
Timestamp uint64 | ||
Value PointValue | ||
Exemplars []Exemplar | ||
} | ||
|
||
struct Span { | ||
TraceID bytes | ||
SpanID bytes | ||
TraceState string | ||
ParentSpanID bytes | ||
Flags uint64 | ||
Name string dict(SpanName) | ||
Kind uint64 | ||
StartTimeUnixNano uint64 | ||
EndTimeUnixNano uint64 | ||
Attributes Attributes | ||
DroppedAttributesCount uint64 | ||
Events []Event | ||
Links []Link | ||
Status SpanStatus | ||
} | ||
|
||
oneof PointValue { | ||
Int64 int64 | ||
Float64 float64 | ||
Histogram HistogramValue | ||
// TODO: Add Summary and Exponential Histogram value support. | ||
} | ||
|
||
struct Metric dict(Metric) { | ||
Name string dict(MetricName) | ||
Description string dict(MetricDescription) | ||
Unit string dict(MetricUnit) | ||
Type uint64 | ||
Metadata Attributes | ||
HistogramBounds []float64 | ||
AggregationTemporality uint64 | ||
Monotonic bool | ||
} | ||
|
||
struct Metrics root { | ||
Envelope Envelope | ||
Metric Metric | ||
Resource Resource | ||
Scope Scope | ||
Attributes Attributes | ||
Point Point | ||
} | ||
|
||
struct Scope dict(Scope) { | ||
Name string dict(ScopeName) | ||
Version string dict(ScopeVersion) | ||
SchemaURL string dict(SchemaURL) | ||
Attributes Attributes | ||
DroppedAttributesCount uint64 | ||
} | ||
|
||
struct Link { | ||
TraceID bytes | ||
SpanID bytes | ||
TraceState string | ||
Flags uint64 | ||
Attributes Attributes | ||
DroppedAttributesCount uint64 | ||
} | ||
|
||
struct HistogramValue { | ||
Count int64 | ||
Sum float64 optional | ||
Min float64 optional | ||
Max float64 optional | ||
BucketCounts []int64 | ||
} | ||
|
||
oneof AnyValue { | ||
String string dict(AnyValueString) | ||
Bool bool | ||
Int64 int64 | ||
Float64 float64 | ||
Array []AnyValue | ||
KVList KeyValueList | ||
Bytes bytes | ||
} | ||
|
||
struct Event { | ||
Name string dict(SpanEventName) | ||
TimeUnixNano uint64 | ||
Attributes Attributes | ||
DroppedAttributesCount uint64 | ||
} | ||
|
||
struct SpanStatus { | ||
Message string | ||
Code uint64 | ||
} | ||
|
||
struct Spans root { | ||
Envelope Envelope | ||
Resource Resource | ||
Scope Scope | ||
Span Span | ||
} | ||
|
||
struct Envelope { | ||
Attributes EnvelopeAttributes | ||
} | ||
|
||
struct Exemplar { | ||
Timestamp uint64 | ||
Value ExemplarValue | ||
SpanID bytes | ||
TraceID bytes | ||
FilteredAttributes Attributes | ||
} | ||
|
||
oneof ExemplarValue { | ||
Int64 int64 | ||
Float64 float64 | ||
} |
Oops, something went wrong.