Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
254 changes: 133 additions & 121 deletions go/otel/otel.stef
Original file line number Diff line number Diff line change
Expand Up @@ -5,199 +5,211 @@

package com.example.otelstef

////////////////////////////////////////////////////////////////
// Schema that is common across all signals.
////////////////////////////////////////////////////////////////

multimap Attributes {
key string dict(AttributeKey)
key string dict(AttributeKey)
value AnyValue
}

multimap EnvelopeAttributes {
key string
value bytes
oneof AnyValue {
String string dict(AnyValueString)
Bool bool
Int64 int64
Float64 float64
Array []AnyValue
KVList KeyValueList
Bytes bytes
}

multimap KeyValueList {
key string
key string
value AnyValue
}

struct Resource dict(Resource) {
// All SchemaURL fields use the same (shared) dict.
SchemaURL string dict(SchemaURL)
Attributes Attributes
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 Scope dict(Scope) {
Name string dict(ScopeName)
Version string dict(ScopeVersion)
SchemaURL string dict(SchemaURL)
Attributes Attributes
DroppedAttributesCount uint64
}

struct Span {
TraceID bytes
SpanID bytes
TraceState string
ParentSpanID bytes
Flags uint64
Name string dict(SpanName)
Kind SpanKind
StartTimeUnixNano uint64
EndTimeUnixNano uint64
Attributes Attributes
DroppedAttributesCount uint64
Events []Event
Links []Link
Status SpanStatus
struct Envelope {
Attributes EnvelopeAttributes
}

enum SpanKind {
Unspecified = 0
Internal = 1
Server = 2
Client = 3
Producer = 4
Consumer = 5
multimap EnvelopeAttributes {
key string
value bytes
}

oneof PointValue {
Int64 int64
Float64 float64
Histogram HistogramValue
ExpHistogram ExpHistogramValue
Summary SummaryValue
////////////////////////////////////////////////////////////////
// Metric signal schema.
////////////////////////////////////////////////////////////////

struct Metrics root {
Envelope Envelope
Metric Metric
Resource Resource
Scope Scope
Attributes Attributes
Point Point
}

struct Metric dict(Metric) {
Name string dict(MetricName)
Description string dict(MetricDescription)
Unit string dict(MetricUnit)
Type MetricType
Metadata Attributes
HistogramBounds []float64
Name string dict(MetricName)
Description string dict(MetricDescription)
Unit string dict(MetricUnit)
Type MetricType
Metadata Attributes
HistogramBounds []float64
AggregationTemporality AggregationTemporality
Monotonic bool
Monotonic bool
}

enum MetricType {
Gauge = 0
Sum = 1
Histogram = 2
Gauge = 0
Sum = 1
Histogram = 2
ExpHistogram = 3
Summary = 4
Summary = 4
}

enum AggregationTemporality {
Unspecified = 0
Delta = 1
Cumulative = 2
Delta = 1
Cumulative = 2
}

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
// Point represents a metric data point.
struct Point {
StartTimestamp uint64
Timestamp uint64
Value PointValue
Exemplars []Exemplar
}

struct Link {
TraceID bytes
SpanID bytes
TraceState string
Flags uint64
Attributes Attributes
DroppedAttributesCount uint64
oneof PointValue {
Int64 int64
Float64 float64
Histogram HistogramValue
ExpHistogram ExpHistogramValue
Summary SummaryValue
}

struct HistogramValue {
Count int64
Sum float64 optional
Min float64 optional
Max float64 optional
Count int64
Sum float64 optional
Min float64 optional
Max float64 optional
BucketCounts []uint64
}

struct ExpHistogramValue {
Count uint64
Sum float64 optional
Min float64 optional
Max float64 optional
Scale int64
ZeroCount uint64
Count uint64
Sum float64 optional
Min float64 optional
Max float64 optional
Scale int64
ZeroCount uint64
PositiveBuckets ExpHistogramBuckets
NegativeBuckets ExpHistogramBuckets
ZeroThreshold float64
ZeroThreshold float64
}

struct ExpHistogramBuckets {
Offset int64
Offset int64
BucketCounts []uint64
}

struct SummaryValue {
Count uint64
Sum float64
Count uint64
Sum float64
QuantileValues []QuantileValue
}

struct QuantileValue {
Quantile float64
Value float64
Value float64
}

oneof AnyValue {
String string dict(AnyValueString)
Bool bool
Int64 int64
Float64 float64
Array []AnyValue
KVList KeyValueList
Bytes bytes
struct Exemplar {
Timestamp uint64
Value ExemplarValue
SpanID bytes
TraceID bytes
FilteredAttributes Attributes
}

struct Event {
Name string dict(SpanEventName)
TimeUnixNano uint64
Attributes Attributes
DroppedAttributesCount uint64
oneof ExemplarValue {
Int64 int64
Float64 float64
}

struct SpanStatus {
Message string
Code uint64
}
////////////////////////////////////////////////////////////////
// Trace signal schema.
////////////////////////////////////////////////////////////////

struct Spans root {
Envelope Envelope
Resource Resource
Scope Scope
Span Span
Scope Scope
Span Span
}

struct Envelope {
Attributes EnvelopeAttributes
struct Span {
TraceID bytes
SpanID bytes
TraceState string
ParentSpanID bytes
Flags uint64
Name string dict(SpanName)
Kind SpanKind
StartTimeUnixNano uint64
EndTimeUnixNano uint64
Attributes Attributes
DroppedAttributesCount uint64
Events []Event
Links []Link
Status SpanStatus
}

struct Exemplar {
Timestamp uint64
Value ExemplarValue
SpanID bytes
TraceID bytes
FilteredAttributes Attributes
enum SpanKind {
Unspecified = 0
Internal = 1
Server = 2
Client = 3
Producer = 4
Consumer = 5
}

oneof ExemplarValue {
Int64 int64
Float64 float64
struct Link {
TraceID bytes
SpanID bytes
TraceState string
Flags uint64
Attributes Attributes
DroppedAttributesCount uint64
}

struct Event {
Name string dict(SpanEventName)
TimeUnixNano uint64
Attributes Attributes
DroppedAttributesCount uint64
}

struct SpanStatus {
Message string
Code uint64
}
2 changes: 1 addition & 1 deletion go/otel/otelstef/common.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading