From 22fdd41bf306c556c3f09ae86e4b77ff0375832e Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 27 Oct 2020 15:35:39 -0700 Subject: [PATCH] Make all StringKeyValue non-nullable (#2019) * Make all StringKeyValue non-nullable Add benchmarks for logs and metrics similar to traces. Before: ``` goos: darwin goarch: amd64 pkg: go.opentelemetry.io/collector/consumer/pdata BenchmarkMetricsFromOtlp BenchmarkMetricsFromOtlp-16 298 3999204 ns/op 2424909 B/op 70785 allocs/op PASS ``` After: ``` goos: darwin goarch: amd64 pkg: go.opentelemetry.io/collector/consumer/pdata BenchmarkMetricsFromOtlp BenchmarkMetricsFromOtlp-16 326 3630227 ns/op 2271248 B/op 51577 allocs/op PASS ``` Signed-off-by: Bogdan Drutu * Update consumer/pdata/common_test.go Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> --- Makefile | 1 - consumer/pdata/common.go | 66 +++---- consumer/pdata/common_test.go | 50 +---- consumer/pdata/log_test.go | 27 +++ consumer/pdata/metric_test.go | 44 ++++- consumer/simple/metrics_test.go | 2 + .../prometheusremotewriteexporter/helper.go | 2 +- .../helper_test.go | 2 +- .../testutil_test.go | 14 +- .../metrics/v1/metrics.pb.go | 182 +++++++++--------- internal/data/testdata/common.go | 20 +- proto_patch.sed | 5 + receiver/otlpreceiver/metrics/otlp_test.go | 4 +- 13 files changed, 222 insertions(+), 197 deletions(-) diff --git a/Makefile b/Makefile index 2eb887e6d1c..09cb7c631b8 100644 --- a/Makefile +++ b/Makefile @@ -273,7 +273,6 @@ genproto_sub: @echo Modify them in the intermediate directory. $(foreach file,$(OPENTELEMETRY_PROTO_FILES),$(call exec-command,sed -f proto_patch.sed $(OPENTELEMETRY_PROTO_SRC_DIR)/$(file) > $(PROTO_INTERMEDIATE_DIR)/$(file))) - @echo Generate Go code from .proto files in intermediate directory. $(foreach file,$(OPENTELEMETRY_PROTO_FILES),$(call exec-command,$(PROTOC) $(PROTO_INCLUDES) --gogofaster_out=plugins=grpc:./ $(file))) diff --git a/consumer/pdata/common.go b/consumer/pdata/common.go index 55ea5e70174..8374ffb5925 100644 --- a/consumer/pdata/common.go +++ b/consumer/pdata/common.go @@ -724,7 +724,8 @@ func (am AttributeMap) Len() int { // }) func (am AttributeMap) ForEach(f func(k string, v AttributeValue)) { for i := range *am.orig { - f((*am.orig)[i].Key, AttributeValue{&(*am.orig)[i].Value}) + kv := &(*am.orig)[i] + f(kv.Key, AttributeValue{&kv.Value}) } } @@ -792,22 +793,22 @@ func (akv StringValue) SetValue(v string) { akv.orig.Value = v } -func newStringKeyValue(k, v string) *otlpcommon.StringKeyValue { - return &otlpcommon.StringKeyValue{Key: k, Value: v} +func newStringKeyValue(k, v string) otlpcommon.StringKeyValue { + return otlpcommon.StringKeyValue{Key: k, Value: v} } // StringMap stores a map of attribute keys to values. type StringMap struct { - orig *[]*otlpcommon.StringKeyValue + orig *[]otlpcommon.StringKeyValue } // NewStringMap creates a StringMap with 0 elements. func NewStringMap() StringMap { - orig := []*otlpcommon.StringKeyValue(nil) + orig := []otlpcommon.StringKeyValue(nil) return StringMap{&orig} } -func newStringMap(orig *[]*otlpcommon.StringKeyValue) StringMap { +func newStringMap(orig *[]otlpcommon.StringKeyValue) StringMap { return StringMap{orig} } @@ -818,37 +819,36 @@ func newStringMap(orig *[]*otlpcommon.StringKeyValue) StringMap { // assert.EqualValues(t, NewStringMap().InitFromMap(map[string]string{...}), actual) func (sm StringMap) InitFromMap(attrMap map[string]string) StringMap { if len(attrMap) == 0 { - *sm.orig = []*otlpcommon.StringKeyValue(nil) + *sm.orig = []otlpcommon.StringKeyValue(nil) return sm } origs := make([]otlpcommon.StringKeyValue, len(attrMap)) - wrappers := make([]*otlpcommon.StringKeyValue, len(attrMap)) ix := 0 for k, v := range attrMap { - wrappers[ix] = &origs[ix] - wrappers[ix].Key = k - wrappers[ix].Value = v + origs[ix].Key = k + origs[ix].Value = v ix++ } - *sm.orig = wrappers + *sm.orig = origs return sm } // InitEmptyWithCapacity constructs an empty StringMap with predefined slice capacity. func (sm StringMap) InitEmptyWithCapacity(cap int) { if cap == 0 { - *sm.orig = []*otlpcommon.StringKeyValue(nil) + *sm.orig = []otlpcommon.StringKeyValue(nil) } - *sm.orig = make([]*otlpcommon.StringKeyValue, 0, cap) + *sm.orig = make([]otlpcommon.StringKeyValue, 0, cap) } // Get returns the StringValue associated with the key and true, // otherwise an invalid instance of the StringKeyValue and false. // Calling any functions on the returned invalid instance will cause a panic. func (sm StringMap) Get(k string) (StringValue, bool) { - for _, a := range *sm.orig { - if a != nil && a.Key == k { - return StringValue{a}, true + for i := range *sm.orig { + skv := &(*sm.orig)[i] + if skv.Key == k { + return StringValue{skv}, true } } return StringValue{nil}, false @@ -857,8 +857,9 @@ func (sm StringMap) Get(k string) (StringValue, bool) { // Delete deletes the entry associated with the key and returns true if the key // was present in the map, otherwise returns false. func (sm StringMap) Delete(k string) bool { - for i, a := range *sm.orig { - if a != nil && a.Key == k { + for i := range *sm.orig { + skv := &(*sm.orig)[i] + if skv.Key == k { (*sm.orig)[i] = (*sm.orig)[len(*sm.orig)-1] *sm.orig = (*sm.orig)[:len(*sm.orig)-1] return true @@ -910,11 +911,9 @@ func (sm StringMap) Len() int { // ... // }) func (sm StringMap) ForEach(f func(k string, v StringValue)) { - for _, kv := range *sm.orig { - if kv == nil { - continue - } - f(kv.Key, StringValue{kv}) + for i := range *sm.orig { + skv := &(*sm.orig)[i] + f(skv.Key, StringValue{skv}) } } @@ -922,26 +921,25 @@ func (sm StringMap) ForEach(f func(k string, v StringValue)) { func (sm StringMap) CopyTo(dest StringMap) { newLen := len(*sm.orig) if newLen == 0 { - *dest.orig = []*otlpcommon.StringKeyValue(nil) + *dest.orig = []otlpcommon.StringKeyValue(nil) return } oldLen := len(*dest.orig) if newLen <= oldLen { *dest.orig = (*dest.orig)[:newLen] - for i, kv := range *sm.orig { - (*dest.orig)[i].Key = kv.Key - (*dest.orig)[i].Value = kv.Value + for i := range *sm.orig { + skv := &(*sm.orig)[i] + (*dest.orig)[i].Key = skv.Key + (*dest.orig)[i].Value = skv.Value } return } origs := make([]otlpcommon.StringKeyValue, len(*sm.orig)) - wrappers := make([]*otlpcommon.StringKeyValue, len(*sm.orig)) for i, kv := range *sm.orig { - wrappers[i] = &origs[i] - wrappers[i].Key = kv.Key - wrappers[i].Value = kv.Value + origs[i].Key = kv.Key + origs[i].Value = kv.Value } - *dest.orig = wrappers + *dest.orig = origs } // Sort sorts the entries in the StringMap so two instances can be compared. @@ -950,7 +948,7 @@ func (sm StringMap) CopyTo(dest StringMap) { func (sm StringMap) Sort() StringMap { sort.SliceStable(*sm.orig, func(i, j int) bool { // Intention is to move the nil values at the end. - return ((*sm.orig)[j] == nil) || ((*sm.orig)[i] != nil && (*sm.orig)[i].Key < (*sm.orig)[j].Key) + return (*sm.orig)[i].Key < (*sm.orig)[j].Key }) return sm } diff --git a/consumer/pdata/common_test.go b/consumer/pdata/common_test.go index d33854f0b54..a436e8afcf5 100644 --- a/consumer/pdata/common_test.go +++ b/consumer/pdata/common_test.go @@ -715,14 +715,13 @@ func TestNilStringMap(t *testing.T) { assert.EqualValues(t, NewStringMap(), NewStringMap().Sort()) } -func TestStringMapWithNilValues(t *testing.T) { - origWithNil := []*otlpcommon.StringKeyValue{ - nil, +func TestStringMapWithEmpty(t *testing.T) { + origWithNil := []otlpcommon.StringKeyValue{ + {}, { Key: "test_key", Value: "test_value", }, - nil, } sm := StringMap{ orig: &origWithNil, @@ -844,38 +843,6 @@ func TestStringMap_ForEach(t *testing.T) { assert.EqualValues(t, 0, len(rawMap)) } -func TestStringMap_ForEach_WithNils(t *testing.T) { - rawMap := map[string]string{"k0": "v0", "k1": "v1", "k2": "v2"} - rawOrigWithNil := []*otlpcommon.StringKeyValue{ - nil, - { - Key: "k0", - Value: "v0", - }, - nil, - { - Key: "k1", - Value: "v1", - }, - nil, - { - Key: "k2", - Value: "v2", - }, - nil, - } - sm := StringMap{ - orig: &rawOrigWithNil, - } - assert.EqualValues(t, 7, sm.Len()) - - sm.ForEach(func(k string, v StringValue) { - assert.EqualValues(t, rawMap[k], v.Value()) - delete(rawMap, k) - }) - assert.EqualValues(t, 0, len(rawMap)) -} - func TestStringMap_CopyTo(t *testing.T) { dest := NewStringMap() // Test CopyTo to empty @@ -896,7 +863,7 @@ func TestStringMap_InitFromMap(t *testing.T) { assert.EqualValues(t, NewStringMap(), sm) rawMap := map[string]string{"k0": "v0", "k1": "v1", "k2": "v2"} - rawOrig := []*otlpcommon.StringKeyValue{ + rawOrig := []otlpcommon.StringKeyValue{ { Key: "k0", Value: "v0", @@ -987,15 +954,15 @@ func BenchmarkAttributeMap_RangeOverMap(b *testing.B) { func BenchmarkStringMap_ForEach(b *testing.B) { const numElements = 20 - rawOrigWithNil := make([]*otlpcommon.StringKeyValue, 2*numElements) + rawOrig := make([]otlpcommon.StringKeyValue, numElements) for i := 0; i < numElements; i++ { - rawOrigWithNil[i*2] = &otlpcommon.StringKeyValue{ + rawOrig[i] = otlpcommon.StringKeyValue{ Key: "k" + strconv.Itoa(i), Value: "v" + strconv.Itoa(i), } } sm := StringMap{ - orig: &rawOrigWithNil, + orig: &rawOrig, } b.ResetTimer() for n := 0; n < b.N; n++ { @@ -1014,7 +981,8 @@ func BenchmarkStringMap_RangeOverMap(b *testing.B) { rawOrig := make(map[string]StringValue, numElements) for i := 0; i < numElements; i++ { key := "k" + strconv.Itoa(i) - rawOrig[key] = StringValue{newStringKeyValue(key, "v"+strconv.Itoa(i))} + skv := newStringKeyValue(key, "v"+strconv.Itoa(i)) + rawOrig[key] = StringValue{&skv} } b.ResetTimer() diff --git a/consumer/pdata/log_test.go b/consumer/pdata/log_test.go index e2b79f2816f..78a8579d630 100644 --- a/consumer/pdata/log_test.go +++ b/consumer/pdata/log_test.go @@ -18,6 +18,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/internal" otlplogs "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1" @@ -105,3 +106,29 @@ func BenchmarkLogsClone(b *testing.B) { } } } + +func BenchmarkLogsToOtlp(b *testing.B) { + traces := NewLogs() + fillTestResourceLogsSlice(traces.ResourceLogs()) + b.ResetTimer() + for n := 0; n < b.N; n++ { + buf, err := traces.ToOtlpProtoBytes() + require.NoError(b, err) + assert.NotEqual(b, 0, len(buf)) + } +} + +func BenchmarkLogsFromOtlp(b *testing.B) { + baseLogs := NewLogs() + fillTestResourceLogsSlice(baseLogs.ResourceLogs()) + buf, err := baseLogs.ToOtlpProtoBytes() + require.NoError(b, err) + assert.NotEqual(b, 0, len(buf)) + b.ResetTimer() + b.ReportAllocs() + for n := 0; n < b.N; n++ { + traces := NewLogs() + require.NoError(b, traces.FromOtlpProtoBytes(buf)) + assert.Equal(b, baseLogs.ResourceLogs().Len(), traces.ResourceLogs().Len()) + } +} diff --git a/consumer/pdata/metric_test.go b/consumer/pdata/metric_test.go index 5f4ddd1b7ac..bc3d6bb5e02 100644 --- a/consumer/pdata/metric_test.go +++ b/consumer/pdata/metric_test.go @@ -499,7 +499,7 @@ func TestOtlpToFromInternalIntGaugeMutating(t *testing.T) { IntGauge: &otlpmetrics.IntGauge{ DataPoints: []*otlpmetrics.IntDataPoint{ { - Labels: []*otlpcommon.StringKeyValue{ + Labels: []otlpcommon.StringKeyValue{ { Key: "k", Value: "v", @@ -576,7 +576,7 @@ func TestOtlpToFromInternalDoubleSumMutating(t *testing.T) { AggregationTemporality: otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, DataPoints: []*otlpmetrics.DoubleDataPoint{ { - Labels: []*otlpcommon.StringKeyValue{ + Labels: []otlpcommon.StringKeyValue{ { Key: "k", Value: "v", @@ -653,7 +653,7 @@ func TestOtlpToFromInternalHistogramMutating(t *testing.T) { AggregationTemporality: otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA, DataPoints: []*otlpmetrics.DoubleHistogramDataPoint{ { - Labels: []*otlpcommon.StringKeyValue{ + Labels: []otlpcommon.StringKeyValue{ { Key: "k", Value: "v", @@ -812,6 +812,32 @@ func BenchmarkMetrics_ToOtlpProtoBytes_PassThrough(b *testing.B) { } } +func BenchmarkMetricsToOtlp(b *testing.B) { + traces := NewMetrics() + fillTestResourceMetricsSlice(traces.ResourceMetrics()) + b.ResetTimer() + for n := 0; n < b.N; n++ { + buf, err := traces.ToOtlpProtoBytes() + require.NoError(b, err) + assert.NotEqual(b, 0, len(buf)) + } +} + +func BenchmarkMetricsFromOtlp(b *testing.B) { + baseMetrics := NewMetrics() + fillTestResourceMetricsSlice(baseMetrics.ResourceMetrics()) + buf, err := baseMetrics.ToOtlpProtoBytes() + require.NoError(b, err) + assert.NotEqual(b, 0, len(buf)) + b.ResetTimer() + b.ReportAllocs() + for n := 0; n < b.N; n++ { + traces := NewMetrics() + require.NoError(b, traces.FromOtlpProtoBytes(buf)) + assert.Equal(b, baseMetrics.ResourceMetrics().Len(), traces.ResourceMetrics().Len()) + } +} + func generateTestProtoResource() *otlpresource.Resource { return &otlpresource.Resource{ Attributes: []otlpcommon.KeyValue{ @@ -839,7 +865,7 @@ func generateTestProtoIntGaugeMetric() *otlpmetrics.Metric { IntGauge: &otlpmetrics.IntGauge{ DataPoints: []*otlpmetrics.IntDataPoint{ { - Labels: []*otlpcommon.StringKeyValue{ + Labels: []otlpcommon.StringKeyValue{ { Key: "key0", Value: "value0", @@ -850,7 +876,7 @@ func generateTestProtoIntGaugeMetric() *otlpmetrics.Metric { Value: 123, }, { - Labels: []*otlpcommon.StringKeyValue{ + Labels: []otlpcommon.StringKeyValue{ { Key: "key1", Value: "value1", @@ -875,7 +901,7 @@ func generateTestProtoDoubleSumMetric() *otlpmetrics.Metric { AggregationTemporality: otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, DataPoints: []*otlpmetrics.DoubleDataPoint{ { - Labels: []*otlpcommon.StringKeyValue{ + Labels: []otlpcommon.StringKeyValue{ { Key: "key0", Value: "value0", @@ -886,7 +912,7 @@ func generateTestProtoDoubleSumMetric() *otlpmetrics.Metric { Value: 123.1, }, { - Labels: []*otlpcommon.StringKeyValue{ + Labels: []otlpcommon.StringKeyValue{ { Key: "key1", Value: "value1", @@ -912,7 +938,7 @@ func generateTestProtoDoubleHistogramMetric() *otlpmetrics.Metric { AggregationTemporality: otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA, DataPoints: []*otlpmetrics.DoubleHistogramDataPoint{ { - Labels: []*otlpcommon.StringKeyValue{ + Labels: []otlpcommon.StringKeyValue{ { Key: "key0", Value: "value0", @@ -924,7 +950,7 @@ func generateTestProtoDoubleHistogramMetric() *otlpmetrics.Metric { ExplicitBounds: []float64{1, 2}, }, { - Labels: []*otlpcommon.StringKeyValue{ + Labels: []otlpcommon.StringKeyValue{ { Key: "key1", Value: "value1", diff --git a/consumer/simple/metrics_test.go b/consumer/simple/metrics_test.go index a318dd8ccad..110ff8836f5 100644 --- a/consumer/simple/metrics_test.go +++ b/consumer/simple/metrics_test.go @@ -229,6 +229,7 @@ func TestMetrics(t *testing.T) { "int_histogram": { "data_points": [ { + "labels": null, "time_unix_nano": 1597266546570840817 } ] @@ -241,6 +242,7 @@ func TestMetrics(t *testing.T) { "double_histogram": { "data_points": [ { + "labels": null, "time_unix_nano": 1597266546570840817 } ] diff --git a/exporter/prometheusremotewriteexporter/helper.go b/exporter/prometheusremotewriteexporter/helper.go index 6939d488382..4ccfa2a74ab 100644 --- a/exporter/prometheusremotewriteexporter/helper.go +++ b/exporter/prometheusremotewriteexporter/helper.go @@ -122,7 +122,7 @@ func timeSeriesSignature(metric *otlp.Metric, labels *[]prompb.Label) string { // createLabelSet creates a slice of Cortex Label with OTLP labels and paris of string values. // Unpaired string value is ignored. String pairs overwrites OTLP labels if collision happens, and the overwrite is // logged. Resultant label names are sanitized. -func createLabelSet(labels []*common.StringKeyValue, extras ...string) []prompb.Label { +func createLabelSet(labels []common.StringKeyValue, extras ...string) []prompb.Label { // map ensures no duplicate label name l := map[string]prompb.Label{} diff --git a/exporter/prometheusremotewriteexporter/helper_test.go b/exporter/prometheusremotewriteexporter/helper_test.go index c93626325c7..e2a1c53daf7 100644 --- a/exporter/prometheusremotewriteexporter/helper_test.go +++ b/exporter/prometheusremotewriteexporter/helper_test.go @@ -185,7 +185,7 @@ func Test_timeSeriesSignature(t *testing.T) { func Test_createLabelSet(t *testing.T) { tests := []struct { name string - orig []*common.StringKeyValue + orig []common.StringKeyValue extras []string want []prompb.Label }{ diff --git a/exporter/prometheusremotewriteexporter/testutil_test.go b/exporter/prometheusremotewriteexporter/testutil_test.go index 5db687eccad..56895b5477b 100644 --- a/exporter/prometheusremotewriteexporter/testutil_test.go +++ b/exporter/prometheusremotewriteexporter/testutil_test.go @@ -410,10 +410,10 @@ var ( // OTLP metrics // labels must come in pairs -func getLabels(labels ...string) []*commonpb.StringKeyValue { - var set []*commonpb.StringKeyValue +func getLabels(labels ...string) []commonpb.StringKeyValue { + var set []commonpb.StringKeyValue for i := 0; i < len(labels); i += 2 { - set = append(set, &commonpb.StringKeyValue{ + set = append(set, commonpb.StringKeyValue{ Key: labels[i], Value: labels[i+1], }) @@ -421,7 +421,7 @@ func getLabels(labels ...string) []*commonpb.StringKeyValue { return set } -func getIntDataPoint(labels []*commonpb.StringKeyValue, value int64, ts uint64) *otlp.IntDataPoint { +func getIntDataPoint(labels []commonpb.StringKeyValue, value int64, ts uint64) *otlp.IntDataPoint { return &otlp.IntDataPoint{ Labels: labels, StartTimeUnixNano: 0, @@ -430,7 +430,7 @@ func getIntDataPoint(labels []*commonpb.StringKeyValue, value int64, ts uint64) } } -func getDoubleDataPoint(labels []*commonpb.StringKeyValue, value float64, ts uint64) *otlp.DoubleDataPoint { +func getDoubleDataPoint(labels []commonpb.StringKeyValue, value float64, ts uint64) *otlp.DoubleDataPoint { return &otlp.DoubleDataPoint{ Labels: labels, StartTimeUnixNano: 0, @@ -439,7 +439,7 @@ func getDoubleDataPoint(labels []*commonpb.StringKeyValue, value float64, ts uin } } -func getIntHistogramDataPoint(labels []*commonpb.StringKeyValue, ts uint64, sum float64, count uint64, bounds []float64, +func getIntHistogramDataPoint(labels []commonpb.StringKeyValue, ts uint64, sum float64, count uint64, bounds []float64, buckets []uint64) *otlp.IntHistogramDataPoint { return &otlp.IntHistogramDataPoint{ Labels: labels, @@ -453,7 +453,7 @@ func getIntHistogramDataPoint(labels []*commonpb.StringKeyValue, ts uint64, sum } } -func getDoubleHistogramDataPoint(labels []*commonpb.StringKeyValue, ts uint64, sum float64, count uint64, +func getDoubleHistogramDataPoint(labels []commonpb.StringKeyValue, ts uint64, sum float64, count uint64, bounds []float64, buckets []uint64) *otlp.DoubleHistogramDataPoint { return &otlp.DoubleHistogramDataPoint{ Labels: labels, diff --git a/internal/data/opentelemetry-proto-gen/metrics/v1/metrics.pb.go b/internal/data/opentelemetry-proto-gen/metrics/v1/metrics.pb.go index 60ed46b97d5..0953b94e44f 100644 --- a/internal/data/opentelemetry-proto-gen/metrics/v1/metrics.pb.go +++ b/internal/data/opentelemetry-proto-gen/metrics/v1/metrics.pb.go @@ -825,7 +825,7 @@ func (m *DoubleHistogram) GetAggregationTemporality() AggregationTemporality { // time-varying values of a int64 metric. type IntDataPoint struct { // The set of labels that uniquely identify this timeseries. - Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + Labels []v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` // start_time_unix_nano is the last time when the aggregation value was reset // to "zero". For some metric types this is ignored, see data types for more // details. @@ -884,7 +884,7 @@ func (m *IntDataPoint) XXX_DiscardUnknown() { var xxx_messageInfo_IntDataPoint proto.InternalMessageInfo -func (m *IntDataPoint) GetLabels() []*v11.StringKeyValue { +func (m *IntDataPoint) GetLabels() []v11.StringKeyValue { if m != nil { return m.Labels } @@ -923,7 +923,7 @@ func (m *IntDataPoint) GetExemplars() []*IntExemplar { // time-varying value of a double metric. type DoubleDataPoint struct { // The set of labels that uniquely identify this timeseries. - Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + Labels []v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` // start_time_unix_nano is the last time when the aggregation value was reset // to "zero". For some metric types this is ignored, see data types for more // details. @@ -982,7 +982,7 @@ func (m *DoubleDataPoint) XXX_DiscardUnknown() { var xxx_messageInfo_DoubleDataPoint proto.InternalMessageInfo -func (m *DoubleDataPoint) GetLabels() []*v11.StringKeyValue { +func (m *DoubleDataPoint) GetLabels() []v11.StringKeyValue { if m != nil { return m.Labels } @@ -1023,7 +1023,7 @@ func (m *DoubleDataPoint) GetExemplars() []*DoubleExemplar { // the distribution of those values across a set of buckets. type IntHistogramDataPoint struct { // The set of labels that uniquely identify this timeseries. - Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + Labels []v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` // start_time_unix_nano is the last time when the aggregation value was reset // to "zero". For some metric types this is ignored, see data types for more // details. @@ -1111,7 +1111,7 @@ func (m *IntHistogramDataPoint) XXX_DiscardUnknown() { var xxx_messageInfo_IntHistogramDataPoint proto.InternalMessageInfo -func (m *IntHistogramDataPoint) GetLabels() []*v11.StringKeyValue { +func (m *IntHistogramDataPoint) GetLabels() []v11.StringKeyValue { if m != nil { return m.Labels } @@ -1173,7 +1173,7 @@ func (m *IntHistogramDataPoint) GetExemplars() []*IntExemplar { // distribution of those values across a set of buckets. type DoubleHistogramDataPoint struct { // The set of labels that uniquely identify this timeseries. - Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + Labels []v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` // start_time_unix_nano is the last time when the aggregation value was reset // to "zero". For some metric types this is ignored, see data types for more // details. @@ -1261,7 +1261,7 @@ func (m *DoubleHistogramDataPoint) XXX_DiscardUnknown() { var xxx_messageInfo_DoubleHistogramDataPoint proto.InternalMessageInfo -func (m *DoubleHistogramDataPoint) GetLabels() []*v11.StringKeyValue { +func (m *DoubleHistogramDataPoint) GetLabels() []v11.StringKeyValue { if m != nil { return m.Labels } @@ -1325,7 +1325,7 @@ type IntExemplar struct { // The set of labels that were filtered out by the aggregator, but recorded // alongside the original measurement. Only labels that were filtered out // by the aggregator should be included - FilteredLabels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=filtered_labels,json=filteredLabels,proto3" json:"filtered_labels,omitempty"` + FilteredLabels []v11.StringKeyValue `protobuf:"bytes,1,rep,name=filtered_labels,json=filteredLabels,proto3" json:"filtered_labels"` // time_unix_nano is the exact time when this exemplar was recorded // // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January @@ -1376,7 +1376,7 @@ func (m *IntExemplar) XXX_DiscardUnknown() { var xxx_messageInfo_IntExemplar proto.InternalMessageInfo -func (m *IntExemplar) GetFilteredLabels() []*v11.StringKeyValue { +func (m *IntExemplar) GetFilteredLabels() []v11.StringKeyValue { if m != nil { return m.FilteredLabels } @@ -1405,7 +1405,7 @@ type DoubleExemplar struct { // The set of labels that were filtered out by the aggregator, but recorded // alongside the original measurement. Only labels that were filtered out // by the aggregator should be included - FilteredLabels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=filtered_labels,json=filteredLabels,proto3" json:"filtered_labels,omitempty"` + FilteredLabels []v11.StringKeyValue `protobuf:"bytes,1,rep,name=filtered_labels,json=filteredLabels,proto3" json:"filtered_labels"` // time_unix_nano is the exact time when this exemplar was recorded // // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January @@ -1456,7 +1456,7 @@ func (m *DoubleExemplar) XXX_DiscardUnknown() { var xxx_messageInfo_DoubleExemplar proto.InternalMessageInfo -func (m *DoubleExemplar) GetFilteredLabels() []*v11.StringKeyValue { +func (m *DoubleExemplar) GetFilteredLabels() []v11.StringKeyValue { if m != nil { return m.FilteredLabels } @@ -1501,79 +1501,79 @@ func init() { } var fileDescriptor_3c3112f9fa006917 = []byte{ - // 1147 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0x8f, 0x93, 0x36, 0x7f, 0x5e, 0xb2, 0x6d, 0x18, 0x95, 0xae, 0xb5, 0x52, 0xd3, 0x36, 0x8b, - 0xba, 0x65, 0x77, 0x9b, 0xa8, 0x45, 0x8b, 0xb8, 0x20, 0x91, 0x36, 0xa1, 0x0d, 0xa4, 0xdd, 0xc8, - 0x4d, 0x2b, 0x15, 0x2d, 0xb2, 0x9c, 0x78, 0x08, 0x23, 0xec, 0x99, 0xc8, 0x1e, 0x57, 0xed, 0x07, - 0xe0, 0x06, 0x12, 0x02, 0x71, 0xe2, 0x83, 0xf0, 0x15, 0xf6, 0xb8, 0x9c, 0x40, 0x48, 0xac, 0x56, - 0xed, 0x91, 0x13, 0x17, 0x4e, 0x1c, 0xd0, 0x8c, 0xed, 0x26, 0x69, 0xdd, 0x26, 0xab, 0x16, 0xa9, - 0x2b, 0x6e, 0x6f, 0xde, 0xbc, 0xf7, 0x7b, 0xbf, 0xf7, 0x7b, 0x33, 0x76, 0x62, 0x78, 0xcc, 0x7a, - 0x98, 0x72, 0x6c, 0x61, 0x1b, 0x73, 0xe7, 0xb8, 0xdc, 0x73, 0x18, 0x67, 0x65, 0x61, 0x93, 0x8e, - 0x5b, 0x3e, 0x5c, 0x0d, 0xcd, 0x92, 0xdc, 0x40, 0x85, 0xa1, 0x68, 0xdf, 0x59, 0x0a, 0x43, 0x0e, - 0x57, 0xef, 0xcd, 0x74, 0x59, 0x97, 0xf9, 0x18, 0xc2, 0xf2, 0x03, 0xee, 0x3d, 0x8c, 0xaa, 0xd1, - 0x61, 0xb6, 0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 0x83, 0x51, 0x33, 0x30, 0x79, 0x28, 0xea, 0xc8, 0xf7, - 0x5c, 0x5e, 0xf3, 0x17, 0xa8, 0x0e, 0x19, 0x7c, 0x84, 0xed, 0x9e, 0x65, 0x38, 0xae, 0x3a, 0x29, - 0x69, 0x3f, 0x1a, 0xe3, 0xac, 0xd5, 0x82, 0x1c, 0xad, 0x9f, 0x5d, 0xfc, 0x21, 0x1e, 0xce, 0xfb, - 0x8d, 0x94, 0x44, 0x09, 0x25, 0x69, 0x5c, 0x94, 0xa4, 0x34, 0xde, 0x09, 0x8d, 0x52, 0xe5, 0xef, - 0x38, 0xbc, 0x1d, 0x79, 0x39, 0x6f, 0xbf, 0x36, 0x1d, 0xe6, 0x51, 0x2e, 0xb5, 0x49, 0x6a, 0xfe, - 0x02, 0xe5, 0x21, 0x21, 0x7e, 0x4b, 0x4c, 0xca, 0x23, 0x24, 0x4c, 0x74, 0x1f, 0xee, 0xb4, 0xbd, - 0xce, 0x57, 0x98, 0xeb, 0x32, 0xc2, 0x55, 0x93, 0x0b, 0x09, 0x01, 0xe6, 0x3b, 0x37, 0xa4, 0x0f, - 0x3d, 0x80, 0x69, 0x7c, 0xd4, 0xb3, 0x48, 0x87, 0x70, 0xbd, 0xcd, 0x3c, 0x6a, 0xba, 0x6a, 0x6a, - 0x21, 0xb1, 0xac, 0x68, 0x53, 0xa1, 0x7b, 0x5d, 0x7a, 0x87, 0x8f, 0x63, 0xfa, 0x5a, 0xc7, 0xf1, - 0x9f, 0x38, 0xa8, 0x97, 0x3d, 0x38, 0xde, 0x74, 0xed, 0x95, 0xff, 0x42, 0xfb, 0xc6, 0x45, 0xed, - 0xaf, 0x71, 0xee, 0xbf, 0x4f, 0x40, 0x76, 0x60, 0x32, 0x68, 0x1f, 0xa6, 0xbf, 0x20, 0x16, 0xc7, - 0x0e, 0x36, 0xf5, 0xeb, 0x48, 0x3f, 0x15, 0xa2, 0x34, 0xfc, 0x11, 0x5c, 0x54, 0x34, 0x7e, 0x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a5, 0x55, 0xdf, 0xaf, 0xe5, 0xe3, 0xeb, 0x3f, 0x29, 0xcf, 0x4f, 0x0a, 0xca, 0x8b, - 0x93, 0x82, 0xf2, 0xea, 0xa4, 0xa0, 0x7c, 0x77, 0x5a, 0x88, 0xbd, 0x38, 0x2d, 0xc4, 0x7e, 0x3b, - 0x2d, 0xc4, 0x60, 0x91, 0xb0, 0x11, 0xcf, 0x84, 0xf5, 0x5c, 0xf0, 0x91, 0xa1, 0x29, 0x36, 0x9a, - 0xca, 0x67, 0x3b, 0x37, 0x21, 0x5e, 0xff, 0x03, 0x53, 0x3b, 0x29, 0xbd, 0xef, 0xfd, 0x1b, 0x00, - 0x00, 0xff, 0xff, 0x76, 0x92, 0x21, 0xf5, 0x89, 0x12, 0x00, 0x00, + // 1150 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xda, 0x89, 0xff, 0x3c, 0xbb, 0x89, 0x19, 0x95, 0x76, 0x55, 0xa9, 0x6e, 0xe2, 0xa2, + 0x34, 0xb4, 0x8d, 0xad, 0x04, 0x15, 0x71, 0x41, 0xc2, 0x8e, 0x4d, 0x62, 0xea, 0xa4, 0xd6, 0xc6, + 0x89, 0x14, 0x14, 0xb4, 0x5a, 0x7b, 0x07, 0x33, 0x62, 0x77, 0xc6, 0xda, 0x9d, 0x8d, 0x92, 0x2b, + 0x12, 0x37, 0x0e, 0x48, 0x5c, 0x40, 0xfd, 0x20, 0x7c, 0x85, 0x1e, 0xcb, 0x09, 0x84, 0x44, 0x55, + 0x25, 0x47, 0x4e, 0xdc, 0x39, 0xa0, 0x99, 0xdd, 0x8d, 0xed, 0x64, 0x13, 0xbb, 0x4a, 0x90, 0x52, + 0xb8, 0xbd, 0x79, 0xf3, 0xde, 0xef, 0xfd, 0xde, 0xbf, 0x5d, 0x7b, 0xe1, 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00, 0xf7, 0x2b, 0x6b, 0x6b, + 0x5a, 0x7d, 0xad, 0xd2, 0x6e, 0x3c, 0xdb, 0xd4, 0xdb, 0xf5, 0x8d, 0xd6, 0x33, 0xad, 0xd2, 0x6c, + 0xb4, 0x77, 0xf5, 0xed, 0xcd, 0xad, 0x56, 0x7d, 0xb5, 0xf1, 0x69, 0xa3, 0x5e, 0xcb, 0xc7, 0xd0, + 0x3c, 0xdc, 0x3d, 0xcf, 0xb0, 0x56, 0x6f, 0xb6, 0x2b, 0x79, 0x05, 0x2d, 0x40, 0xf1, 0x3c, 0x93, + 0xd5, 0xed, 0x8d, 0xed, 0x66, 0xa5, 0xdd, 0xd8, 0xa9, 0xe7, 0xe3, 0xd5, 0xe7, 0xca, 0x8b, 0xa3, + 0x82, 0xf2, 0xf2, 0xa8, 0xa0, 0xbc, 0x3e, 0x2a, 0x28, 0xdf, 0x1f, 0x17, 0x62, 0x2f, 0x8f, 0x0b, + 0xb1, 0xdf, 0x8e, 0x0b, 0x31, 0x98, 0x27, 0x6c, 0xcc, 0xf3, 0xa1, 0x9a, 0x0b, 0x3e, 0x44, 0xb4, + 0xc4, 0x45, 0x4b, 0xf9, 0x7c, 0xf3, 0x2a, 0x8a, 0x37, 0xf8, 0x08, 0xd5, 0x49, 0x4a, 0xed, 0x07, + 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x28, 0xf0, 0x9b, 0xaa, 0xad, 0x12, 0x00, 0x00, } func (m *ResourceMetrics) Marshal() (dAtA []byte, err error) { @@ -4327,7 +4327,7 @@ func (m *IntDataPoint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, &v11.StringKeyValue{}) + m.Labels = append(m.Labels, v11.StringKeyValue{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4478,7 +4478,7 @@ func (m *DoubleDataPoint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, &v11.StringKeyValue{}) + m.Labels = append(m.Labels, v11.StringKeyValue{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4630,7 +4630,7 @@ func (m *IntHistogramDataPoint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, &v11.StringKeyValue{}) + m.Labels = append(m.Labels, v11.StringKeyValue{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4897,7 +4897,7 @@ func (m *DoubleHistogramDataPoint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, &v11.StringKeyValue{}) + m.Labels = append(m.Labels, v11.StringKeyValue{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -5165,7 +5165,7 @@ func (m *IntExemplar) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FilteredLabels = append(m.FilteredLabels, &v11.StringKeyValue{}) + m.FilteredLabels = append(m.FilteredLabels, v11.StringKeyValue{}) if err := m.FilteredLabels[len(m.FilteredLabels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -5338,7 +5338,7 @@ func (m *DoubleExemplar) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FilteredLabels = append(m.FilteredLabels, &v11.StringKeyValue{}) + m.FilteredLabels = append(m.FilteredLabels, v11.StringKeyValue{}) if err := m.FilteredLabels[len(m.FilteredLabels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/internal/data/testdata/common.go b/internal/data/testdata/common.go index 8223bead9c5..91b2eb88c6a 100644 --- a/internal/data/testdata/common.go +++ b/internal/data/testdata/common.go @@ -109,8 +109,8 @@ func initMetricLabels1(dest pdata.StringMap) { dest.InitFromMap(map[string]string{TestLabelKey1: TestLabelValue1}) } -func generateOtlpMetricLabels1() []*otlpcommon.StringKeyValue { - return []*otlpcommon.StringKeyValue{ +func generateOtlpMetricLabels1() []otlpcommon.StringKeyValue { + return []otlpcommon.StringKeyValue{ { Key: TestLabelKey1, Value: TestLabelValue1, @@ -122,8 +122,8 @@ func initMetricLabels12(dest pdata.StringMap) { dest.InitFromMap(map[string]string{TestLabelKey1: TestLabelValue1, TestLabelKey2: TestLabelValue2}).Sort() } -func generateOtlpMetricLabels12() []*otlpcommon.StringKeyValue { - return []*otlpcommon.StringKeyValue{ +func generateOtlpMetricLabels12() []otlpcommon.StringKeyValue { + return []otlpcommon.StringKeyValue{ { Key: TestLabelKey1, Value: TestLabelValue1, @@ -139,8 +139,8 @@ func initMetricLabels13(dest pdata.StringMap) { dest.InitFromMap(map[string]string{TestLabelKey1: TestLabelValue1, TestLabelKey3: TestLabelValue3}).Sort() } -func generateOtlpMetricLabels13() []*otlpcommon.StringKeyValue { - return []*otlpcommon.StringKeyValue{ +func generateOtlpMetricLabels13() []otlpcommon.StringKeyValue { + return []otlpcommon.StringKeyValue{ { Key: TestLabelKey1, Value: TestLabelValue1, @@ -156,8 +156,8 @@ func initMetricLabels2(dest pdata.StringMap) { dest.InitFromMap(map[string]string{TestLabelKey2: TestLabelValue2}) } -func generateOtlpMetricLabels2() []*otlpcommon.StringKeyValue { - return []*otlpcommon.StringKeyValue{ +func generateOtlpMetricLabels2() []otlpcommon.StringKeyValue { + return []otlpcommon.StringKeyValue{ { Key: TestLabelKey2, Value: TestLabelValue2, @@ -169,8 +169,8 @@ func initMetricAttachment(dest pdata.StringMap) { dest.InitFromMap(map[string]string{TestAttachmentKey: TestAttachmentValue}) } -func generateOtlpMetricAttachment() []*otlpcommon.StringKeyValue { - return []*otlpcommon.StringKeyValue{ +func generateOtlpMetricAttachment() []otlpcommon.StringKeyValue { + return []otlpcommon.StringKeyValue{ { Key: TestAttachmentKey, Value: TestAttachmentValue, diff --git a/proto_patch.sed b/proto_patch.sed index 2ca49ba5d88..c89d52234f8 100644 --- a/proto_patch.sed +++ b/proto_patch.sed @@ -27,3 +27,8 @@ s+repeated KeyValue \(.*\);+repeated KeyValue \1\ [\ (gogoproto.nullable) = false\ ];+g + +s+repeated opentelemetry.proto.common.v1.StringKeyValue \(.*\);+repeated opentelemetry.proto.common.v1.StringKeyValue \1\ + [\ + (gogoproto.nullable) = false\ + ];+g diff --git a/receiver/otlpreceiver/metrics/otlp_test.go b/receiver/otlpreceiver/metrics/otlp_test.go index aa682fada17..4de14f2b472 100644 --- a/receiver/otlpreceiver/metrics/otlp_test.go +++ b/receiver/otlpreceiver/metrics/otlp_test.go @@ -68,7 +68,7 @@ func TestExport(t *testing.T) { AggregationTemporality: otlpmetrics.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, DataPoints: []*otlpmetrics.IntDataPoint{ { - Labels: []*otlpcommon.StringKeyValue{ + Labels: []otlpcommon.StringKeyValue{ { Key: "key1", Value: "value1", @@ -79,7 +79,7 @@ func TestExport(t *testing.T) { Value: 123, }, { - Labels: []*otlpcommon.StringKeyValue{ + Labels: []otlpcommon.StringKeyValue{ { Key: "key2", Value: "value2",