Skip to content

Commit

Permalink
Switch to sibling version of schema for DroppedAttributesCount field
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrannajaryan committed Jan 29, 2025
1 parent 1777d40 commit 7530ae2
Show file tree
Hide file tree
Showing 31 changed files with 949 additions and 954 deletions.
2 changes: 1 addition & 1 deletion benchmarks/benchmarks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

var testEncodings = []encodings.MetricEncoding{
&otlp.OTLPEncoding{},
&stef.STEFEncoding{},
&stef.STEFEncoding{Opts: pkg.WriterOptions{Compression: pkg.CompressionNone}},
//&stef.STEFSEncoding{},
//&stef.STEFUEncoding{},
&otelarrow.OtelArrowEncoding{},
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/encodings/parquet/parquet.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (d *Encoding) FromOTLP(data pmetric.Metrics) (encodings.InMemoryData, error
err := byResource.Iter(
func(scope *oteltef.Scope, byScope *sortedbymetric.ByScope) error {
err := byScope.Iter(
func(attrs *oteltef.AttributesList, points *sortedbymetric.Points) error {
func(attrs *oteltef.Attributes, points *sortedbymetric.Points) error {
for _, value := range *points {
// TODO: histogram support
datums = append(
Expand All @@ -73,11 +73,11 @@ func (d *Encoding) FromOTLP(data pmetric.Metrics) (encodings.InMemoryData, error
Type: uint(metric.Type()),
Flags: uint(metric.AggregationTemporality()),
Resource: Resource{
Attributes: convertAttrs(resource.Attributes().List()),
Attributes: convertAttrs(resource.Attributes()),
SchemaURL: resource.SchemaURL(),
},
Scope: Scope{
Attributes: convertAttrs(scope.Attributes().List()),
Attributes: convertAttrs(scope.Attributes()),
SchemaURL: scope.SchemaURL(),
Name: scope.Name(),
Version: scope.Version(),
Expand Down Expand Up @@ -125,7 +125,7 @@ func (d *Encoding) Encode(data encodings.InMemoryData) ([]byte, error) {
return buf.Bytes(), nil
}

func convertAttrs(attrs *oteltef.AttributesList) (r []Attribute) {
func convertAttrs(attrs *oteltef.Attributes) (r []Attribute) {
for i := 0; i < attrs.Len(); i++ {
attr := attrs.At(i)
r = append(
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/encodings/parquet/parquetz.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (d *EncodingZ) FromOTLP(data pmetric.Metrics) (encodings.InMemoryData, erro
err := byResource.Iter(
func(scope *oteltef.Scope, byScope *sortedbymetric.ByScope) error {
err := byScope.Iter(
func(attrs *oteltef.AttributesList, points *sortedbymetric.Points) error {
func(attrs *oteltef.Attributes, points *sortedbymetric.Points) error {
for _, value := range *points {
datums = append(
datums, DatumZ{
Expand All @@ -195,11 +195,11 @@ func (d *EncodingZ) FromOTLP(data pmetric.Metrics) (encodings.InMemoryData, erro
Type: uint(metric.Type()),
Flags: uint(metric.AggregationTemporality()),
Resource: ResourceZ{
Attributes: convertAttrsZ(resource.Attributes().List()),
Attributes: convertAttrsZ(resource.Attributes()),
SchemaURL: resource.SchemaURL(),
},
Scope: ScopeZ{
Attributes: convertAttrsZ(scope.Attributes().List()),
Attributes: convertAttrsZ(scope.Attributes()),
SchemaURL: scope.SchemaURL(),
Name: scope.Name(),
Version: scope.Version(),
Expand Down Expand Up @@ -246,7 +246,7 @@ func (d *EncodingZ) Encode(data encodings.InMemoryData) ([]byte, error) {
return buf.Bytes(), nil
}

func convertAttrsZ(attrs *oteltef.AttributesList) (r []AttributeZ) {
func convertAttrsZ(attrs *oteltef.Attributes) (r []AttributeZ) {
for i := 0; i < attrs.Len(); i++ {
attr := attrs.At(i)
r = append(
Expand Down
Binary file modified benchmarks/testdata/astronomyshop.stefz
Binary file not shown.
Binary file modified benchmarks/testdata/hipstershop.stefz
Binary file not shown.
Binary file modified benchmarks/testdata/hostandcollectormetrics.stefz
Binary file not shown.
Binary file modified benchmarks/testdata/oteldemo-with-histogram.stefz
Binary file not shown.
4 changes: 2 additions & 2 deletions go/otel/manual_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func TestWriterFrameLimit(t *testing.T) {
assert.EqualValues(t, 4, buf.chunkCount)
}

func mapToTef(m map[string]any, out *oteltef.AttributesList) {
func mapToTef(m map[string]any, out *oteltef.Attributes) {
out.EnsureLen(len(m))
i := 0
for k, v := range m {
Expand Down Expand Up @@ -168,7 +168,7 @@ func valueToTef(v any, into *oteltef.AnyValue) {
}
}

func tefToMap(in *oteltef.AttributesList) map[string]any {
func tefToMap(in *oteltef.Attributes) map[string]any {
out := map[string]any{}

for i := 0; i < in.Len(); i++ {
Expand Down
53 changes: 30 additions & 23 deletions go/otel/oteltef.wire.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,6 @@
}
]
},
"Attributes": {
"name": "Attributes",
"fields": [
{
"multimap": "AttributesList",
"name": "List"
},
{
"name": "DroppedAttributeCount",
"primitive": 1
}
]
},
"Exemplar": {
"name": "Exemplar",
"fields": [
Expand All @@ -84,7 +71,7 @@
"name": "TraceID"
},
{
"multimap": "AttributesList",
"multimap": "Attributes",
"name": "FilteredAttributes"
}
]
Expand Down Expand Up @@ -157,7 +144,7 @@
"name": "Type"
},
{
"multimap": "AttributesList",
"multimap": "Attributes",
"name": "Metadata"
},
{
Expand Down Expand Up @@ -238,7 +225,7 @@
"name": "Scope"
},
{
"multimap": "AttributesList",
"multimap": "Attributes",
"name": "Attributes"
},
{
Expand All @@ -257,8 +244,12 @@
"name": "SchemaURL"
},
{
"struct": "Attributes",
"multimap": "Attributes",
"name": "Attributes"
},
{
"name": "DroppedAttributeCount",
"primitive": 1
}
]
},
Expand All @@ -282,8 +273,12 @@
"name": "SchemaURL"
},
{
"struct": "Attributes",
"multimap": "Attributes",
"name": "Attributes"
},
{
"name": "DroppedAttributeCount",
"primitive": 1
}
]
},
Expand Down Expand Up @@ -329,9 +324,13 @@
"name": "EndTimeUnixNano"
},
{
"struct": "Attributes",
"multimap": "Attributes",
"name": "Attributes"
},
{
"name": "DroppedAttributeCount",
"primitive": 1
},
{
"array": {
"struct": "Event"
Expand Down Expand Up @@ -371,8 +370,12 @@
"name": "Flags"
},
{
"struct": "Attributes",
"multimap": "Attributes",
"name": "Attributes"
},
{
"name": "DroppedAttributeCount",
"primitive": 1
}
]
},
Expand All @@ -390,8 +393,12 @@
"name": "TimeUnixNano"
},
{
"struct": "Attributes",
"multimap": "Attributes",
"name": "Attributes"
},
{
"name": "DroppedAttributeCount",
"primitive": 1
}
]
},
Expand Down Expand Up @@ -434,8 +441,8 @@
}
},
"multimaps": {
"AttributesList": {
"name": "AttributesList",
"Attributes": {
"name": "Attributes",
"key": {
"type": {
"primitive": 4,
Expand Down
Loading

0 comments on commit 7530ae2

Please sign in to comment.