diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 82224fe598ff..b252c603d9ad 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -120,6 +120,7 @@ extension/storage/dbstorage/ @open-te extension/storage/filestorage/ @open-telemetry/collector-contrib-approvers @djaglowski internal/aws/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @mxiamxia +internal/collectd/ @open-telemetry/collector-contrib-approvers @atoulme internal/coreinternal/ @open-telemetry/collector-contrib-approvers @open-telemetry/collector-approvers internal/datadog/ @open-telemetry/collector-contrib-approvers @mx-psi @gbbr @dineshg13 internal/docker/ @open-telemetry/collector-contrib-approvers @rmfitzpatrick @jamesmoessis diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index b29ebc5549a3..91b06b4611c1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -111,6 +111,7 @@ body: - extension/storage/dbstorage - extension/storage/filestorage - internal/aws + - internal/collectd - internal/core - internal/datadog - internal/docker diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 97eba7334d9a..fedcb6d4b981 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -105,6 +105,7 @@ body: - extension/storage/dbstorage - extension/storage/filestorage - internal/aws + - internal/collectd - internal/core - internal/datadog - internal/docker diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml index ba0ae3e97739..b00a2ac5d946 100644 --- a/.github/ISSUE_TEMPLATE/other.yaml +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -105,6 +105,7 @@ body: - extension/storage/dbstorage - extension/storage/filestorage - internal/aws + - internal/collectd - internal/core - internal/datadog - internal/docker diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 63ac4512d3aa..ef952e78e8be 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -367,6 +367,11 @@ updates: schedule: interval: "weekly" day: "wednesday" + - package-ecosystem: "gomod" + directory: "/internal/collectd" + schedule: + interval: "weekly" + day: "wednesday" - package-ecosystem: "gomod" directory: "/internal/coreinternal" schedule: @@ -1012,11 +1017,6 @@ updates: schedule: interval: "weekly" day: "wednesday" - - package-ecosystem: "gomod" - directory: "/receiver/splunkenterprisereceiver" - schedule: - interval: "weekly" - day: "wednesday" - package-ecosystem: "gomod" directory: "/receiver/splunkhecreceiver" schedule: diff --git a/cmd/checkapi/allowlist.txt b/cmd/checkapi/allowlist.txt index 78f98e2c605b..7866dce0ae2d 100644 --- a/cmd/checkapi/allowlist.txt +++ b/cmd/checkapi/allowlist.txt @@ -2,7 +2,6 @@ connector/servicegraphconnector extension/encoding extension/observer processor/servicegraphprocessor -receiver/collectdreceiver receiver/dockerstatsreceiver receiver/journaldreceiver receiver/kafkareceiver diff --git a/cmd/configschema/go.mod b/cmd/configschema/go.mod index 0178f28bc72a..c02670616c88 100644 --- a/cmd/configschema/go.mod +++ b/cmd/configschema/go.mod @@ -493,6 +493,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.88.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd v0.0.0-00010101000000-000000000000 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.88.0 // indirect @@ -1126,3 +1127,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib => ../.. replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver => ../../receiver/azureeventhubreceiver replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd => ../../internal/collectd diff --git a/cmd/otelcontribcol/builder-config.yaml b/cmd/otelcontribcol/builder-config.yaml index 359c775f2059..e448db666cd4 100644 --- a/cmd/otelcontribcol/builder-config.yaml +++ b/cmd/otelcontribcol/builder-config.yaml @@ -421,3 +421,4 @@ replaces: - github.com/outcaste-io/ristretto v0.2.0 => github.com/outcaste-io/ristretto v0.2.1 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure => ../../pkg/translator/azure - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/skywalking => ../../pkg/translator/skywalking + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd => ../../internal/collectd diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 4415b55669c7..b00335bcf793 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -520,6 +520,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.88.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd v0.0.0-00010101000000-000000000000 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.88.0 // indirect @@ -1143,3 +1144,5 @@ replace github.com/outcaste-io/ristretto v0.2.0 => github.com/outcaste-io/ristre replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure => ../../pkg/translator/azure replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/skywalking => ../../pkg/translator/skywalking + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd => ../../internal/collectd diff --git a/go.mod b/go.mod index 7f1de057197f..0af000bbd31c 100644 --- a/go.mod +++ b/go.mod @@ -495,6 +495,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.88.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd v0.0.0-00010101000000-000000000000 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.88.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.88.0 // indirect @@ -1130,3 +1131,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/snowf replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver => ./receiver/azureeventhubreceiver replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ./pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd => ./internal/collectd diff --git a/internal/collectd/Makefile b/internal/collectd/Makefile new file mode 100644 index 000000000000..ded7a36092dc --- /dev/null +++ b/internal/collectd/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common diff --git a/internal/collectd/go.mod b/internal/collectd/go.mod new file mode 100644 index 000000000000..62d9daa81e5c --- /dev/null +++ b/internal/collectd/go.mod @@ -0,0 +1,3 @@ +module github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd + +go 1.20 diff --git a/internal/collectd/labels.go b/internal/collectd/labels.go new file mode 100644 index 000000000000..439f7af673a2 --- /dev/null +++ b/internal/collectd/labels.go @@ -0,0 +1,52 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package collectd // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd" + +import ( + "strings" +) + +// LabelsFromName tries to pull out dimensions out of name in the format +// "name[k=v,f=x]-more_name". +// For the example above it would return "name-more_name" and extract dimensions +// (k,v) and (f,x). +// If something unexpected is encountered it returns the original metric name. +// +// The code tries to avoid allocation by using local slices and avoiding calls +// to functions like strings.Slice. +func LabelsFromName(val *string) (metricName string, labels map[string]string) { + metricName = *val + index := strings.Index(*val, "[") + if index > -1 { + left := (*val)[:index] + rest := (*val)[index+1:] + index = strings.Index(rest, "]") + if index > -1 { + working := make(map[string]string) + dimensions := rest[:index] + rest = rest[index+1:] + cindex := strings.Index(dimensions, ",") + prev := 0 + for { + if cindex < prev { + cindex = len(dimensions) + } + piece := dimensions[prev:cindex] + tindex := strings.Index(piece, "=") + if tindex == -1 || strings.Contains(piece[tindex+1:], "=") { + return + } + working[piece[:tindex]] = piece[tindex+1:] + if cindex == len(dimensions) { + break + } + prev = cindex + 1 + cindex = strings.Index(dimensions[prev:], ",") + prev + } + labels = working + metricName = left + rest + } + } + return +} diff --git a/internal/collectd/metadata.yaml b/internal/collectd/metadata.yaml new file mode 100644 index 000000000000..8351149176a0 --- /dev/null +++ b/internal/collectd/metadata.yaml @@ -0,0 +1,3 @@ +status: + codeowners: + active: [atoulme] \ No newline at end of file diff --git a/receiver/collectdreceiver/collectd.go b/receiver/collectdreceiver/collectd.go index e5c060c94855..a57220bd333f 100644 --- a/receiver/collectdreceiver/collectd.go +++ b/receiver/collectdreceiver/collectd.go @@ -6,13 +6,13 @@ package collectdreceiver // import "github.com/open-telemetry/opentelemetry-coll import ( "encoding/json" "fmt" - "strings" "time" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" "go.uber.org/zap" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/sanitize" ) @@ -187,7 +187,7 @@ func (cdr *collectDRecord) pointTypeInstance(attrs map[string]string, parts []by return parts } - instanceName, extractedAttrs := LabelsFromName(cdr.TypeInstance) + instanceName, extractedAttrs := collectd.LabelsFromName(cdr.TypeInstance) if instanceName != "" { if len(parts) > 0 { parts = append(parts, '.') @@ -203,50 +203,6 @@ func (cdr *collectDRecord) pointTypeInstance(attrs map[string]string, parts []by return parts } -// LabelsFromName tries to pull out dimensions out of name in the format -// "name[k=v,f=x]-more_name". -// For the example above it would return "name-more_name" and extract dimensions -// (k,v) and (f,x). -// If something unexpected is encountered it returns the original metric name. -// -// The code tries to avoid allocation by using local slices and avoiding calls -// to functions like strings.Slice. -func LabelsFromName(val *string) (metricName string, labels map[string]string) { - metricName = *val - index := strings.Index(*val, "[") - if index > -1 { - left := (*val)[:index] - rest := (*val)[index+1:] - index = strings.Index(rest, "]") - if index > -1 { - working := make(map[string]string) - dimensions := rest[:index] - rest = rest[index+1:] - cindex := strings.Index(dimensions, ",") - prev := 0 - for { - if cindex < prev { - cindex = len(dimensions) - } - piece := dimensions[prev:cindex] - tindex := strings.Index(piece, "=") - if tindex == -1 || strings.Contains(piece[tindex+1:], "=") { - return - } - working[piece[:tindex]] = piece[tindex+1:] - if cindex == len(dimensions) { - break - } - prev = cindex + 1 - cindex = strings.Index(dimensions[prev:], ",") + prev - } - labels = working - metricName = left + rest - } - } - return -} - func isNilOrEmpty(str *string) bool { return str == nil || *str == "" } @@ -263,7 +219,7 @@ func parseAndAddLabels(labels map[string]string, pluginInstance *string, host *s } func parseNameForLabels(labels map[string]string, key string, val *string) { - instanceName, toAddDims := LabelsFromName(val) + instanceName, toAddDims := collectd.LabelsFromName(val) for k, v := range toAddDims { if _, exists := labels[k]; !exists { diff --git a/receiver/collectdreceiver/go.mod b/receiver/collectdreceiver/go.mod index 294752cc8312..b5f724381d1c 100644 --- a/receiver/collectdreceiver/go.mod +++ b/receiver/collectdreceiver/go.mod @@ -3,6 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collec go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd v0.0.0-00010101000000-000000000000 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.0.0-00010101000000-000000000000 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.88.0 @@ -77,3 +78,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd => ../../internal/collectd diff --git a/receiver/wavefrontreceiver/go.mod b/receiver/wavefrontreceiver/go.mod index a5c2d168183a..41724e7537a1 100644 --- a/receiver/wavefrontreceiver/go.mod +++ b/receiver/wavefrontreceiver/go.mod @@ -3,9 +3,9 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/wavefr go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd v0.0.0-00010101000000-000000000000 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver v0.88.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver v0.0.0-00010101000000-000000000000 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 go.opentelemetry.io/collector/config/confignet v0.88.1-0.20231026220224-6405e152a2d9 @@ -17,16 +17,10 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/felixge/httpsnoop v1.0.3 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.2.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.2 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.0.1 // indirect @@ -36,20 +30,10 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rs/cors v1.10.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/config/configauth v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/config/configcompression v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/config/confighttp v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/config/configopaque v0.88.1-0.20231026220224-6405e152a2d9 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/config/configtls v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/config/internal v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/collector/extension/auth v0.88.1-0.20231026220224-6405e152a2d9 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect @@ -64,8 +48,6 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver => ../collectdreceiver - replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver => ../carbonreceiver replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common @@ -76,8 +58,4 @@ retract ( v0.65.0 ) -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/pkg/golden => ../../pkg/golden +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd => ../../internal/collectd diff --git a/receiver/wavefrontreceiver/go.sum b/receiver/wavefrontreceiver/go.sum index 98eeb3fc0e1c..7f44f4b6320a 100644 --- a/receiver/wavefrontreceiver/go.sum +++ b/receiver/wavefrontreceiver/go.sum @@ -13,17 +13,10 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= -github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -43,8 +36,6 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -59,8 +50,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= @@ -90,8 +79,6 @@ github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lne github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= -github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -109,38 +96,20 @@ go.opentelemetry.io/collector v0.88.1-0.20231026220224-6405e152a2d9 h1:UIbHSFtHl go.opentelemetry.io/collector v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:5iWdJH9WM+Bp+t3Ii72ppPmeZ0B2vci07ApE+0fRGKs= go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 h1:t9GCaQDZ1MDBjEAC1Y7NvwiqvVppK6ckAfrUEAlFioA= go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:4utKxz4Lilym3SPxNXJHosdaTjT1aQxI+TCmnJO54pU= -go.opentelemetry.io/collector/config/configauth v0.88.1-0.20231026220224-6405e152a2d9 h1:/miLBOHQlxspauNzKacbukT861aW8vgkG6DYjc6i7YA= -go.opentelemetry.io/collector/config/configauth v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:iMPoqAeGB9UScF/sugPF8xcuctlhx8jFK2jAmzDn/1E= -go.opentelemetry.io/collector/config/configcompression v0.88.1-0.20231026220224-6405e152a2d9 h1:5cqU6jeFGjqSrL5RsDSxrQe7vTIICeyoxATY1J4mUvc= -go.opentelemetry.io/collector/config/configcompression v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:LaavoxZsro5lL7qh1g9DMifG0qixWPEecW18Qr8bpag= -go.opentelemetry.io/collector/config/confighttp v0.88.1-0.20231026220224-6405e152a2d9 h1:jEEupxkBYPlKo4uA/9s7mrN9d2iZQ5hTPIQpOelxaiw= -go.opentelemetry.io/collector/config/confighttp v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:bmzLcdPexlRvI7a+56eGqZOWhMYAMf+F0h+HLzrpv6w= go.opentelemetry.io/collector/config/confignet v0.88.1-0.20231026220224-6405e152a2d9 h1:NPTJUR2N2d0XfRgkuxLJk3TzoaIaeXsC6eynZXDkC9w= go.opentelemetry.io/collector/config/confignet v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:cpO8JYWGONaViOygKVw+Hd2UoBcn2cUiyi0WWeFTwJY= -go.opentelemetry.io/collector/config/configopaque v0.88.1-0.20231026220224-6405e152a2d9 h1:YwkklGD3FSAp9QAmkFwzjRLxYKdTGp61s0ZuIpFQSyM= -go.opentelemetry.io/collector/config/configopaque v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:TPCHaU+QXiEV+JXbgyr6mSErTI9chwQyasDVMdJr3eY= go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 h1:4WPy3qE1lJE1LZE7t1kAj1XSZN85w68JknZO5Uo00vw= go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= -go.opentelemetry.io/collector/config/configtls v0.88.1-0.20231026220224-6405e152a2d9 h1:Ez4mdgLXvdusZGu7I4+X2hiXCQP69aAB0LWERwosJmE= -go.opentelemetry.io/collector/config/configtls v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:i8X3Zj6ICyTbtIOZrDzgXFkFVGKjFtM6/82SMOXbYHc= -go.opentelemetry.io/collector/config/internal v0.88.1-0.20231026220224-6405e152a2d9 h1:11WTkBuGy3QCRXQA6oy9ZJn+wBSEfZ7USnKVTPy9yCY= -go.opentelemetry.io/collector/config/internal v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:42VsQ/1kP2qnvzjNi+dfNP+KyCFRADejyrJ8m2GVL3M= go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 h1:JKFChlNpigR1Q4hZUjDU2sB2VuQ+RigAh7oOQfdcaiQ= go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:CSJlMk1KRZloXAygpiPeCLpuQiLVDEZYbGsGHIKHeUg= go.opentelemetry.io/collector/consumer v0.88.1-0.20231026220224-6405e152a2d9 h1:xiosDLoF99krBlBdiZvw22CSCYU0picQMKskzjaIU8I= go.opentelemetry.io/collector/consumer v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:VVoafgyhjpO6fuJu12GqspmuLrn91JCOou0sOtb9GOg= -go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 h1:6lnGLRgbuTQR7sR1xRqTfJMX2UNkOKbqVAwJDzobvGY= -go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:5wPlOyWtVJcZS9CMhFUnuRvNQ0XIoV/iUSaZWtCjoHA= -go.opentelemetry.io/collector/extension/auth v0.88.1-0.20231026220224-6405e152a2d9 h1:YFN6/C9HLfY/k0OyHUdF7jInwBZT+C9O9FNfQTxNHoY= -go.opentelemetry.io/collector/extension/auth v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:IcwiPhj6ZGTaZ7WVRVvl97uyw9NShsVqcTRLtXddpK0= go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:luvDPu+FNy6LIylBOO8PH/ca6ym7JKAdMe1J1aJbsF4= go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:TVYPzf0ZwFDTSoQ6gPk4lpQgVK4g43cWYuo710E0RHI= go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:Rv9fOclA5AtM/JGm0d4jBOIAo1+jBA13UT5Bx0ovXi4= go.opentelemetry.io/collector/receiver v0.88.1-0.20231026220224-6405e152a2d9 h1:h+1btMM+rRpZsCnR2vFmvmczeQxKhVwEohV8urOvZho= go.opentelemetry.io/collector/receiver v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:3lhOi7CWMwiiolm6d579ZX+pIVwKPCRP+7ScontYOuI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA= diff --git a/receiver/wavefrontreceiver/wavefront_parser.go b/receiver/wavefrontreceiver/wavefront_parser.go index 1e2db7dfda03..7f4432d11f3c 100644 --- a/receiver/wavefrontreceiver/wavefront_parser.go +++ b/receiver/wavefrontreceiver/wavefront_parser.go @@ -12,8 +12,8 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/protocol" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver" ) // WavefrontParser converts metrics in the Wavefront format, see @@ -120,7 +120,7 @@ func (wp *WavefrontParser) injectCollectDLabels( var toAddDims map[string]string index := strings.Index(metricName, "..") for { - metricName, toAddDims = collectdreceiver.LabelsFromName(&metricName) + metricName, toAddDims = collectd.LabelsFromName(&metricName) if len(toAddDims) == 0 { if index == -1 { metricName = strings.ReplaceAll(metricName, "..", ".") diff --git a/versions.yaml b/versions.yaml index 3e69f17bfada..f621d488cd35 100644 --- a/versions.yaml +++ b/versions.yaml @@ -104,6 +104,7 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray - github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray/testdata/sampleapp - github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray/testdata/sampleserver + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal - github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker