From 961d46d4a589758280655fce100bb591369ad2d1 Mon Sep 17 00:00:00 2001 From: Jared Tan Date: Wed, 28 Aug 2024 21:49:42 +0800 Subject: [PATCH 01/10] Extract the function as a common function. Signed-off-by: Jared Tan --- ...actoring_dimenssion_func_as_util_func.yaml | 0 pkg/pdatautil/attributes.go | 38 +++++++++++++++++++ pkg/pdatautil/attributes_test.go | 10 +++++ 3 files changed, 48 insertions(+) create mode 100644 .chloggen/refactoring_dimenssion_func_as_util_func.yaml create mode 100644 pkg/pdatautil/attributes.go create mode 100644 pkg/pdatautil/attributes_test.go diff --git a/.chloggen/refactoring_dimenssion_func_as_util_func.yaml b/.chloggen/refactoring_dimenssion_func_as_util_func.yaml new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pkg/pdatautil/attributes.go b/pkg/pdatautil/attributes.go new file mode 100644 index 000000000000..bda025d2864e --- /dev/null +++ b/pkg/pdatautil/attributes.go @@ -0,0 +1,38 @@ +package pdatautil + +import "go.opentelemetry.io/collector/pdata/pcommon" + +type Dimension struct { + Name string + Value *pcommon.Value +} + +// GetDimensionValue gets the Dimension Value for the given configured Dimension. +// It iterates over multiple attributes until a Value is found. +// The order comes first, the higher the priority. +// Finally, falls back to the configured default Value if provided. +// +// The ok flag indicates if a Dimension Value was fetched in order to differentiate +// an empty string Value from a state where no Value was found. +func GetDimensionValue(d Dimension, attributes ...pcommon.Map) (v pcommon.Value, ok bool) { + // The more specific span attribute should take precedence. + for _, attrs := range attributes { + if attr, exists := attrs.Get(d.Name); exists { + return attr, true + } + } + // Set the default if configured, otherwise this metric will have no Value set for the Dimension. + if d.Value != nil { + return *d.Value, true + } + return v, ok +} + +func GetAttributeValue(key string, attributes ...pcommon.Map) (string, bool) { + for _, attr := range attributes { + if v, ok := attr.Get(key); ok { + return v.AsString(), true + } + } + return "", false +} diff --git a/pkg/pdatautil/attributes_test.go b/pkg/pdatautil/attributes_test.go new file mode 100644 index 000000000000..1f6c1bbb7dd6 --- /dev/null +++ b/pkg/pdatautil/attributes_test.go @@ -0,0 +1,10 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pdatautil + +import "testing" + +func TestGetDimensionValue(t *testing.T) { + +} From 9559623f52d23634d6a4c19fa8c4b7f3ddd2734a Mon Sep 17 00:00:00 2001 From: Jared Tan Date: Wed, 28 Aug 2024 21:50:34 +0800 Subject: [PATCH 02/10] Extract the function as a common function. Signed-off-by: Jared Tan --- ...actoring_dimenssion_func_as_util_func.yaml | 27 ++++++++++ connector/exceptionsconnector/connector.go | 27 +++++----- .../exceptionsconnector/connector_logs.go | 19 +++---- .../exceptionsconnector/connector_metrics.go | 12 +++-- .../connector_metrics_test.go | 24 +++++---- connector/exceptionsconnector/factory_test.go | 8 +-- connector/servicegraphconnector/connector.go | 8 +-- connector/servicegraphconnector/util.go | 13 ++--- connector/spanmetricsconnector/connector.go | 49 ++++------------- .../spanmetricsconnector/connector_test.go | 24 +++++---- .../spanmetricsconnector/factory_test.go | 8 +-- pkg/pdatautil/attributes.go | 10 ++-- pkg/pdatautil/attributes_test.go | 54 ++++++++++++++++++- 13 files changed, 168 insertions(+), 115 deletions(-) diff --git a/.chloggen/refactoring_dimenssion_func_as_util_func.yaml b/.chloggen/refactoring_dimenssion_func_as_util_func.yaml index e69de29bb2d1..4fda833ffb8a 100644 --- a/.chloggen/refactoring_dimenssion_func_as_util_func.yaml +++ b/.chloggen/refactoring_dimenssion_func_as_util_func.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: exceptionsconnector,servicegraphconnector,spanmetricsconnector + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Extract the `getDimensionValue` function as a common function. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [34627] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] \ No newline at end of file diff --git a/connector/exceptionsconnector/connector.go b/connector/exceptionsconnector/connector.go index a815d7255f3b..21f91ba0e026 100644 --- a/connector/exceptionsconnector/connector.go +++ b/connector/exceptionsconnector/connector.go @@ -6,6 +6,8 @@ package exceptionsconnector // import "github.com/open-telemetry/opentelemetry-c import ( "go.opentelemetry.io/collector/pdata/pcommon" conventions "go.opentelemetry.io/collector/semconv/v1.18.0" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" ) const ( @@ -20,21 +22,16 @@ const ( eventNameExc = "exception" // OpenTelemetry non-standard constant. ) -type dimension struct { - name string - value *pcommon.Value -} - -func newDimensions(cfgDims []Dimension) []dimension { +func newDimensions(cfgDims []Dimension) []pdatautil.Dimension { if len(cfgDims) == 0 { return nil } - dims := make([]dimension, len(cfgDims)) + dims := make([]pdatautil.Dimension, len(cfgDims)) for i := range cfgDims { - dims[i].name = cfgDims[i].Name + dims[i].Name = cfgDims[i].Name if cfgDims[i].Default != nil { val := pcommon.NewValueStr(*cfgDims[i].Default) - dims[i].value = &val + dims[i].Value = &val } } return dims @@ -47,21 +44,21 @@ func newDimensions(cfgDims []Dimension) []dimension { // // The ok flag indicates if a dimension value was fetched in order to differentiate // an empty string value from a state where no value was found. -func getDimensionValue(d dimension, spanAttrs pcommon.Map, eventAttrs pcommon.Map, resourceAttr pcommon.Map) (v pcommon.Value, ok bool) { +func getDimensionValue(d pdatautil.Dimension, spanAttrs pcommon.Map, eventAttrs pcommon.Map, resourceAttr pcommon.Map) (v pcommon.Value, ok bool) { // The more specific span attribute should take precedence. - if attr, exists := spanAttrs.Get(d.name); exists { + if attr, exists := spanAttrs.Get(d.Name); exists { return attr, true } - if attr, exists := eventAttrs.Get(d.name); exists { + if attr, exists := eventAttrs.Get(d.Name); exists { return attr, true } // falling back to searching in resource attributes - if attr, exists := resourceAttr.Get(d.name); exists { + if attr, exists := resourceAttr.Get(d.Name); exists { return attr, true } // Set the default if configured, otherwise this metric will have no value set for the dimension. - if d.value != nil { - return *d.value, true + if d.Value != nil { + return *d.Value, true } return v, ok } diff --git a/connector/exceptionsconnector/connector_logs.go b/connector/exceptionsconnector/connector_logs.go index 5fa2e6b2c8f5..eb7e30feadc4 100644 --- a/connector/exceptionsconnector/connector_logs.go +++ b/connector/exceptionsconnector/connector_logs.go @@ -6,6 +6,8 @@ package exceptionsconnector // import "github.com/open-telemetry/opentelemetry-c import ( "context" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/pcommon" @@ -21,7 +23,7 @@ type logsConnector struct { config Config // Additional dimensions to add to logs. - dimensions []dimension + dimensions []pdatautil.Dimension logsConsumer consumer.Logs component.StartFunc @@ -113,20 +115,13 @@ func (c *logsConnector) attrToLogRecord(sl plog.ScopeLogs, serviceName string, s // Add configured dimension attributes to the log record. for _, d := range c.dimensions { - if v, ok := getDimensionValue(d, spanAttrs, eventAttrs, resourceAttrs); ok { - logRecord.Attributes().PutStr(d.name, v.Str()) + if v, ok := pdatautil.GetDimensionValue(d, spanAttrs, eventAttrs, resourceAttrs); ok { + logRecord.Attributes().PutStr(d.Name, v.Str()) } } // Add stacktrace to the log record. - logRecord.Attributes().PutStr(exceptionStacktraceKey, getValue(eventAttrs, exceptionStacktraceKey)) + attrVal, _ := pdatautil.GetAttributeValue(exceptionStacktraceKey, eventAttrs) + logRecord.Attributes().PutStr(exceptionStacktraceKey, attrVal) return logRecord } - -// getValue returns the value of the attribute with the given key. -func getValue(attr pcommon.Map, key string) string { - if attrVal, ok := attr.Get(key); ok { - return attrVal.Str() - } - return "" -} diff --git a/connector/exceptionsconnector/connector_metrics.go b/connector/exceptionsconnector/connector_metrics.go index bf0f4a60c30b..945659ca3b05 100644 --- a/connector/exceptionsconnector/connector_metrics.go +++ b/connector/exceptionsconnector/connector_metrics.go @@ -9,6 +9,8 @@ import ( "sync" "time" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/pcommon" @@ -29,7 +31,7 @@ type metricsConnector struct { config Config // Additional dimensions to add to metrics. - dimensions []dimension + dimensions []pdatautil.Dimension keyBuf *bytes.Buffer @@ -175,7 +177,7 @@ func (c *metricsConnector) addExemplar(exc *exception, traceID pcommon.TraceID, e.SetDoubleValue(float64(exc.count)) } -func buildDimensionKVs(dimensions []dimension, serviceName string, span ptrace.Span, eventAttrs pcommon.Map, resourceAttrs pcommon.Map) pcommon.Map { +func buildDimensionKVs(dimensions []pdatautil.Dimension, serviceName string, span ptrace.Span, eventAttrs pcommon.Map, resourceAttrs pcommon.Map) pcommon.Map { dims := pcommon.NewMap() dims.EnsureCapacity(3 + len(dimensions)) dims.PutStr(serviceNameKey, serviceName) @@ -183,8 +185,8 @@ func buildDimensionKVs(dimensions []dimension, serviceName string, span ptrace.S dims.PutStr(spanKindKey, traceutil.SpanKindStr(span.Kind())) dims.PutStr(statusCodeKey, traceutil.StatusCodeStr(span.Status().Code())) for _, d := range dimensions { - if v, ok := getDimensionValue(d, span.Attributes(), eventAttrs, resourceAttrs); ok { - v.CopyTo(dims.PutEmpty(d.name)) + if v, ok := pdatautil.GetDimensionValue(d, span.Attributes(), eventAttrs, resourceAttrs); ok { + v.CopyTo(dims.PutEmpty(d.Name)) } } return dims @@ -195,7 +197,7 @@ func buildDimensionKVs(dimensions []dimension, serviceName string, span ptrace.S // or resource attributes. If the dimension exists in both, the span's attributes, being the most specific, takes precedence. // // The metric key is a simple concatenation of dimension values, delimited by a null character. -func buildKey(dest *bytes.Buffer, serviceName string, span ptrace.Span, optionalDims []dimension, eventAttrs pcommon.Map, resourceAttrs pcommon.Map) { +func buildKey(dest *bytes.Buffer, serviceName string, span ptrace.Span, optionalDims []pdatautil.Dimension, eventAttrs pcommon.Map, resourceAttrs pcommon.Map) { concatDimensionValue(dest, serviceName, false) concatDimensionValue(dest, span.Name(), true) concatDimensionValue(dest, traceutil.SpanKindStr(span.Kind()), true) diff --git a/connector/exceptionsconnector/connector_metrics_test.go b/connector/exceptionsconnector/connector_metrics_test.go index ff2a244f4c11..6f4b912ff07b 100644 --- a/connector/exceptionsconnector/connector_metrics_test.go +++ b/connector/exceptionsconnector/connector_metrics_test.go @@ -9,6 +9,8 @@ import ( "testing" "time" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component/componenttest" @@ -277,7 +279,7 @@ func TestBuildKeyWithDimensions(t *testing.T) { defaultFoo := pcommon.NewValueStr("bar") for _, tc := range []struct { name string - optionalDims []dimension + optionalDims []pdatautil.Dimension resourceAttrMap map[string]any spanAttrMap map[string]any wantKey string @@ -288,22 +290,22 @@ func TestBuildKeyWithDimensions(t *testing.T) { }, { name: "neither span nor resource contains key, dim provides default", - optionalDims: []dimension{ - {name: "foo", value: &defaultFoo}, + optionalDims: []pdatautil.Dimension{ + {Name: "foo", Value: &defaultFoo}, }, wantKey: "ab\u0000c\u0000SPAN_KIND_UNSPECIFIED\u0000STATUS_CODE_UNSET\u0000bar", }, { name: "neither span nor resource contains key, dim provides no default", - optionalDims: []dimension{ - {name: "foo"}, + optionalDims: []pdatautil.Dimension{ + {Name: "foo"}, }, wantKey: "ab\u0000c\u0000SPAN_KIND_UNSPECIFIED\u0000STATUS_CODE_UNSET", }, { name: "span attribute contains dimension", - optionalDims: []dimension{ - {name: "foo"}, + optionalDims: []pdatautil.Dimension{ + {Name: "foo"}, }, spanAttrMap: map[string]any{ "foo": 99, @@ -312,8 +314,8 @@ func TestBuildKeyWithDimensions(t *testing.T) { }, { name: "resource attribute contains dimension", - optionalDims: []dimension{ - {name: "foo"}, + optionalDims: []pdatautil.Dimension{ + {Name: "foo"}, }, resourceAttrMap: map[string]any{ "foo": 99, @@ -322,8 +324,8 @@ func TestBuildKeyWithDimensions(t *testing.T) { }, { name: "both span and resource attribute contains dimension, should prefer span attribute", - optionalDims: []dimension{ - {name: "foo"}, + optionalDims: []pdatautil.Dimension{ + {Name: "foo"}, }, spanAttrMap: map[string]any{ "foo": 100, diff --git a/connector/exceptionsconnector/factory_test.go b/connector/exceptionsconnector/factory_test.go index f485f9c19b69..29258881745a 100644 --- a/connector/exceptionsconnector/factory_test.go +++ b/connector/exceptionsconnector/factory_test.go @@ -7,6 +7,8 @@ import ( "context" "testing" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer/consumertest" @@ -19,7 +21,7 @@ func TestNewConnector(t *testing.T) { for _, tc := range []struct { name string dimensions []Dimension - wantDimensions []dimension + wantDimensions []pdatautil.Dimension }{ { name: "simplest config (use defaults)", @@ -30,8 +32,8 @@ func TestNewConnector(t *testing.T) { {Name: "http.method", Default: &defaultMethod}, {Name: "http.status_code"}, }, - wantDimensions: []dimension{ - {name: "http.method", value: &defaultMethodValue}, + wantDimensions: []pdatautil.Dimension{ + {Name: "http.method", Value: &defaultMethodValue}, {"http.status_code", nil}, }, }, diff --git a/connector/servicegraphconnector/connector.go b/connector/servicegraphconnector/connector.go index e59d14c21ed1..d16e7f95e188 100644 --- a/connector/servicegraphconnector/connector.go +++ b/connector/servicegraphconnector/connector.go @@ -13,6 +13,8 @@ import ( "sync" "time" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/pcommon" @@ -262,7 +264,7 @@ func (p *serviceGraphConnector) aggregateMetrics(ctx context.Context, td ptrace. // A database request will only have one span, we don't wait for the server // span but just copy details from the client span - if dbName, ok := findAttributeValue(p.config.DatabaseNameAttribute, rAttributes, span.Attributes()); ok { + if dbName, ok := pdatautil.GetAttributeValue(p.config.DatabaseNameAttribute, rAttributes, span.Attributes()); ok { e.ConnectionType = store.Database e.ServerService = dbName e.ServerLatencySec = spanDuration(span) @@ -310,7 +312,7 @@ func (p *serviceGraphConnector) aggregateMetrics(ctx context.Context, td ptrace. func (p *serviceGraphConnector) upsertDimensions(kind string, m map[string]string, resourceAttr pcommon.Map, spanAttr pcommon.Map) { for _, dim := range p.config.Dimensions { - if v, ok := findAttributeValue(dim, resourceAttr, spanAttr); ok { + if v, ok := pdatautil.GetAttributeValue(dim, resourceAttr, spanAttr); ok { m[kind+"_"+dim] = v } } @@ -318,7 +320,7 @@ func (p *serviceGraphConnector) upsertDimensions(kind string, m map[string]strin func (p *serviceGraphConnector) upsertPeerAttributes(m []string, peers map[string]string, spanAttr pcommon.Map) { for _, s := range m { - if v, ok := findAttributeValue(s, spanAttr); ok { + if v, ok := pdatautil.GetAttributeValue(s, spanAttr); ok { peers[s] = v break } diff --git a/connector/servicegraphconnector/util.go b/connector/servicegraphconnector/util.go index fc447e9546de..68e8f86f3c95 100644 --- a/connector/servicegraphconnector/util.go +++ b/connector/servicegraphconnector/util.go @@ -6,17 +6,10 @@ package servicegraphconnector // import "github.com/open-telemetry/opentelemetry import ( "go.opentelemetry.io/collector/pdata/pcommon" semconv "go.opentelemetry.io/collector/semconv/v1.9.0" -) -func findAttributeValue(key string, attributes ...pcommon.Map) (string, bool) { - for _, attr := range attributes { - if v, ok := attr.Get(key); ok { - return v.AsString(), true - } - } - return "", false -} + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" +) func findServiceName(attributes pcommon.Map) (string, bool) { - return findAttributeValue(semconv.AttributeServiceName, attributes) + return pdatautil.GetAttributeValue(semconv.AttributeServiceName, attributes) } diff --git a/connector/spanmetricsconnector/connector.go b/connector/spanmetricsconnector/connector.go index 2cdc354df9d8..789584132c96 100644 --- a/connector/spanmetricsconnector/connector.go +++ b/connector/spanmetricsconnector/connector.go @@ -51,7 +51,7 @@ type connectorImp struct { metricsConsumer consumer.Metrics // Additional dimensions to add to metrics. - dimensions []dimension + dimensions []pdatautil.Dimension resourceMetrics *cache.Cache[resourceKey, *resourceMetrics] @@ -71,7 +71,7 @@ type connectorImp struct { shutdownOnce sync.Once // Event dimensions to add to the events metric. - eDimensions []dimension + eDimensions []pdatautil.Dimension events EventsConfig @@ -90,21 +90,16 @@ type resourceMetrics struct { lastSeen time.Time } -type dimension struct { - name string - value *pcommon.Value -} - -func newDimensions(cfgDims []Dimension) []dimension { +func newDimensions(cfgDims []Dimension) []pdatautil.Dimension { if len(cfgDims) == 0 { return nil } - dims := make([]dimension, len(cfgDims)) + dims := make([]pdatautil.Dimension, len(cfgDims)) for i := range cfgDims { - dims[i].name = cfgDims[i].Name + dims[i].Name = cfgDims[i].Name if cfgDims[i].Default != nil { val := pcommon.NewValueStr(*cfgDims[i].Default) - dims[i].value = &val + dims[i].Value = &val } } return dims @@ -505,7 +500,7 @@ func contains(elements []string, value string) bool { return false } -func (p *connectorImp) buildAttributes(serviceName string, span ptrace.Span, resourceAttrs pcommon.Map, dimensions []dimension) pcommon.Map { +func (p *connectorImp) buildAttributes(serviceName string, span ptrace.Span, resourceAttrs pcommon.Map, dimensions []pdatautil.Dimension) pcommon.Map { attr := pcommon.NewMap() attr.EnsureCapacity(4 + len(dimensions)) if !contains(p.config.ExcludeDimensions, serviceNameKey) { @@ -521,8 +516,8 @@ func (p *connectorImp) buildAttributes(serviceName string, span ptrace.Span, res attr.PutStr(statusCodeKey, traceutil.StatusCodeStr(span.Status().Code())) } for _, d := range dimensions { - if v, ok := getDimensionValue(d, span.Attributes(), resourceAttrs); ok { - v.CopyTo(attr.PutEmpty(d.name)) + if v, ok := pdatautil.GetDimensionValue(d, span.Attributes(), resourceAttrs); ok { + v.CopyTo(attr.PutEmpty(d.Name)) } } return attr @@ -540,7 +535,7 @@ func concatDimensionValue(dest *bytes.Buffer, value string, prefixSep bool) { // or resource/event attributes. If the dimension exists in both, the span's attributes, being the most specific, takes precedence. // // The metric key is a simple concatenation of dimension values, delimited by a null character. -func (p *connectorImp) buildKey(serviceName string, span ptrace.Span, optionalDims []dimension, resourceOrEventAttrs pcommon.Map) metrics.Key { +func (p *connectorImp) buildKey(serviceName string, span ptrace.Span, optionalDims []pdatautil.Dimension, resourceOrEventAttrs pcommon.Map) metrics.Key { p.keyBuf.Reset() if !contains(p.config.ExcludeDimensions, serviceNameKey) { concatDimensionValue(p.keyBuf, serviceName, false) @@ -556,7 +551,7 @@ func (p *connectorImp) buildKey(serviceName string, span ptrace.Span, optionalDi } for _, d := range optionalDims { - if v, ok := getDimensionValue(d, span.Attributes(), resourceOrEventAttrs); ok { + if v, ok := pdatautil.GetDimensionValue(d, span.Attributes(), resourceOrEventAttrs); ok { concatDimensionValue(p.keyBuf, v.AsString(), true) } } @@ -564,28 +559,6 @@ func (p *connectorImp) buildKey(serviceName string, span ptrace.Span, optionalDi return metrics.Key(p.keyBuf.String()) } -// getDimensionValue gets the dimension value for the given configured dimension. -// It searches through the span's attributes first, being the more specific; -// falling back to searching in resource attributes if it can't be found in the span. -// Finally, falls back to the configured default value if provided. -// -// The ok flag indicates if a dimension value was fetched in order to differentiate -// an empty string value from a state where no value was found. -func getDimensionValue(d dimension, spanAttr pcommon.Map, resourceAttr pcommon.Map) (v pcommon.Value, ok bool) { - // The more specific span attribute should take precedence. - if attr, exists := spanAttr.Get(d.name); exists { - return attr, true - } - if attr, exists := resourceAttr.Get(d.name); exists { - return attr, true - } - // Set the default if configured, otherwise this metric will have no value set for the dimension. - if d.value != nil { - return *d.value, true - } - return v, ok -} - // buildMetricName builds the namespace prefix for the metric name. func buildMetricName(namespace string, name string) string { if namespace != "" { diff --git a/connector/spanmetricsconnector/connector_test.go b/connector/spanmetricsconnector/connector_test.go index a58de25fbbc3..d6a34d221561 100644 --- a/connector/spanmetricsconnector/connector_test.go +++ b/connector/spanmetricsconnector/connector_test.go @@ -10,6 +10,8 @@ import ( "testing" "time" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/jonboulle/clockwork" "github.com/lightstep/go-expohisto/structure" "github.com/stretchr/testify/assert" @@ -549,7 +551,7 @@ func TestBuildKeyWithDimensions(t *testing.T) { defaultFoo := pcommon.NewValueStr("bar") for _, tc := range []struct { name string - optionalDims []dimension + optionalDims []pdatautil.Dimension resourceAttrMap map[string]any spanAttrMap map[string]any wantKey string @@ -560,22 +562,22 @@ func TestBuildKeyWithDimensions(t *testing.T) { }, { name: "neither span nor resource contains key, dim provides default", - optionalDims: []dimension{ - {name: "foo", value: &defaultFoo}, + optionalDims: []pdatautil.Dimension{ + {Name: "foo", Value: &defaultFoo}, }, wantKey: "ab\u0000c\u0000SPAN_KIND_UNSPECIFIED\u0000STATUS_CODE_UNSET\u0000bar", }, { name: "neither span nor resource contains key, dim provides no default", - optionalDims: []dimension{ - {name: "foo"}, + optionalDims: []pdatautil.Dimension{ + {Name: "foo"}, }, wantKey: "ab\u0000c\u0000SPAN_KIND_UNSPECIFIED\u0000STATUS_CODE_UNSET", }, { name: "span attribute contains dimension", - optionalDims: []dimension{ - {name: "foo"}, + optionalDims: []pdatautil.Dimension{ + {Name: "foo"}, }, spanAttrMap: map[string]any{ "foo": 99, @@ -584,8 +586,8 @@ func TestBuildKeyWithDimensions(t *testing.T) { }, { name: "resource attribute contains dimension", - optionalDims: []dimension{ - {name: "foo"}, + optionalDims: []pdatautil.Dimension{ + {Name: "foo"}, }, resourceAttrMap: map[string]any{ "foo": 99, @@ -594,8 +596,8 @@ func TestBuildKeyWithDimensions(t *testing.T) { }, { name: "both span and resource attribute contains dimension, should prefer span attribute", - optionalDims: []dimension{ - {name: "foo"}, + optionalDims: []pdatautil.Dimension{ + {Name: "foo"}, }, spanAttrMap: map[string]any{ "foo": 100, diff --git a/connector/spanmetricsconnector/factory_test.go b/connector/spanmetricsconnector/factory_test.go index b57799760cbf..b89f3a965cb6 100644 --- a/connector/spanmetricsconnector/factory_test.go +++ b/connector/spanmetricsconnector/factory_test.go @@ -8,6 +8,8 @@ import ( "testing" "time" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer/consumertest" @@ -22,7 +24,7 @@ func TestNewConnector(t *testing.T) { durationHistogramBuckets []time.Duration dimensions []Dimension wantDurationHistogramBuckets []float64 - wantDimensions []dimension + wantDimensions []pdatautil.Dimension }{ { name: "simplest config (use defaults)", @@ -34,8 +36,8 @@ func TestNewConnector(t *testing.T) { {Name: "http.method", Default: &defaultMethod}, {Name: "http.status_code"}, }, - wantDimensions: []dimension{ - {name: "http.method", value: &defaultMethodValue}, + wantDimensions: []pdatautil.Dimension{ + {Name: "http.method", Value: &defaultMethodValue}, {"http.status_code", nil}, }, }, diff --git a/pkg/pdatautil/attributes.go b/pkg/pdatautil/attributes.go index bda025d2864e..529d8917176f 100644 --- a/pkg/pdatautil/attributes.go +++ b/pkg/pdatautil/attributes.go @@ -1,3 +1,6 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + package pdatautil import "go.opentelemetry.io/collector/pdata/pcommon" @@ -8,12 +11,12 @@ type Dimension struct { } // GetDimensionValue gets the Dimension Value for the given configured Dimension. -// It iterates over multiple attributes until a Value is found. +// It iterates over multiple attributes until a value is found. // The order comes first, the higher the priority. -// Finally, falls back to the configured default Value if provided. +// Finally, falls back to the configured default value if provided. // // The ok flag indicates if a Dimension Value was fetched in order to differentiate -// an empty string Value from a state where no Value was found. +// an empty string value from a state where no value was found. func GetDimensionValue(d Dimension, attributes ...pcommon.Map) (v pcommon.Value, ok bool) { // The more specific span attribute should take precedence. for _, attrs := range attributes { @@ -28,6 +31,7 @@ func GetDimensionValue(d Dimension, attributes ...pcommon.Map) (v pcommon.Value, return v, ok } +// GetAttributeValue look up value from the given attributes for the specified key, and if not found, return empty string. func GetAttributeValue(key string, attributes ...pcommon.Map) (string, bool) { for _, attr := range attributes { if v, ok := attr.Get(key); ok { diff --git a/pkg/pdatautil/attributes_test.go b/pkg/pdatautil/attributes_test.go index 1f6c1bbb7dd6..6a8d19c7a0b5 100644 --- a/pkg/pdatautil/attributes_test.go +++ b/pkg/pdatautil/attributes_test.go @@ -3,8 +3,60 @@ package pdatautil -import "testing" +import ( + "github.com/stretchr/testify/assert" + "go.opentelemetry.io/collector/pdata/pcommon" + "testing" +) func TestGetDimensionValue(t *testing.T) { + resource_attris := pcommon.NewMap() + resource_attris.PutStr("service.name", "mock-service-name") + span_attris := pcommon.NewMap() + span_attris.PutStr("span.name", "mock-span-name") + + other_attris := pcommon.NewMap() + other_attris.PutStr("a", "b") + other_attris.PutStr("foo", "bar") + + defaultFoo := pcommon.NewValueStr("bar") + + tests := []struct { + name string + dimension Dimension + attributes []pcommon.Map + wantDimensionVal string + }{ + { + name: "success get dimension value", + dimension: Dimension{Name: "foo"}, + attributes: []pcommon.Map{resource_attris, span_attris, other_attris}, + wantDimensionVal: "bar", + }, + { + name: "not found and get default dimension provided value", + dimension: Dimension{ + Name: "foo", + Value: &defaultFoo, + }, + attributes: []pcommon.Map{resource_attris, span_attris}, + wantDimensionVal: "bar", + }, + { + name: "not found and get default get empty value", + dimension: Dimension{ + Name: "foo", + }, + attributes: []pcommon.Map{resource_attris, span_attris}, + wantDimensionVal: "", + }, + } + + for _, tc := range tests { + val, ok := GetDimensionValue(tc.dimension, tc.attributes...) + if ok { + assert.Equal(t, tc.wantDimensionVal, val.AsString()) + } + } } From 09192d66ee3d2fb46941756bed6c2958529399ae Mon Sep 17 00:00:00 2001 From: Jared Tan Date: Wed, 28 Aug 2024 21:58:59 +0800 Subject: [PATCH 03/10] make -j2 goporto Signed-off-by: Jared Tan --- pkg/pdatautil/attributes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/pdatautil/attributes.go b/pkg/pdatautil/attributes.go index 9192aa535b6c..a9fbcc08607c 100644 --- a/pkg/pdatautil/attributes.go +++ b/pkg/pdatautil/attributes.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package pdatautil +package pdatautil // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" import "go.opentelemetry.io/collector/pdata/pcommon" From 9d77869e77223175fe3855f0985153baea81b675 Mon Sep 17 00:00:00 2001 From: Jared Tan Date: Wed, 28 Aug 2024 22:04:07 +0800 Subject: [PATCH 04/10] fmt Signed-off-by: Jared Tan --- connector/exceptionsconnector/factory_test.go | 2 +- pkg/pdatautil/attributes_test.go | 23 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/connector/exceptionsconnector/factory_test.go b/connector/exceptionsconnector/factory_test.go index 29258881745a..05d15e25e4d7 100644 --- a/connector/exceptionsconnector/factory_test.go +++ b/connector/exceptionsconnector/factory_test.go @@ -34,7 +34,7 @@ func TestNewConnector(t *testing.T) { }, wantDimensions: []pdatautil.Dimension{ {Name: "http.method", Value: &defaultMethodValue}, - {"http.status_code", nil}, + {Name: "http.status_code", Value: nil}, }, }, } { diff --git a/pkg/pdatautil/attributes_test.go b/pkg/pdatautil/attributes_test.go index 6a8d19c7a0b5..7fea4472aa0e 100644 --- a/pkg/pdatautil/attributes_test.go +++ b/pkg/pdatautil/attributes_test.go @@ -4,21 +4,22 @@ package pdatautil import ( + "testing" + "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/pcommon" - "testing" ) func TestGetDimensionValue(t *testing.T) { - resource_attris := pcommon.NewMap() - resource_attris.PutStr("service.name", "mock-service-name") + resourceattris := pcommon.NewMap() + resourceattris.PutStr("service.name", "mock-service-name") - span_attris := pcommon.NewMap() - span_attris.PutStr("span.name", "mock-span-name") + spanattris := pcommon.NewMap() + spanattris.PutStr("span.name", "mock-span-name") - other_attris := pcommon.NewMap() - other_attris.PutStr("a", "b") - other_attris.PutStr("foo", "bar") + otherattris := pcommon.NewMap() + otherattris.PutStr("a", "b") + otherattris.PutStr("foo", "bar") defaultFoo := pcommon.NewValueStr("bar") @@ -31,7 +32,7 @@ func TestGetDimensionValue(t *testing.T) { { name: "success get dimension value", dimension: Dimension{Name: "foo"}, - attributes: []pcommon.Map{resource_attris, span_attris, other_attris}, + attributes: []pcommon.Map{resourceattris, spanattris, otherattris}, wantDimensionVal: "bar", }, { @@ -40,7 +41,7 @@ func TestGetDimensionValue(t *testing.T) { Name: "foo", Value: &defaultFoo, }, - attributes: []pcommon.Map{resource_attris, span_attris}, + attributes: []pcommon.Map{resourceattris, spanattris}, wantDimensionVal: "bar", }, { @@ -48,7 +49,7 @@ func TestGetDimensionValue(t *testing.T) { dimension: Dimension{ Name: "foo", }, - attributes: []pcommon.Map{resource_attris, span_attris}, + attributes: []pcommon.Map{resourceattris, spanattris}, wantDimensionVal: "", }, } From 902048550f732502a7b61750437567c6765e2042 Mon Sep 17 00:00:00 2001 From: Jared Tan Date: Wed, 28 Aug 2024 22:20:01 +0800 Subject: [PATCH 05/10] modtidy Signed-off-by: Jared Tan --- connector/exceptionsconnector/connector_logs.go | 3 +-- connector/exceptionsconnector/connector_metrics.go | 3 +-- connector/exceptionsconnector/connector_metrics_test.go | 4 ++-- connector/exceptionsconnector/factory_test.go | 4 ++-- connector/exceptionsconnector/go.mod | 2 +- connector/servicegraphconnector/go.mod | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/connector/exceptionsconnector/connector_logs.go b/connector/exceptionsconnector/connector_logs.go index eb7e30feadc4..1f84fc598da8 100644 --- a/connector/exceptionsconnector/connector_logs.go +++ b/connector/exceptionsconnector/connector_logs.go @@ -6,8 +6,6 @@ package exceptionsconnector // import "github.com/open-telemetry/opentelemetry-c import ( "context" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/pcommon" @@ -17,6 +15,7 @@ import ( "go.uber.org/zap" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/traceutil" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" ) type logsConnector struct { diff --git a/connector/exceptionsconnector/connector_metrics.go b/connector/exceptionsconnector/connector_metrics.go index 945659ca3b05..10266bdb952f 100644 --- a/connector/exceptionsconnector/connector_metrics.go +++ b/connector/exceptionsconnector/connector_metrics.go @@ -9,8 +9,6 @@ import ( "sync" "time" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/pcommon" @@ -20,6 +18,7 @@ import ( "go.uber.org/zap" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/traceutil" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" ) const ( diff --git a/connector/exceptionsconnector/connector_metrics_test.go b/connector/exceptionsconnector/connector_metrics_test.go index 6f4b912ff07b..5b2f1392da94 100644 --- a/connector/exceptionsconnector/connector_metrics_test.go +++ b/connector/exceptionsconnector/connector_metrics_test.go @@ -9,8 +9,6 @@ import ( "testing" "time" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component/componenttest" @@ -22,6 +20,8 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zaptest" "google.golang.org/grpc/metadata" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" ) // metricID represents the minimum attributes that uniquely identifies a metric in our tests. diff --git a/connector/exceptionsconnector/factory_test.go b/connector/exceptionsconnector/factory_test.go index 05d15e25e4d7..4c71cbab53d2 100644 --- a/connector/exceptionsconnector/factory_test.go +++ b/connector/exceptionsconnector/factory_test.go @@ -7,12 +7,12 @@ import ( "context" "testing" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" - "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" ) func TestNewConnector(t *testing.T) { diff --git a/connector/exceptionsconnector/go.mod b/connector/exceptionsconnector/go.mod index ea9dbc109673..90e82f1c2224 100644 --- a/connector/exceptionsconnector/go.mod +++ b/connector/exceptionsconnector/go.mod @@ -6,6 +6,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.108.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.108.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.108.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.108.1 go.opentelemetry.io/collector/confmap v1.14.1 @@ -38,7 +39,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.20.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect diff --git a/connector/servicegraphconnector/go.mod b/connector/servicegraphconnector/go.mod index 4a23fd55364c..549d306cc9cf 100644 --- a/connector/servicegraphconnector/go.mod +++ b/connector/servicegraphconnector/go.mod @@ -5,6 +5,7 @@ go 1.22.0 require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.108.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.108.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.108.1 go.opentelemetry.io/collector/config/configtelemetry v0.108.1 @@ -50,7 +51,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_golang v1.20.1 // indirect From 6f37fff6ed559fb0f642141cca011e22ce0e5293 Mon Sep 17 00:00:00 2001 From: Jared Tan Date: Thu, 29 Aug 2024 09:20:14 +0800 Subject: [PATCH 06/10] fmt Signed-off-by: Jared Tan --- connector/servicegraphconnector/connector.go | 3 +-- connector/spanmetricsconnector/connector_test.go | 3 +-- connector/spanmetricsconnector/factory_test.go | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/connector/servicegraphconnector/connector.go b/connector/servicegraphconnector/connector.go index d16e7f95e188..b37d8cbbb9fd 100644 --- a/connector/servicegraphconnector/connector.go +++ b/connector/servicegraphconnector/connector.go @@ -13,8 +13,6 @@ import ( "sync" "time" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/pcommon" @@ -26,6 +24,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/connector/servicegraphconnector/internal/metadata" "github.com/open-telemetry/opentelemetry-collector-contrib/connector/servicegraphconnector/internal/store" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" ) const ( diff --git a/connector/spanmetricsconnector/connector_test.go b/connector/spanmetricsconnector/connector_test.go index d6a34d221561..72cf1107114d 100644 --- a/connector/spanmetricsconnector/connector_test.go +++ b/connector/spanmetricsconnector/connector_test.go @@ -10,8 +10,6 @@ import ( "testing" "time" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" - "github.com/jonboulle/clockwork" "github.com/lightstep/go-expohisto/structure" "github.com/stretchr/testify/assert" @@ -31,6 +29,7 @@ import ( "google.golang.org/grpc/metadata" "github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector/internal/metrics" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" ) const ( diff --git a/connector/spanmetricsconnector/factory_test.go b/connector/spanmetricsconnector/factory_test.go index b89f3a965cb6..be3620e83d71 100644 --- a/connector/spanmetricsconnector/factory_test.go +++ b/connector/spanmetricsconnector/factory_test.go @@ -8,12 +8,12 @@ import ( "testing" "time" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" - "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" ) func TestNewConnector(t *testing.T) { @@ -38,7 +38,7 @@ func TestNewConnector(t *testing.T) { }, wantDimensions: []pdatautil.Dimension{ {Name: "http.method", Value: &defaultMethodValue}, - {"http.status_code", nil}, + {Name: "http.status_code", Value: nil}, }, }, } { From 112a48e39931b901fe102d4da3a9cd9217055ec8 Mon Sep 17 00:00:00 2001 From: Jared Tan Date: Thu, 29 Aug 2024 16:31:35 +0800 Subject: [PATCH 07/10] move into internal Signed-off-by: Jared Tan --- connector/exceptionsconnector/connector.go | 2 +- connector/exceptionsconnector/connector_logs.go | 2 +- .../exceptionsconnector/connector_metrics.go | 2 +- .../connector_metrics_test.go | 2 +- connector/exceptionsconnector/factory_test.go | 2 +- connector/exceptionsconnector/go.mod | 3 ++- connector/exceptionsconnector/go.sum | 2 ++ connector/servicegraphconnector/connector.go | 2 +- connector/servicegraphconnector/go.mod | 5 +++-- connector/servicegraphconnector/go.sum | 3 +++ connector/servicegraphconnector/util.go | 2 +- connector/spanmetricsconnector/connector.go | 17 +++++++++-------- .../spanmetricsconnector/connector_test.go | 2 +- connector/spanmetricsconnector/factory_test.go | 2 +- connector/spanmetricsconnector/go.mod | 3 +++ connector/spanmetricsconnector/go.sum | 2 ++ .../integrationtest/go.mod | 1 + .../integrationtest/go.sum | 2 ++ {pkg => internal}/pdatautil/attributes.go | 2 +- {pkg => internal}/pdatautil/attributes_test.go | 0 testbed/go.mod | 1 + testbed/go.sum | 2 ++ 22 files changed, 40 insertions(+), 21 deletions(-) rename {pkg => internal}/pdatautil/attributes.go (96%) rename {pkg => internal}/pdatautil/attributes_test.go (100%) diff --git a/connector/exceptionsconnector/connector.go b/connector/exceptionsconnector/connector.go index 21f91ba0e026..517848cf50e9 100644 --- a/connector/exceptionsconnector/connector.go +++ b/connector/exceptionsconnector/connector.go @@ -7,7 +7,7 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" conventions "go.opentelemetry.io/collector/semconv/v1.18.0" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil" ) const ( diff --git a/connector/exceptionsconnector/connector_logs.go b/connector/exceptionsconnector/connector_logs.go index 1f84fc598da8..7126980e8e4c 100644 --- a/connector/exceptionsconnector/connector_logs.go +++ b/connector/exceptionsconnector/connector_logs.go @@ -15,7 +15,7 @@ import ( "go.uber.org/zap" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/traceutil" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil" ) type logsConnector struct { diff --git a/connector/exceptionsconnector/connector_metrics.go b/connector/exceptionsconnector/connector_metrics.go index 10266bdb952f..a53d4f70c3ce 100644 --- a/connector/exceptionsconnector/connector_metrics.go +++ b/connector/exceptionsconnector/connector_metrics.go @@ -18,7 +18,7 @@ import ( "go.uber.org/zap" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/traceutil" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil" ) const ( diff --git a/connector/exceptionsconnector/connector_metrics_test.go b/connector/exceptionsconnector/connector_metrics_test.go index 5b2f1392da94..0a3ed58a2f47 100644 --- a/connector/exceptionsconnector/connector_metrics_test.go +++ b/connector/exceptionsconnector/connector_metrics_test.go @@ -21,7 +21,7 @@ import ( "go.uber.org/zap/zaptest" "google.golang.org/grpc/metadata" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil" ) // metricID represents the minimum attributes that uniquely identifies a metric in our tests. diff --git a/connector/exceptionsconnector/factory_test.go b/connector/exceptionsconnector/factory_test.go index 4c71cbab53d2..f39b009d4b46 100644 --- a/connector/exceptionsconnector/factory_test.go +++ b/connector/exceptionsconnector/factory_test.go @@ -12,7 +12,7 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil" ) func TestNewConnector(t *testing.T) { diff --git a/connector/exceptionsconnector/go.mod b/connector/exceptionsconnector/go.mod index 90e82f1c2224..c6aebfb76451 100644 --- a/connector/exceptionsconnector/go.mod +++ b/connector/exceptionsconnector/go.mod @@ -4,9 +4,9 @@ go 1.22.0 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.108.0 + github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.108.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.108.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.108.1 go.opentelemetry.io/collector/confmap v1.14.1 @@ -39,6 +39,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.20.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect diff --git a/connector/exceptionsconnector/go.sum b/connector/exceptionsconnector/go.sum index a0403a554287..1094c88c62cd 100644 --- a/connector/exceptionsconnector/go.sum +++ b/connector/exceptionsconnector/go.sum @@ -48,6 +48,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 h1:w9gFpG5qr98S4bv12bEqs/em+fLIJTn6QRk4LvSgF7Q= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0/go.mod h1:rVhXrlg2sNj87vhheHs5BLH1zNFYeeQnBPRIZiHkrpY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= diff --git a/connector/servicegraphconnector/connector.go b/connector/servicegraphconnector/connector.go index b37d8cbbb9fd..57e63c2757ce 100644 --- a/connector/servicegraphconnector/connector.go +++ b/connector/servicegraphconnector/connector.go @@ -24,7 +24,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/connector/servicegraphconnector/internal/metadata" "github.com/open-telemetry/opentelemetry-collector-contrib/connector/servicegraphconnector/internal/store" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil" ) const ( diff --git a/connector/servicegraphconnector/go.mod b/connector/servicegraphconnector/go.mod index 549d306cc9cf..7d84181147fb 100644 --- a/connector/servicegraphconnector/go.mod +++ b/connector/servicegraphconnector/go.mod @@ -3,9 +3,9 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/connector/servi go 1.22.0 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.108.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.108.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.108.1 go.opentelemetry.io/collector/config/configtelemetry v0.108.1 @@ -51,6 +51,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_golang v1.20.1 // indirect @@ -118,4 +119,4 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil => ../../internal/pdatautil diff --git a/connector/servicegraphconnector/go.sum b/connector/servicegraphconnector/go.sum index a2932316adf5..5d6c7f704ed3 100644 --- a/connector/servicegraphconnector/go.sum +++ b/connector/servicegraphconnector/go.sum @@ -68,6 +68,9 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 h1:w9gFpG5qr98S4bv12bEqs/em+fLIJTn6QRk4LvSgF7Q= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0/go.mod h1:rVhXrlg2sNj87vhheHs5BLH1zNFYeeQnBPRIZiHkrpY= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0/go.mod h1:dHSW1ec9ZHZ/92+NoLEJd5UaL4tRVmnn+DvEQqdJ7f0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= diff --git a/connector/servicegraphconnector/util.go b/connector/servicegraphconnector/util.go index 68e8f86f3c95..25c0bea082aa 100644 --- a/connector/servicegraphconnector/util.go +++ b/connector/servicegraphconnector/util.go @@ -7,7 +7,7 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" semconv "go.opentelemetry.io/collector/semconv/v1.9.0" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil" ) func findServiceName(attributes pcommon.Map) (string, bool) { diff --git a/connector/spanmetricsconnector/connector.go b/connector/spanmetricsconnector/connector.go index 789584132c96..29b6c98954c0 100644 --- a/connector/spanmetricsconnector/connector.go +++ b/connector/spanmetricsconnector/connector.go @@ -23,6 +23,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector/internal/cache" "github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector/internal/metrics" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/traceutil" + utilattri "github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" ) @@ -51,7 +52,7 @@ type connectorImp struct { metricsConsumer consumer.Metrics // Additional dimensions to add to metrics. - dimensions []pdatautil.Dimension + dimensions []utilattri.Dimension resourceMetrics *cache.Cache[resourceKey, *resourceMetrics] @@ -71,7 +72,7 @@ type connectorImp struct { shutdownOnce sync.Once // Event dimensions to add to the events metric. - eDimensions []pdatautil.Dimension + eDimensions []utilattri.Dimension events EventsConfig @@ -90,11 +91,11 @@ type resourceMetrics struct { lastSeen time.Time } -func newDimensions(cfgDims []Dimension) []pdatautil.Dimension { +func newDimensions(cfgDims []Dimension) []utilattri.Dimension { if len(cfgDims) == 0 { return nil } - dims := make([]pdatautil.Dimension, len(cfgDims)) + dims := make([]utilattri.Dimension, len(cfgDims)) for i := range cfgDims { dims[i].Name = cfgDims[i].Name if cfgDims[i].Default != nil { @@ -500,7 +501,7 @@ func contains(elements []string, value string) bool { return false } -func (p *connectorImp) buildAttributes(serviceName string, span ptrace.Span, resourceAttrs pcommon.Map, dimensions []pdatautil.Dimension) pcommon.Map { +func (p *connectorImp) buildAttributes(serviceName string, span ptrace.Span, resourceAttrs pcommon.Map, dimensions []utilattri.Dimension) pcommon.Map { attr := pcommon.NewMap() attr.EnsureCapacity(4 + len(dimensions)) if !contains(p.config.ExcludeDimensions, serviceNameKey) { @@ -516,7 +517,7 @@ func (p *connectorImp) buildAttributes(serviceName string, span ptrace.Span, res attr.PutStr(statusCodeKey, traceutil.StatusCodeStr(span.Status().Code())) } for _, d := range dimensions { - if v, ok := pdatautil.GetDimensionValue(d, span.Attributes(), resourceAttrs); ok { + if v, ok := utilattri.GetDimensionValue(d, span.Attributes(), resourceAttrs); ok { v.CopyTo(attr.PutEmpty(d.Name)) } } @@ -535,7 +536,7 @@ func concatDimensionValue(dest *bytes.Buffer, value string, prefixSep bool) { // or resource/event attributes. If the dimension exists in both, the span's attributes, being the most specific, takes precedence. // // The metric key is a simple concatenation of dimension values, delimited by a null character. -func (p *connectorImp) buildKey(serviceName string, span ptrace.Span, optionalDims []pdatautil.Dimension, resourceOrEventAttrs pcommon.Map) metrics.Key { +func (p *connectorImp) buildKey(serviceName string, span ptrace.Span, optionalDims []utilattri.Dimension, resourceOrEventAttrs pcommon.Map) metrics.Key { p.keyBuf.Reset() if !contains(p.config.ExcludeDimensions, serviceNameKey) { concatDimensionValue(p.keyBuf, serviceName, false) @@ -551,7 +552,7 @@ func (p *connectorImp) buildKey(serviceName string, span ptrace.Span, optionalDi } for _, d := range optionalDims { - if v, ok := pdatautil.GetDimensionValue(d, span.Attributes(), resourceOrEventAttrs); ok { + if v, ok := utilattri.GetDimensionValue(d, span.Attributes(), resourceOrEventAttrs); ok { concatDimensionValue(p.keyBuf, v.AsString(), true) } } diff --git a/connector/spanmetricsconnector/connector_test.go b/connector/spanmetricsconnector/connector_test.go index 72cf1107114d..c4c114fd1fc8 100644 --- a/connector/spanmetricsconnector/connector_test.go +++ b/connector/spanmetricsconnector/connector_test.go @@ -29,7 +29,7 @@ import ( "google.golang.org/grpc/metadata" "github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector/internal/metrics" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil" ) const ( diff --git a/connector/spanmetricsconnector/factory_test.go b/connector/spanmetricsconnector/factory_test.go index be3620e83d71..75aaf79d60c7 100644 --- a/connector/spanmetricsconnector/factory_test.go +++ b/connector/spanmetricsconnector/factory_test.go @@ -13,7 +13,7 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil" ) func TestNewConnector(t *testing.T) { diff --git a/connector/spanmetricsconnector/go.mod b/connector/spanmetricsconnector/go.mod index d80a56c731db..c4ac4b8ca856 100644 --- a/connector/spanmetricsconnector/go.mod +++ b/connector/spanmetricsconnector/go.mod @@ -8,6 +8,7 @@ require ( github.com/jonboulle/clockwork v0.4.0 github.com/lightstep/go-expohisto v1.0.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.108.0 + github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.108.1 @@ -78,3 +79,5 @@ retract ( replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil => ../../internal/pdatautil diff --git a/connector/spanmetricsconnector/go.sum b/connector/spanmetricsconnector/go.sum index 7b9299936e24..7174160bda53 100644 --- a/connector/spanmetricsconnector/go.sum +++ b/connector/spanmetricsconnector/go.sum @@ -56,6 +56,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 h1:w9gFpG5qr98S4bv12bEqs/em+fLIJTn6QRk4LvSgF7Q= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0/go.mod h1:rVhXrlg2sNj87vhheHs5BLH1zNFYeeQnBPRIZiHkrpY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= diff --git a/exporter/elasticsearchexporter/integrationtest/go.mod b/exporter/elasticsearchexporter/integrationtest/go.mod index 6869317181e4..777ec41471a8 100644 --- a/exporter/elasticsearchexporter/integrationtest/go.mod +++ b/exporter/elasticsearchexporter/integrationtest/go.mod @@ -93,6 +93,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.108.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 // indirect diff --git a/exporter/elasticsearchexporter/integrationtest/go.sum b/exporter/elasticsearchexporter/integrationtest/go.sum index 06cce831a7ee..495a1a46e9cc 100644 --- a/exporter/elasticsearchexporter/integrationtest/go.sum +++ b/exporter/elasticsearchexporter/integrationtest/go.sum @@ -181,6 +181,8 @@ github.com/mostynb/go-grpc-compression v1.2.3 h1:42/BKWMy0KEJGSdWvzqIyOZ95YcR9mL github.com/mostynb/go-grpc-compression v1.2.3/go.mod h1:AghIxF3P57umzqM9yz795+y1Vjs47Km/Y2FE6ouQ7Lg= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 h1:w9gFpG5qr98S4bv12bEqs/em+fLIJTn6QRk4LvSgF7Q= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0/go.mod h1:rVhXrlg2sNj87vhheHs5BLH1zNFYeeQnBPRIZiHkrpY= github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= diff --git a/pkg/pdatautil/attributes.go b/internal/pdatautil/attributes.go similarity index 96% rename from pkg/pdatautil/attributes.go rename to internal/pdatautil/attributes.go index a9fbcc08607c..6963e93d8c6f 100644 --- a/pkg/pdatautil/attributes.go +++ b/internal/pdatautil/attributes.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package pdatautil // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" +package pdatautil // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil" import "go.opentelemetry.io/collector/pdata/pcommon" diff --git a/pkg/pdatautil/attributes_test.go b/internal/pdatautil/attributes_test.go similarity index 100% rename from pkg/pdatautil/attributes_test.go rename to internal/pdatautil/attributes_test.go diff --git a/testbed/go.mod b/testbed/go.mod index c8cf5327f6a4..dba981564631 100644 --- a/testbed/go.mod +++ b/testbed/go.mod @@ -203,6 +203,7 @@ require ( github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/ackextension v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.108.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.108.0 // indirect diff --git a/testbed/go.sum b/testbed/go.sum index 717b4cc6af75..4927193a00ed 100644 --- a/testbed/go.sum +++ b/testbed/go.sum @@ -543,6 +543,8 @@ github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4 github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 h1:w9gFpG5qr98S4bv12bEqs/em+fLIJTn6QRk4LvSgF7Q= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0/go.mod h1:rVhXrlg2sNj87vhheHs5BLH1zNFYeeQnBPRIZiHkrpY= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= From aa09b491f4c6160a15a08ab32d4b064b96ee3efd Mon Sep 17 00:00:00 2001 From: Jared Tan Date: Thu, 29 Aug 2024 22:17:24 +0800 Subject: [PATCH 08/10] modtidy Signed-off-by: Jared Tan --- connector/exceptionsconnector/go.mod | 2 +- connector/exceptionsconnector/go.sum | 4 ++-- connector/servicegraphconnector/go.sum | 3 +-- connector/spanmetricsconnector/go.sum | 2 -- connector/sumconnector/go.mod | 6 ------ 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/connector/exceptionsconnector/go.mod b/connector/exceptionsconnector/go.mod index c6aebfb76451..07c4e3a5966c 100644 --- a/connector/exceptionsconnector/go.mod +++ b/connector/exceptionsconnector/go.mod @@ -67,7 +67,7 @@ require ( replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil => ../../internal/pdatautil replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest diff --git a/connector/exceptionsconnector/go.sum b/connector/exceptionsconnector/go.sum index 1094c88c62cd..9b6f823c92e4 100644 --- a/connector/exceptionsconnector/go.sum +++ b/connector/exceptionsconnector/go.sum @@ -48,8 +48,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 h1:w9gFpG5qr98S4bv12bEqs/em+fLIJTn6QRk4LvSgF7Q= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0/go.mod h1:rVhXrlg2sNj87vhheHs5BLH1zNFYeeQnBPRIZiHkrpY= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 h1:vU6a7EKHBu80err/1SCn+8fLpSCdR1PoSzdyydXDcjQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0/go.mod h1:dHSW1ec9ZHZ/92+NoLEJd5UaL4tRVmnn+DvEQqdJ7f0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= diff --git a/connector/servicegraphconnector/go.sum b/connector/servicegraphconnector/go.sum index 5d6c7f704ed3..0588fb9fd1d5 100644 --- a/connector/servicegraphconnector/go.sum +++ b/connector/servicegraphconnector/go.sum @@ -68,8 +68,7 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 h1:w9gFpG5qr98S4bv12bEqs/em+fLIJTn6QRk4LvSgF7Q= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0/go.mod h1:rVhXrlg2sNj87vhheHs5BLH1zNFYeeQnBPRIZiHkrpY= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 h1:vU6a7EKHBu80err/1SCn+8fLpSCdR1PoSzdyydXDcjQ= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0/go.mod h1:dHSW1ec9ZHZ/92+NoLEJd5UaL4tRVmnn+DvEQqdJ7f0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= diff --git a/connector/spanmetricsconnector/go.sum b/connector/spanmetricsconnector/go.sum index 7174160bda53..7b9299936e24 100644 --- a/connector/spanmetricsconnector/go.sum +++ b/connector/spanmetricsconnector/go.sum @@ -56,8 +56,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 h1:w9gFpG5qr98S4bv12bEqs/em+fLIJTn6QRk4LvSgF7Q= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0/go.mod h1:rVhXrlg2sNj87vhheHs5BLH1zNFYeeQnBPRIZiHkrpY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= diff --git a/connector/sumconnector/go.mod b/connector/sumconnector/go.mod index cae7f6578302..429365cfec28 100644 --- a/connector/sumconnector/go.mod +++ b/connector/sumconnector/go.mod @@ -73,14 +73,8 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest - replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter => ../../internal/filter replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl => ../../pkg/ottl - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden From 4cb3311c302d58a8457380488364afaf70b93fbb Mon Sep 17 00:00:00 2001 From: Jared Tan Date: Thu, 29 Aug 2024 22:31:55 +0800 Subject: [PATCH 09/10] make crosslink Signed-off-by: Jared Tan --- connector/exceptionsconnector/go.mod | 2 ++ connector/servicegraphconnector/go.mod | 2 ++ connector/sumconnector/go.mod | 6 ++++++ exporter/elasticsearchexporter/integrationtest/go.mod | 2 ++ testbed/go.mod | 2 ++ 5 files changed, 14 insertions(+) diff --git a/connector/exceptionsconnector/go.mod b/connector/exceptionsconnector/go.mod index 07c4e3a5966c..d7f1b1f6d962 100644 --- a/connector/exceptionsconnector/go.mod +++ b/connector/exceptionsconnector/go.mod @@ -72,3 +72,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdata replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil diff --git a/connector/servicegraphconnector/go.mod b/connector/servicegraphconnector/go.mod index 7d84181147fb..d898de012147 100644 --- a/connector/servicegraphconnector/go.mod +++ b/connector/servicegraphconnector/go.mod @@ -120,3 +120,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil => ../../internal/pdatautil + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil diff --git a/connector/sumconnector/go.mod b/connector/sumconnector/go.mod index 429365cfec28..8547dd85c665 100644 --- a/connector/sumconnector/go.mod +++ b/connector/sumconnector/go.mod @@ -78,3 +78,9 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/corei replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter => ../../internal/filter replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl => ../../pkg/ottl + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest diff --git a/exporter/elasticsearchexporter/integrationtest/go.mod b/exporter/elasticsearchexporter/integrationtest/go.mod index 777ec41471a8..33904967582c 100644 --- a/exporter/elasticsearchexporter/integrationtest/go.mod +++ b/exporter/elasticsearchexporter/integrationtest/go.mod @@ -286,3 +286,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl => .. replace github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector => ../../../connector/routingconnector replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics => ../../../internal/exp/metrics + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil => ../../../internal/pdatautil diff --git a/testbed/go.mod b/testbed/go.mod index dba981564631..494c74b9e94b 100644 --- a/testbed/go.mod +++ b/testbed/go.mod @@ -407,3 +407,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/acke replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl => ../pkg/ottl replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics => ../internal/exp/metrics + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil => ../internal/pdatautil From 889198f473d2b5d7c462e0e81a38709759d612a1 Mon Sep 17 00:00:00 2001 From: Jared Tan Date: Thu, 29 Aug 2024 22:38:38 +0800 Subject: [PATCH 10/10] make gotidy Signed-off-by: Jared Tan --- connector/exceptionsconnector/go.sum | 2 -- connector/servicegraphconnector/go.sum | 2 -- exporter/elasticsearchexporter/integrationtest/go.sum | 2 -- testbed/go.sum | 2 -- 4 files changed, 8 deletions(-) diff --git a/connector/exceptionsconnector/go.sum b/connector/exceptionsconnector/go.sum index 9b6f823c92e4..a0403a554287 100644 --- a/connector/exceptionsconnector/go.sum +++ b/connector/exceptionsconnector/go.sum @@ -48,8 +48,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 h1:vU6a7EKHBu80err/1SCn+8fLpSCdR1PoSzdyydXDcjQ= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0/go.mod h1:dHSW1ec9ZHZ/92+NoLEJd5UaL4tRVmnn+DvEQqdJ7f0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= diff --git a/connector/servicegraphconnector/go.sum b/connector/servicegraphconnector/go.sum index 0588fb9fd1d5..a2932316adf5 100644 --- a/connector/servicegraphconnector/go.sum +++ b/connector/servicegraphconnector/go.sum @@ -68,8 +68,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0 h1:vU6a7EKHBu80err/1SCn+8fLpSCdR1PoSzdyydXDcjQ= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.108.0/go.mod h1:dHSW1ec9ZHZ/92+NoLEJd5UaL4tRVmnn+DvEQqdJ7f0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= diff --git a/exporter/elasticsearchexporter/integrationtest/go.sum b/exporter/elasticsearchexporter/integrationtest/go.sum index 495a1a46e9cc..06cce831a7ee 100644 --- a/exporter/elasticsearchexporter/integrationtest/go.sum +++ b/exporter/elasticsearchexporter/integrationtest/go.sum @@ -181,8 +181,6 @@ github.com/mostynb/go-grpc-compression v1.2.3 h1:42/BKWMy0KEJGSdWvzqIyOZ95YcR9mL github.com/mostynb/go-grpc-compression v1.2.3/go.mod h1:AghIxF3P57umzqM9yz795+y1Vjs47Km/Y2FE6ouQ7Lg= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 h1:w9gFpG5qr98S4bv12bEqs/em+fLIJTn6QRk4LvSgF7Q= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0/go.mod h1:rVhXrlg2sNj87vhheHs5BLH1zNFYeeQnBPRIZiHkrpY= github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= diff --git a/testbed/go.sum b/testbed/go.sum index 4927193a00ed..717b4cc6af75 100644 --- a/testbed/go.sum +++ b/testbed/go.sum @@ -543,8 +543,6 @@ github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4 github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0 h1:w9gFpG5qr98S4bv12bEqs/em+fLIJTn6QRk4LvSgF7Q= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.108.0/go.mod h1:rVhXrlg2sNj87vhheHs5BLH1zNFYeeQnBPRIZiHkrpY= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=