diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index 424d3be6a18..c70adb9057d 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -9,10 +9,19 @@ assignees: '' Like #4522, but for vX.X.X +**Performed by collector release manager** + - [ ] Prepare core release vX.X.X - [ ] Tag and release core vX.X.X - [ ] Prepare contrib release vX.X.X - [ ] Tag and release contrib vX.X.X - [ ] Prepare otelcol-releases vX.X.X - [ ] Release binaries and container images vX.X.X -- [ ] Release the operator vX.X.X \ No newline at end of file + +**Performed by operator maintainers** + +- [ ] Release the operator vX.X.X + +**Performed by helm chart maintainers** + +- [ ] Update the opentelemetry-collector helm chart to use vX.X.X docker image diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3c1e48a78a5..18506545a3e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -184,6 +184,8 @@ jobs: goarch: amd64 - goos: linux goarch: arm64 + - goos: linux + goarch: ppc64le - goos: linux goarch: arm - goos: windows diff --git a/.github/workflows/scripts/verify-dist-files-exist.sh b/.github/workflows/scripts/verify-dist-files-exist.sh index 694ebbbc6dd..588cb720031 100755 --- a/.github/workflows/scripts/verify-dist-files-exist.sh +++ b/.github/workflows/scripts/verify-dist-files-exist.sh @@ -2,6 +2,7 @@ files=( bin/otelcol_darwin_amd64 bin/otelcol_darwin_arm64 bin/otelcol_linux_arm64 + bin/otelcol_linux_ppc64le bin/otelcol_linux_amd64 bin/otelcol_windows_amd64.exe ); diff --git a/CHANGELOG.md b/CHANGELOG.md index 6710b2cc147..18d69ec34f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ ## Unreleased +### 💡 Enhancements 💡 + +- Add `linux-ppc64le` architecture to cross build tests in CI +- `client`: perform case insensitive lookups in case the requested metadata value isn't found (#5646) +- `loggingexporter`: Decouple `loglevel` field from level of logged messages (#5678) + +### 🧰 Bug fixes 🧰 + +- Fix Collector panic when disabling telemetry metrics (#5642) +- Fix Collector panic when featuregate value is empty (#5663) + +## v0.55.0 Beta + ### 🛑 Breaking changes 🛑 - Remove deprecated `config.ServiceTelemetry` (#5565) @@ -21,6 +34,7 @@ - `component.WithTracesProcessor` -> `component.WithTracesProcessorAndStabilityLevel` - `component.WithMetricsProcessor` -> `component.WithMetricsProcessorAndStabilityLevel` - `component.WithLogsProcessor` -> `component.WithLogsProcessorAndStabilityLevel` +- Deprecate `Registry.Apply` in `service.featuregate` (#5660) ### 💡 Enhancements 💡 @@ -34,6 +48,7 @@ ### 🧰 Bug fixes 🧰 - Fix initialization of the OpenTelemetry MetricProvider. (#5571) +- Set log level for `undefined` stability level to debug. (#5635) ## v0.54.0 Beta @@ -81,6 +96,7 @@ - Unconfigured receivers are not identified, this was not a real problem in final binaries since the validation of the config catch this. - Allow configurations to contain "unused" receivers. Receivers that are configured but not used in any pipeline, this was possible already for exporters and processors. - Remove the enforcement/check that Receiver factories create the same instance for the same config. +- Fix confighttp.compression panic due to nil request.Body. (#5628) ## v0.53.0 Beta diff --git a/client/client.go b/client/client.go index b5974e53a06..4b3f701badb 100644 --- a/client/client.go +++ b/client/client.go @@ -91,6 +91,7 @@ package client // import "go.opentelemetry.io/collector/client" import ( "context" "net" + "strings" ) type ctxKey struct{} @@ -160,7 +161,19 @@ func NewMetadata(md map[string][]string) Metadata { func (m Metadata) Get(key string) []string { vals := m.data[key] if len(vals) == 0 { - return nil + // we didn't find the key, but perhaps it just has different cases? + for k, v := range m.data { + if strings.EqualFold(key, k) { + vals = v + // we optimize for the next lookup + m.data[key] = v + } + } + + // if it's still not found, it's really not here + if len(vals) == 0 { + return nil + } } ret := make([]string, len(vals)) diff --git a/client/client_test.go b/client/client_test.go index 3249e84e905..a43fecc7e0b 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -91,6 +91,7 @@ func TestMetadata(t *testing.T) { source := map[string][]string{"test-key": {"test-val"}} md := NewMetadata(source) assert.Equal(t, []string{"test-val"}, md.Get("test-key")) + assert.Equal(t, []string{"test-val"}, md.Get("test-KEY")) // case insensitive lookup // test if copy. In regular use, source cannot change val := md.Get("test-key") diff --git a/cmd/builder/.goreleaser.yml b/cmd/builder/.goreleaser.yml index cf970cc3270..72da2389a49 100644 --- a/cmd/builder/.goreleaser.yml +++ b/cmd/builder/.goreleaser.yml @@ -18,6 +18,7 @@ builds: goarch: - amd64 - arm64 + - ppc64le ignore: - goos: windows goarch: arm64 diff --git a/cmd/builder/internal/builder/config.go b/cmd/builder/internal/builder/config.go index 2cac5e4bf85..98e39b6bcc5 100644 --- a/cmd/builder/internal/builder/config.go +++ b/cmd/builder/internal/builder/config.go @@ -25,7 +25,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.54.0" +const defaultOtelColVersion = "0.55.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/cmd/otelcorecol/builder-config.yaml b/cmd/otelcorecol/builder-config.yaml index eeecb87bb75..0afd84ffafb 100644 --- a/cmd/otelcorecol/builder-config.yaml +++ b/cmd/otelcorecol/builder-config.yaml @@ -2,29 +2,29 @@ dist: module: go.opentelemetry.io/collector/cmd/otelcorecol name: otelcorecol description: Local OpenTelemetry Collector binary, testing only. - version: 0.54.0-dev - otelcol_version: 0.54.0 + version: 0.55.0-dev + otelcol_version: 0.55.0 receivers: - import: go.opentelemetry.io/collector/receiver/otlpreceiver - gomod: go.opentelemetry.io/collector v0.54.0 + gomod: go.opentelemetry.io/collector v0.55.0 exporters: - import: go.opentelemetry.io/collector/exporter/loggingexporter - gomod: go.opentelemetry.io/collector v0.54.0 + gomod: go.opentelemetry.io/collector v0.55.0 - import: go.opentelemetry.io/collector/exporter/otlpexporter - gomod: go.opentelemetry.io/collector v0.54.0 + gomod: go.opentelemetry.io/collector v0.55.0 - import: go.opentelemetry.io/collector/exporter/otlphttpexporter - gomod: go.opentelemetry.io/collector v0.54.0 + gomod: go.opentelemetry.io/collector v0.55.0 extensions: - import: go.opentelemetry.io/collector/extension/ballastextension - gomod: go.opentelemetry.io/collector v0.54.0 + gomod: go.opentelemetry.io/collector v0.55.0 - import: go.opentelemetry.io/collector/extension/zpagesextension - gomod: go.opentelemetry.io/collector v0.54.0 + gomod: go.opentelemetry.io/collector v0.55.0 processors: - import: go.opentelemetry.io/collector/processor/batchprocessor - gomod: go.opentelemetry.io/collector v0.54.0 + gomod: go.opentelemetry.io/collector v0.55.0 - import: go.opentelemetry.io/collector/processor/memorylimiterprocessor - gomod: go.opentelemetry.io/collector v0.54.0 + gomod: go.opentelemetry.io/collector v0.55.0 replaces: - go.opentelemetry.io/collector => ../../ diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index 12c5cbea499..e130eb42ec7 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -5,9 +5,9 @@ module go.opentelemetry.io/collector/cmd/otelcorecol go 1.17 require ( - github.com/stretchr/testify v1.7.5 - go.opentelemetry.io/collector v0.54.0 - golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 + github.com/stretchr/testify v1.8.0 + go.opentelemetry.io/collector v0.55.0 + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a ) require ( @@ -16,7 +16,7 @@ require ( github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect github.com/go-kit/log v0.2.0 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-logr/logr v1.2.3 // indirect @@ -29,7 +29,7 @@ require ( github.com/google/uuid v1.3.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.6 // indirect + github.com/klauspost/compress v1.15.7 // indirect github.com/knadh/koanf v1.4.2 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.6 // indirect @@ -42,13 +42,13 @@ require ( github.com/mostynb/go-grpc-compression v1.1.16 // 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.12.1 // indirect + github.com/prometheus/client_golang v1.12.2 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.35.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/prometheus/statsd_exporter v0.21.0 // indirect github.com/rs/cors v1.8.2 // indirect - github.com/shirou/gopsutil/v3 v3.22.5 // indirect + github.com/shirou/gopsutil/v3 v3.22.6 // indirect github.com/spf13/cobra v1.5.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect @@ -57,15 +57,15 @@ require ( go.opencensus.io v0.23.0 // indirect go.opentelemetry.io/collector/pdata v0.54.0 // indirect go.opentelemetry.io/collector/semconv v0.54.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 // indirect - go.opentelemetry.io/contrib/zpages v0.32.0 // indirect - go.opentelemetry.io/otel v1.7.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.30.0 // indirect - go.opentelemetry.io/otel/metric v0.30.0 // indirect - go.opentelemetry.io/otel/sdk v1.7.0 // indirect - go.opentelemetry.io/otel/sdk/metric v0.30.0 // indirect - go.opentelemetry.io/otel/trace v1.7.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 // indirect + go.opentelemetry.io/contrib/zpages v0.33.0 // indirect + go.opentelemetry.io/otel v1.8.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.31.0 // indirect + go.opentelemetry.io/otel/metric v0.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.8.0 // indirect + go.opentelemetry.io/otel/sdk/metric v0.31.0 // indirect + go.opentelemetry.io/otel/trace v1.8.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 // indirect diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum index 74ca9c81993..0cfbe9dfa60 100644 --- a/cmd/otelcorecol/go.sum +++ b/cmd/otelcorecol/go.sum @@ -58,7 +58,6 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21 github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -98,8 +97,8 @@ github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +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/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -178,7 +177,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -241,8 +239,8 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 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.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.6 h1:6D9PcO8QWu0JyaQ2zUMmu16T1T+zjjEpP91guRsvDfY= -github.com/klauspost/compress v1.15.6/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.7 h1:7cgTQxJCU/vy+oP/E3B9RGbQTgbiVzIJWIKOLoAsPok= +github.com/klauspost/compress v1.15.7/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/knadh/koanf v1.4.2 h1:2itp+cdC6miId4pO4Jw7c/3eiYD26Z/Sz3ATJMwHxIs= github.com/knadh/koanf v1.4.2/go.mod h1:4NCo0q4pmU398vF9vq2jStF9MWQZ8JEDcDMHlDCr4h0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -315,8 +313,9 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -348,8 +347,8 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/schollz/progressbar/v2 v2.13.2/go.mod h1:6YZjqdthH6SCZKv2rqGryrxPtfmRB/DWZxSMfCXPyD8= -github.com/shirou/gopsutil/v3 v3.22.5 h1:atX36I/IXgFiB81687vSiBI5zrMsxcIBkP9cQMJQoJA= -github.com/shirou/gopsutil/v3 v3.22.5/go.mod h1:so9G9VzeHt/hsd0YwqprnjHnfARAUktauykSbr+y2gA= +github.com/shirou/gopsutil/v3 v3.22.6 h1:FnHOFOh+cYAM0C30P+zysPISzlknLC5Z1G4EAElznfQ= +github.com/shirou/gopsutil/v3 v3.22.6/go.mod h1:EdIubSnZhbAvBS1yJ7Xi+AShB/hxwLHOMz4MCYz7yMs= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= @@ -368,8 +367,9 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= @@ -388,24 +388,24 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 h1:WenoaOMNP71oq3KkMZ/jnxI9xU/JSCLw8yZILSI2lfU= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0/go.mod h1:J0dBVrt7dPS/lKJyQoW0xzQiUr4r2Ik1VwPjAUWnofI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 h1:mac9BKRqwaX6zxHPDe3pvmWpwuuIM0vuXv2juCnQevE= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0/go.mod h1:5eCOqeGphOyz6TsY3ZDNjE33SM/TFAK3RGuCL2naTgY= -go.opentelemetry.io/contrib/zpages v0.32.0 h1:AVKTx5ppWDaem7A61HFsO1T3CK/t6kFRQoZQMj0/TW4= -go.opentelemetry.io/contrib/zpages v0.32.0/go.mod h1:Jx75I61RDcZU3d/1WrP6UdINlzGGLAwFNdQ3bCTb+qw= -go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM= -go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= -go.opentelemetry.io/otel/exporters/prometheus v0.30.0 h1:YXo5ZY5nofaEYMCMTTMaRH2cLDZB8+0UGuk5RwMfIo0= -go.opentelemetry.io/otel/exporters/prometheus v0.30.0/go.mod h1:qN5feW+0/d661KDtJuATEmHtw5bKBK7NSvNEP927zSs= -go.opentelemetry.io/otel/metric v0.30.0 h1:Hs8eQZ8aQgs0U49diZoaS6Uaxw3+bBE3lcMUKBFIk3c= -go.opentelemetry.io/otel/metric v0.30.0/go.mod h1:/ShZ7+TS4dHzDFmfi1kSXMhMVubNoP0oIaBp70J6UXU= -go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= -go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= -go.opentelemetry.io/otel/sdk/metric v0.30.0 h1:XTqQ4y3erR2Oj8xSAOL5ovO5011ch2ELg51z4fVkpME= -go.opentelemetry.io/otel/sdk/metric v0.30.0/go.mod h1:8AKFRi5HyvTR0RRty3paN1aMC9HMT+NzcEhw/BLkLX8= -go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= -go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 h1:z6rnla1Asjzn0FrhohzIbDi4bxbtc6EMmQ7f5ZPn+pA= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M= +go.opentelemetry.io/contrib/zpages v0.33.0 h1:0JATTp4rT56Mrfrq1icN9GqrI+1uFjq2NwJJRl8m3fk= +go.opentelemetry.io/contrib/zpages v0.33.0/go.mod h1:ddmD63NkBVE29GucaBBCR8/b/TRlY+PkpIbF3m2JF7Y= +go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg= +go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= +go.opentelemetry.io/otel/exporters/prometheus v0.31.0 h1:jwtnOGBM8dIty5AVZ+9ZCzZexCea3aVKmUfZAQcHqxs= +go.opentelemetry.io/otel/exporters/prometheus v0.31.0/go.mod h1:QarXIB8L79IwIPoNgG3A6zNvBgVmcppeFogV1d8612s= +go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= +go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= +go.opentelemetry.io/otel/sdk v1.8.0 h1:xwu69/fNuwbSHWe/0PGS888RmjWY181OmcXDQKu7ZQk= +go.opentelemetry.io/otel/sdk v1.8.0/go.mod h1:uPSfc+yfDH2StDM/Rm35WE8gXSNdvCg023J6HeGNO0c= +go.opentelemetry.io/otel/sdk/metric v0.31.0 h1:2sZx4R43ZMhJdteKAlKoHvRgrMp53V1aRxvEf5lCq8Q= +go.opentelemetry.io/otel/sdk/metric v0.31.0/go.mod h1:fl0SmNnX9mN9xgU6OLYLMBMrNAsaZQi7qBwprwO3abk= +go.opentelemetry.io/otel/trace v1.8.0 h1:cSy0DF9eGI5WIfNwZ1q2iUyGj00tGzP24dE1lOlHrfY= +go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= @@ -553,14 +553,14 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -698,7 +698,6 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/cmd/otelcorecol/main.go b/cmd/otelcorecol/main.go index d4109280384..bc4a714d9a9 100644 --- a/cmd/otelcorecol/main.go +++ b/cmd/otelcorecol/main.go @@ -19,7 +19,7 @@ func main() { info := component.BuildInfo{ Command: "otelcorecol", Description: "Local OpenTelemetry Collector binary, testing only.", - Version: "0.54.0-dev", + Version: "0.55.0-dev", } if err := run(service.CollectorSettings{BuildInfo: info, Factories: factories}); err != nil { diff --git a/component/component.go b/component/component.go index c73e042a222..8990baa8921 100644 --- a/component/component.go +++ b/component/component.go @@ -138,6 +138,24 @@ func (sl StabilityLevel) String() string { return "undefined" } +func (sl StabilityLevel) LogMessage() string { + switch sl { + case StabilityLevelUnmaintained: + return "Unmaintained component. Actively looking for contributors. Component will become deprecated after 6 months of remaining unmaintained." + case StabilityLevelDeprecated: + return "Deprecated component. Will be removed in future releases." + case StabilityLevelInDevelopment: + return "In development component. May change in the future." + case StabilityLevelAlpha: + return "Alpha component. May change in the future." + case StabilityLevelBeta: + return "Beta component. May change in the future." + case StabilityLevelStable: + return "Stable component." + } + return "Stability level of component is undefined" +} + // Factory is implemented by all component factories. // // This interface cannot be directly implemented. Implementations must diff --git a/component/componenttest/nop_telemetry.go b/component/componenttest/nop_telemetry.go index 6b0fd94ee0d..d872b45cc83 100644 --- a/component/componenttest/nop_telemetry.go +++ b/component/componenttest/nop_telemetry.go @@ -15,7 +15,7 @@ package componenttest // import "go.opentelemetry.io/collector/component/componenttest" import ( - "go.opentelemetry.io/otel/metric/nonrecording" + "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" @@ -28,7 +28,7 @@ func NewNopTelemetrySettings() component.TelemetrySettings { return component.TelemetrySettings{ Logger: zap.NewNop(), TracerProvider: trace.NewNoopTracerProvider(), - MeterProvider: nonrecording.NewNoopMeterProvider(), + MeterProvider: metric.NewNoopMeterProvider(), MetricsLevel: configtelemetry.LevelNone, } } diff --git a/config/confighttp/compression.go b/config/confighttp/compression.go index 13537d599f1..e85b2cfa90c 100644 --- a/config/confighttp/compression.go +++ b/config/confighttp/compression.go @@ -82,19 +82,21 @@ func (r *compressRoundTripper) RoundTrip(req *http.Request) (*http.Response, err if writerErr != nil { return nil, writerErr } - _, copyErr := io.Copy(compressWriter, req.Body) - closeErr := req.Body.Close() + if req.Body != nil { + _, copyErr := io.Copy(compressWriter, req.Body) + closeErr := req.Body.Close() - if err := compressWriter.Close(); err != nil { - return nil, err - } + if copyErr != nil { + return nil, copyErr + } - if copyErr != nil { - return nil, copyErr + if closeErr != nil { + return nil, closeErr + } } - if closeErr != nil { - return nil, closeErr + if err := compressWriter.Close(); err != nil { + return nil, err } // Create a new request since the docs say that we cannot modify the "req" diff --git a/config/confighttp/compression_test.go b/config/confighttp/compression_test.go index 9a477559a2e..38537f2d165 100644 --- a/config/confighttp/compression_test.go +++ b/config/confighttp/compression_test.go @@ -22,6 +22,7 @@ import ( "io/ioutil" "net" "net/http" + "net/http/httptest" "testing" "time" @@ -233,6 +234,29 @@ func TestHTTPContentDecompressionHandler(t *testing.T) { } } +func TestHTTPContentCompressionRequestWithNilBody(t *testing.T) { + compressedGzipBody, _ := compressGzip([]byte{}) + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + body, err := ioutil.ReadAll(r.Body) + require.NoError(t, err, "failed to read request body: %v", err) + assert.EqualValues(t, compressedGzipBody.Bytes(), body) + })) + defer server.Close() + + req, err := http.NewRequest("GET", server.URL, nil) + require.NoError(t, err, "failed to create request to test handler") + + client := http.Client{} + client.Transport = newCompressRoundTripper(http.DefaultTransport, configcompression.Gzip) + res, err := client.Do(req) + require.NoError(t, err) + + _, err = ioutil.ReadAll(res.Body) + require.NoError(t, err) + require.NoError(t, res.Body.Close(), "failed to close request body: %v", err) +} + func compressGzip(body []byte) (*bytes.Buffer, error) { var buf bytes.Buffer diff --git a/examples/k8s/otel-config.yaml b/examples/k8s/otel-config.yaml index 92836475b3e..5fcbf8a3c8f 100644 --- a/examples/k8s/otel-config.yaml +++ b/examples/k8s/otel-config.yaml @@ -66,7 +66,7 @@ spec: - command: - "/otelcol" - "--config=/conf/otel-agent-config.yaml" - image: otel/opentelemetry-collector:0.54.0 + image: otel/opentelemetry-collector:0.55.0 name: otel-agent resources: limits: @@ -177,7 +177,7 @@ spec: - command: - "/otelcol" - "--config=/conf/otel-collector-config.yaml" - image: otel/opentelemetry-collector:0.54.0 + image: otel/opentelemetry-collector:0.55.0 name: otel-collector resources: limits: diff --git a/exporter/loggingexporter/factory.go b/exporter/loggingexporter/factory.go index 87404fd9ce1..4dc64da9d68 100644 --- a/exporter/loggingexporter/factory.go +++ b/exporter/loggingexporter/factory.go @@ -59,7 +59,7 @@ func createTracesExporter(_ context.Context, set component.ExporterCreateSetting return nil, err } - return newTracesExporter(config, exporterLogger, set) + return newTracesExporter(cfg, exporterLogger, set) } func createMetricsExporter(_ context.Context, set component.ExporterCreateSettings, config config.Exporter) (component.MetricsExporter, error) { @@ -70,7 +70,7 @@ func createMetricsExporter(_ context.Context, set component.ExporterCreateSettin return nil, err } - return newMetricsExporter(config, exporterLogger, set) + return newMetricsExporter(cfg, exporterLogger, set) } func createLogsExporter(_ context.Context, set component.ExporterCreateSettings, config config.Exporter) (component.LogsExporter, error) { @@ -81,7 +81,7 @@ func createLogsExporter(_ context.Context, set component.ExporterCreateSettings, return nil, err } - return newLogsExporter(config, exporterLogger, set) + return newLogsExporter(cfg, exporterLogger, set) } func createLogger(cfg *Config) (*zap.Logger, error) { diff --git a/exporter/loggingexporter/logging_exporter.go b/exporter/loggingexporter/logging_exporter.go index 0b066fd19ff..dc57319429a 100644 --- a/exporter/loggingexporter/logging_exporter.go +++ b/exporter/loggingexporter/logging_exporter.go @@ -23,7 +23,6 @@ import ( "go.uber.org/zap/zapcore" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/collector/exporter/loggingexporter/internal/otlptext" @@ -33,6 +32,7 @@ import ( ) type loggingExporter struct { + logLevel zapcore.Level logger *zap.Logger logsMarshaler plog.Marshaler metricsMarshaler pmetric.Marshaler @@ -41,7 +41,7 @@ type loggingExporter struct { func (s *loggingExporter) pushTraces(_ context.Context, td ptrace.Traces) error { s.logger.Info("TracesExporter", zap.Int("#spans", td.SpanCount())) - if !s.logger.Core().Enabled(zapcore.DebugLevel) { + if s.logLevel != zapcore.DebugLevel { return nil } @@ -49,14 +49,14 @@ func (s *loggingExporter) pushTraces(_ context.Context, td ptrace.Traces) error if err != nil { return err } - s.logger.Debug(string(buf)) + s.logger.Info(string(buf)) return nil } func (s *loggingExporter) pushMetrics(_ context.Context, md pmetric.Metrics) error { s.logger.Info("MetricsExporter", zap.Int("#metrics", md.MetricCount())) - if !s.logger.Core().Enabled(zapcore.DebugLevel) { + if s.logLevel != zapcore.DebugLevel { return nil } @@ -64,14 +64,14 @@ func (s *loggingExporter) pushMetrics(_ context.Context, md pmetric.Metrics) err if err != nil { return err } - s.logger.Debug(string(buf)) + s.logger.Info(string(buf)) return nil } func (s *loggingExporter) pushLogs(_ context.Context, ld plog.Logs) error { s.logger.Info("LogsExporter", zap.Int("#logs", ld.LogRecordCount())) - if !s.logger.Core().Enabled(zapcore.DebugLevel) { + if s.logLevel != zapcore.DebugLevel { return nil } @@ -79,12 +79,13 @@ func (s *loggingExporter) pushLogs(_ context.Context, ld plog.Logs) error { if err != nil { return err } - s.logger.Debug(string(buf)) + s.logger.Info(string(buf)) return nil } -func newLoggingExporter(logger *zap.Logger) *loggingExporter { +func newLoggingExporter(logger *zap.Logger, logLevel zapcore.Level) *loggingExporter { return &loggingExporter{ + logLevel: logLevel, logger: logger, logsMarshaler: otlptext.NewTextLogsMarshaler(), metricsMarshaler: otlptext.NewTextMetricsMarshaler(), @@ -94,10 +95,10 @@ func newLoggingExporter(logger *zap.Logger) *loggingExporter { // newTracesExporter creates an exporter.TracesExporter that just drops the // received data and logs debugging messages. -func newTracesExporter(config config.Exporter, logger *zap.Logger, set component.ExporterCreateSettings) (component.TracesExporter, error) { - s := newLoggingExporter(logger) +func newTracesExporter(cfg *Config, logger *zap.Logger, set component.ExporterCreateSettings) (component.TracesExporter, error) { + s := newLoggingExporter(logger, cfg.LogLevel) return exporterhelper.NewTracesExporter( - config, + cfg, set, s.pushTraces, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), @@ -111,10 +112,10 @@ func newTracesExporter(config config.Exporter, logger *zap.Logger, set component // newMetricsExporter creates an exporter.MetricsExporter that just drops the // received data and logs debugging messages. -func newMetricsExporter(config config.Exporter, logger *zap.Logger, set component.ExporterCreateSettings) (component.MetricsExporter, error) { - s := newLoggingExporter(logger) +func newMetricsExporter(cfg *Config, logger *zap.Logger, set component.ExporterCreateSettings) (component.MetricsExporter, error) { + s := newLoggingExporter(logger, cfg.LogLevel) return exporterhelper.NewMetricsExporter( - config, + cfg, set, s.pushMetrics, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), @@ -128,10 +129,10 @@ func newMetricsExporter(config config.Exporter, logger *zap.Logger, set componen // newLogsExporter creates an exporter.LogsExporter that just drops the // received data and logs debugging messages. -func newLogsExporter(config config.Exporter, logger *zap.Logger, set component.ExporterCreateSettings) (component.LogsExporter, error) { - s := newLoggingExporter(logger) +func newLogsExporter(cfg *Config, logger *zap.Logger, set component.ExporterCreateSettings) (component.LogsExporter, error) { + s := newLoggingExporter(logger, cfg.LogLevel) return exporterhelper.NewLogsExporter( - config, + cfg, set, s.pushLogs, exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), diff --git a/exporter/loggingexporter/logging_exporter_test.go b/exporter/loggingexporter/logging_exporter_test.go index 17122ed6877..bac0fdc7ed7 100644 --- a/exporter/loggingexporter/logging_exporter_test.go +++ b/exporter/loggingexporter/logging_exporter_test.go @@ -21,10 +21,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/zap" + "go.uber.org/zap/zapcore" "go.uber.org/zap/zaptest" "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/internal/testdata" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" @@ -32,7 +32,8 @@ import ( ) func TestLoggingTracesExporterNoErrors(t *testing.T) { - lte, err := newTracesExporter(&config.ExporterSettings{}, zap.NewNop(), componenttest.NewNopExporterCreateSettings()) + f := NewFactory() + lte, err := newTracesExporter(f.CreateDefaultConfig().(*Config), zap.NewNop(), componenttest.NewNopExporterCreateSettings()) require.NotNil(t, lte) assert.NoError(t, err) @@ -43,7 +44,8 @@ func TestLoggingTracesExporterNoErrors(t *testing.T) { } func TestLoggingMetricsExporterNoErrors(t *testing.T) { - lme, err := newMetricsExporter(&config.ExporterSettings{}, zap.NewNop(), componenttest.NewNopExporterCreateSettings()) + f := NewFactory() + lme, err := newMetricsExporter(f.CreateDefaultConfig().(*Config), zap.NewNop(), componenttest.NewNopExporterCreateSettings()) require.NotNil(t, lme) assert.NoError(t, err) @@ -57,7 +59,8 @@ func TestLoggingMetricsExporterNoErrors(t *testing.T) { } func TestLoggingLogsExporterNoErrors(t *testing.T) { - lle, err := newLogsExporter(&config.ExporterSettings{}, zap.NewNop(), componenttest.NewNopExporterCreateSettings()) + f := NewFactory() + lle, err := newLogsExporter(f.CreateDefaultConfig().(*Config), zap.NewNop(), componenttest.NewNopExporterCreateSettings()) require.NotNil(t, lle) assert.NoError(t, err) @@ -68,7 +71,7 @@ func TestLoggingLogsExporterNoErrors(t *testing.T) { } func TestLoggingExporterErrors(t *testing.T) { - le := newLoggingExporter(zaptest.NewLogger(t)) + le := newLoggingExporter(zaptest.NewLogger(t), zapcore.DebugLevel) require.NotNil(t, le) errWant := errors.New("my error") diff --git a/go.mod b/go.mod index cea96b3613f..d49da113a2d 100644 --- a/go.mod +++ b/go.mod @@ -8,34 +8,34 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/golang/snappy v0.0.4 github.com/google/uuid v1.3.0 - github.com/klauspost/compress v1.15.6 + github.com/klauspost/compress v1.15.7 github.com/knadh/koanf v1.4.2 github.com/magiconair/properties v1.8.6 github.com/mitchellh/mapstructure v1.5.0 github.com/mostynb/go-grpc-compression v1.1.16 github.com/prometheus/common v0.35.0 github.com/rs/cors v1.8.2 - github.com/shirou/gopsutil/v3 v3.22.5 + github.com/shirou/gopsutil/v3 v3.22.6 github.com/spf13/cast v1.5.0 github.com/spf13/cobra v1.5.0 - github.com/stretchr/testify v1.7.5 + github.com/stretchr/testify v1.8.0 go.opencensus.io v0.23.0 go.opentelemetry.io/collector/pdata v0.54.0 go.opentelemetry.io/collector/semconv v0.54.0 - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 - go.opentelemetry.io/contrib/zpages v0.32.0 - go.opentelemetry.io/otel v1.7.0 - go.opentelemetry.io/otel/exporters/prometheus v0.30.0 - go.opentelemetry.io/otel/metric v0.30.0 - go.opentelemetry.io/otel/sdk v1.7.0 - go.opentelemetry.io/otel/sdk/metric v0.30.0 - go.opentelemetry.io/otel/trace v1.7.0 + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 + go.opentelemetry.io/contrib/zpages v0.33.0 + go.opentelemetry.io/otel v1.8.0 + go.opentelemetry.io/otel/exporters/prometheus v0.31.0 + go.opentelemetry.io/otel/metric v0.31.0 + go.opentelemetry.io/otel/sdk v1.8.0 + go.opentelemetry.io/otel/sdk/metric v0.31.0 + go.opentelemetry.io/otel/trace v1.8.0 go.uber.org/atomic v1.9.0 go.uber.org/multierr v1.8.0 go.uber.org/zap v1.21.0 golang.org/x/net v0.0.0-20220225172249-27dd8689420f - golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa google.golang.org/grpc v1.47.0 google.golang.org/protobuf v1.28.0 @@ -47,7 +47,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect github.com/go-kit/log v0.2.0 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-logr/logr v1.2.3 // indirect @@ -65,7 +65,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // 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.12.1 // indirect + github.com/prometheus/client_golang v1.12.2 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/prometheus/statsd_exporter v0.21.0 // indirect diff --git a/go.sum b/go.sum index 55736680863..37f9bddc8c0 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,8 @@ github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +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/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= @@ -179,7 +179,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -242,8 +241,8 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 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.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.6 h1:6D9PcO8QWu0JyaQ2zUMmu16T1T+zjjEpP91guRsvDfY= -github.com/klauspost/compress v1.15.6/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.7 h1:7cgTQxJCU/vy+oP/E3B9RGbQTgbiVzIJWIKOLoAsPok= +github.com/klauspost/compress v1.15.7/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/knadh/koanf v1.4.2 h1:2itp+cdC6miId4pO4Jw7c/3eiYD26Z/Sz3ATJMwHxIs= github.com/knadh/koanf v1.4.2/go.mod h1:4NCo0q4pmU398vF9vq2jStF9MWQZ8JEDcDMHlDCr4h0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -316,8 +315,9 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -349,8 +349,8 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/schollz/progressbar/v2 v2.13.2/go.mod h1:6YZjqdthH6SCZKv2rqGryrxPtfmRB/DWZxSMfCXPyD8= -github.com/shirou/gopsutil/v3 v3.22.5 h1:atX36I/IXgFiB81687vSiBI5zrMsxcIBkP9cQMJQoJA= -github.com/shirou/gopsutil/v3 v3.22.5/go.mod h1:so9G9VzeHt/hsd0YwqprnjHnfARAUktauykSbr+y2gA= +github.com/shirou/gopsutil/v3 v3.22.6 h1:FnHOFOh+cYAM0C30P+zysPISzlknLC5Z1G4EAElznfQ= +github.com/shirou/gopsutil/v3 v3.22.6/go.mod h1:EdIubSnZhbAvBS1yJ7Xi+AShB/hxwLHOMz4MCYz7yMs= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= @@ -371,8 +371,9 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= @@ -391,24 +392,24 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 h1:WenoaOMNP71oq3KkMZ/jnxI9xU/JSCLw8yZILSI2lfU= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0/go.mod h1:J0dBVrt7dPS/lKJyQoW0xzQiUr4r2Ik1VwPjAUWnofI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 h1:mac9BKRqwaX6zxHPDe3pvmWpwuuIM0vuXv2juCnQevE= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0/go.mod h1:5eCOqeGphOyz6TsY3ZDNjE33SM/TFAK3RGuCL2naTgY= -go.opentelemetry.io/contrib/zpages v0.32.0 h1:AVKTx5ppWDaem7A61HFsO1T3CK/t6kFRQoZQMj0/TW4= -go.opentelemetry.io/contrib/zpages v0.32.0/go.mod h1:Jx75I61RDcZU3d/1WrP6UdINlzGGLAwFNdQ3bCTb+qw= -go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM= -go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= -go.opentelemetry.io/otel/exporters/prometheus v0.30.0 h1:YXo5ZY5nofaEYMCMTTMaRH2cLDZB8+0UGuk5RwMfIo0= -go.opentelemetry.io/otel/exporters/prometheus v0.30.0/go.mod h1:qN5feW+0/d661KDtJuATEmHtw5bKBK7NSvNEP927zSs= -go.opentelemetry.io/otel/metric v0.30.0 h1:Hs8eQZ8aQgs0U49diZoaS6Uaxw3+bBE3lcMUKBFIk3c= -go.opentelemetry.io/otel/metric v0.30.0/go.mod h1:/ShZ7+TS4dHzDFmfi1kSXMhMVubNoP0oIaBp70J6UXU= -go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= -go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= -go.opentelemetry.io/otel/sdk/metric v0.30.0 h1:XTqQ4y3erR2Oj8xSAOL5ovO5011ch2ELg51z4fVkpME= -go.opentelemetry.io/otel/sdk/metric v0.30.0/go.mod h1:8AKFRi5HyvTR0RRty3paN1aMC9HMT+NzcEhw/BLkLX8= -go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= -go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 h1:z6rnla1Asjzn0FrhohzIbDi4bxbtc6EMmQ7f5ZPn+pA= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M= +go.opentelemetry.io/contrib/zpages v0.33.0 h1:0JATTp4rT56Mrfrq1icN9GqrI+1uFjq2NwJJRl8m3fk= +go.opentelemetry.io/contrib/zpages v0.33.0/go.mod h1:ddmD63NkBVE29GucaBBCR8/b/TRlY+PkpIbF3m2JF7Y= +go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg= +go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= +go.opentelemetry.io/otel/exporters/prometheus v0.31.0 h1:jwtnOGBM8dIty5AVZ+9ZCzZexCea3aVKmUfZAQcHqxs= +go.opentelemetry.io/otel/exporters/prometheus v0.31.0/go.mod h1:QarXIB8L79IwIPoNgG3A6zNvBgVmcppeFogV1d8612s= +go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= +go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= +go.opentelemetry.io/otel/sdk v1.8.0 h1:xwu69/fNuwbSHWe/0PGS888RmjWY181OmcXDQKu7ZQk= +go.opentelemetry.io/otel/sdk v1.8.0/go.mod h1:uPSfc+yfDH2StDM/Rm35WE8gXSNdvCg023J6HeGNO0c= +go.opentelemetry.io/otel/sdk/metric v0.31.0 h1:2sZx4R43ZMhJdteKAlKoHvRgrMp53V1aRxvEf5lCq8Q= +go.opentelemetry.io/otel/sdk/metric v0.31.0/go.mod h1:fl0SmNnX9mN9xgU6OLYLMBMrNAsaZQi7qBwprwO3abk= +go.opentelemetry.io/otel/trace v1.8.0 h1:cSy0DF9eGI5WIfNwZ1q2iUyGj00tGzP24dE1lOlHrfY= +go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= @@ -556,14 +557,14 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -701,7 +702,6 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/pdata/go.mod b/pdata/go.mod index 942584c864a..ad534a06b70 100644 --- a/pdata/go.mod +++ b/pdata/go.mod @@ -5,7 +5,7 @@ go 1.17 require ( github.com/gogo/protobuf v1.3.2 github.com/json-iterator/go v1.1.12 - github.com/stretchr/testify v1.7.5 + github.com/stretchr/testify v1.8.0 google.golang.org/grpc v1.47.0 google.golang.org/protobuf v1.28.0 ) diff --git a/pdata/go.sum b/pdata/go.sum index b8fab75b2ca..075aa6be5c4 100644 --- a/pdata/go.sum +++ b/pdata/go.sum @@ -68,8 +68,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= -github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= diff --git a/semconv/go.mod b/semconv/go.mod index fda58d750a9..fff34dec0f7 100644 --- a/semconv/go.mod +++ b/semconv/go.mod @@ -2,7 +2,7 @@ module go.opentelemetry.io/collector/semconv go 1.17 -require github.com/stretchr/testify v1.7.5 +require github.com/stretchr/testify v1.8.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/semconv/go.sum b/semconv/go.sum index f59e5c0a21b..51648299d59 100644 --- a/semconv/go.sum +++ b/semconv/go.sum @@ -6,8 +6,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN 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/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= -github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/service/collector_test.go b/service/collector_test.go index 8c7fb0a990e..c830e7666b4 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -347,6 +347,40 @@ func TestCollectorStartWithOpenTelemetryMetrics(t *testing.T) { } } +func TestCollectorRun(t *testing.T) { + tests := []struct { + file string + }{ + {file: "otelcol-nometrics.yaml"}, + {file: "otelcol-noaddress.yaml"}, + } + + for _, tt := range tests { + t.Run(tt.file, func(t *testing.T) { + factories, err := componenttest.NopFactories() + require.NoError(t, err) + + cfgProvider, err := NewConfigProvider(newDefaultConfigProviderSettings([]string{filepath.Join("testdata", tt.file)})) + require.NoError(t, err) + + set := CollectorSettings{ + BuildInfo: component.NewDefaultBuildInfo(), + Factories: factories, + ConfigProvider: cfgProvider, + telemetry: newColTelemetry(featuregate.NewRegistry()), + } + col, err := New(set) + require.NoError(t, err) + + wg := startCollector(context.Background(), t, col) + + col.Shutdown() + wg.Wait() + assert.Equal(t, Closed, col.GetState()) + }) + } +} + func TestCollectorShutdownBeforeRun(t *testing.T) { factories, err := componenttest.NopFactories() require.NoError(t, err) diff --git a/service/featuregate/flags.go b/service/featuregate/flags.go index 2e7389fea89..6d4b9fa48d6 100644 --- a/service/featuregate/flags.go +++ b/service/featuregate/flags.go @@ -44,6 +44,10 @@ func (f FlagValue) String() string { // Set applies the FlagValue encoded in the input string func (f FlagValue) Set(s string) error { + if s == "" { + return nil + } + return f.setSlice(strings.Split(s, ",")) } diff --git a/service/featuregate/flags_test.go b/service/featuregate/flags_test.go index dd723bdd07d..0f24f2d3ce6 100644 --- a/service/featuregate/flags_test.go +++ b/service/featuregate/flags_test.go @@ -27,6 +27,11 @@ func TestFlagValue_basic(t *testing.T) { output FlagValue skipString bool }{ + { + name: "empty item", + input: "", + output: FlagValue{}, + }, { name: "single item", input: "foo", diff --git a/service/featuregate/gates.go b/service/featuregate/gates.go index 3cde777de5b..751c45b4e04 100644 --- a/service/featuregate/gates.go +++ b/service/featuregate/gates.go @@ -46,6 +46,7 @@ type Registry struct { // Apply a configuration in the form of a map of Gate identifiers to boolean values. // Sets only those values provided in the map, other gate values are not changed. +// Deprecated: [v0.56.0] Use MustApply instead. func (r *Registry) Apply(cfg map[string]bool) { r.mu.Lock() defer r.mu.Unlock() @@ -57,6 +58,21 @@ func (r *Registry) Apply(cfg map[string]bool) { } } +// MustApply a configuration in the form of a map of Gate identifiers to boolean values. +// Sets only those values provided in the map, other gate values are not changed. +func (r *Registry) MustApply(cfg map[string]bool) { + r.mu.Lock() + defer r.mu.Unlock() + for id, val := range cfg { + if g, ok := r.gates[id]; ok { + g.Enabled = val + r.gates[g.ID] = g + } else { + panic(fmt.Sprintf("feature gate %s is unregistered", id)) + } + } +} + // IsEnabled returns true if a registered feature gate is enabled and false otherwise. func (r *Registry) IsEnabled(id string) bool { r.mu.RLock() diff --git a/service/featuregate/gates_test.go b/service/featuregate/gates_test.go index 6a447151ec8..1fa2e576ade 100644 --- a/service/featuregate/gates_test.go +++ b/service/featuregate/gates_test.go @@ -44,3 +44,47 @@ func TestRegistry(t *testing.T) { r.MustRegister(gate) }) } + +func TestRegistryWithMustApply(t *testing.T) { + r := Registry{gates: map[string]Gate{}} + gate := Gate{ + ID: "foo", + Description: "Test Gate", + Enabled: true, + } + assert.NoError(t, r.Register(gate)) + + tests := []struct { + name string + gate string + enabled bool + shouldError bool + }{ + { + name: "existing_gate", + gate: "foo", + enabled: false, + shouldError: false, + }, + { + name: "none_existing_gate", + gate: "bar", + enabled: false, + shouldError: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if tt.shouldError { + assert.Panics(t, func() { + r.MustApply(map[string]bool{tt.gate: tt.enabled}) + }) + } else { + r.MustApply(map[string]bool{tt.gate: tt.enabled}) + assert.Equal(t, tt.enabled, r.IsEnabled(tt.gate)) + } + + }) + } +} diff --git a/service/internal/components/components.go b/service/internal/components/components.go new file mode 100644 index 00000000000..410fffb37db --- /dev/null +++ b/service/internal/components/components.go @@ -0,0 +1,32 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package components // import "go.opentelemetry.io/collector/service/internal/components" + +import ( + "go.uber.org/zap" + + "go.opentelemetry.io/collector/component" +) + +// LogStabilityLevel logs the stability level of a component. The log level is set to info for +// undefined, unmaintained, deprecated and in development. The log level is set to debug +// for alpha, beta and stable. +func LogStabilityLevel(logger *zap.Logger, sl component.StabilityLevel) { + if sl >= component.StabilityLevelAlpha { + logger.Debug(sl.LogMessage(), zap.String(ZapStabilityKey, sl.String())) + } else { + logger.Info(sl.LogMessage(), zap.String(ZapStabilityKey, sl.String())) + } +} diff --git a/service/internal/components/components_test.go b/service/internal/components/components_test.go new file mode 100644 index 00000000000..221092da805 --- /dev/null +++ b/service/internal/components/components_test.go @@ -0,0 +1,56 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package components // import "go.opentelemetry.io/collector/service/internal/components" + +import ( + "testing" + + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + "go.uber.org/zap/zaptest/observer" + + "go.opentelemetry.io/collector/component" +) + +func TestLogStabilityLevel(t *testing.T) { + tests := []struct { + level zapcore.Level + expectedLogs int + }{ + { + level: zapcore.DebugLevel, + expectedLogs: 7, + }, + { + level: zapcore.InfoLevel, + expectedLogs: 4, + }, + } + + for _, tt := range tests { + observed, logs := observer.New(tt.level) + logger := zap.New(observed) + // ensure log levels are set correctly for each stability level + LogStabilityLevel(logger, component.StabilityLevelUndefined) + LogStabilityLevel(logger, component.StabilityLevelUnmaintained) + LogStabilityLevel(logger, component.StabilityLevelDeprecated) + LogStabilityLevel(logger, component.StabilityLevelInDevelopment) + LogStabilityLevel(logger, component.StabilityLevelAlpha) + LogStabilityLevel(logger, component.StabilityLevelBeta) + LogStabilityLevel(logger, component.StabilityLevelStable) + require.Equal(t, tt.expectedLogs, logs.Len()) + } +} diff --git a/service/internal/pipelines/pipelines.go b/service/internal/pipelines/pipelines.go index 553c10776b4..098b511ce54 100644 --- a/service/internal/pipelines/pipelines.go +++ b/service/internal/pipelines/pipelines.go @@ -331,21 +331,6 @@ func Build(ctx context.Context, set Settings) (*Pipelines, error) { return exps, nil } -func logStabilityMessage(logger *zap.Logger, sl component.StabilityLevel) { - switch sl { - case component.StabilityLevelDeprecated: - logger.Info("Component has been deprecated and will be removed in future releases.", zap.String(components.ZapStabilityKey, sl.String())) - case component.StabilityLevelUnmaintained: - logger.Info("Component is unmaintained and actively looking for contributors. This component will become deprecated after 6 months of remaining unmaintained", zap.String(components.ZapStabilityKey, sl.String())) - case component.StabilityLevelInDevelopment: - logger.Info("Component is under development.", zap.String(components.ZapStabilityKey, sl.String())) - case component.StabilityLevelAlpha, component.StabilityLevelBeta, component.StabilityLevelStable: - logger.Debug("Stability level", zap.String(components.ZapStabilityKey, sl.String())) - default: - logger.Info("Stability level of component undefined", zap.String(components.ZapStabilityKey, sl.String())) - } -} - func buildExporter( ctx context.Context, settings component.TelemetrySettings, @@ -370,7 +355,7 @@ func buildExporter( BuildInfo: buildInfo, } set.TelemetrySettings.Logger = exporterLogger(settings.Logger, id, pipelineID.Type()) - logStabilityMessage(set.TelemetrySettings.Logger, factory.StabilityLevel(pipelineID.Type())) + components.LogStabilityLevel(set.TelemetrySettings.Logger, factory.StabilityLevel(pipelineID.Type())) exp, err := createExporter(ctx, set, cfg, id, pipelineID, factory) if err != nil { @@ -452,7 +437,7 @@ func buildProcessor(ctx context.Context, BuildInfo: buildInfo, } set.TelemetrySettings.Logger = processorLogger(settings.Logger, id, pipelineID) - logStabilityMessage(set.TelemetrySettings.Logger, factory.StabilityLevel(pipelineID.Type())) + components.LogStabilityLevel(set.TelemetrySettings.Logger, factory.StabilityLevel(pipelineID.Type())) proc, err := createProcessor(ctx, set, procCfg, id, pipelineID, next, factory) if err != nil { @@ -506,7 +491,7 @@ func buildReceiver(ctx context.Context, BuildInfo: buildInfo, } set.TelemetrySettings.Logger = receiverLogger(settings.Logger, id, pipelineID.Type()) - logStabilityMessage(set.TelemetrySettings.Logger, factory.StabilityLevel(pipelineID.Type())) + components.LogStabilityLevel(set.TelemetrySettings.Logger, factory.StabilityLevel(pipelineID.Type())) recv, err := createReceiver(ctx, set, cfg, id, pipelineID, nexts, factory) if err != nil { diff --git a/service/internal/pipelines/pipelines_test.go b/service/internal/pipelines/pipelines_test.go index c1e149f3b6c..38d8b5cc68f 100644 --- a/service/internal/pipelines/pipelines_test.go +++ b/service/internal/pipelines/pipelines_test.go @@ -22,9 +22,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - "go.uber.org/zap/zaptest/observer" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" @@ -348,36 +345,6 @@ func TestFailToStartAndShutdown(t *testing.T) { } } -func TestLogStabilityLevle(t *testing.T) { - tests := []struct { - level zapcore.Level - expectedLogs int - }{ - { - level: zapcore.DebugLevel, - expectedLogs: 7, - }, - { - level: zapcore.InfoLevel, - expectedLogs: 4, - }, - } - - for _, tt := range tests { - observed, logs := observer.New(tt.level) - logger := zap.New(observed) - // ensure log levels are set correctly for each stability level - logStabilityMessage(logger, component.StabilityLevelUndefined) - logStabilityMessage(logger, component.StabilityLevelUnmaintained) - logStabilityMessage(logger, component.StabilityLevelDeprecated) - logStabilityMessage(logger, component.StabilityLevelInDevelopment) - logStabilityMessage(logger, component.StabilityLevelAlpha) - logStabilityMessage(logger, component.StabilityLevelBeta) - logStabilityMessage(logger, component.StabilityLevelStable) - require.Equal(t, tt.expectedLogs, logs.Len()) - } -} - func newBadReceiverFactory() component.ReceiverFactory { return component.NewReceiverFactory("bf", func() config.Receiver { return &struct { diff --git a/service/service.go b/service/service.go index 602e7c8aaa7..1afa0694d15 100644 --- a/service/service.go +++ b/service/service.go @@ -18,12 +18,13 @@ import ( "context" "fmt" - "go.opentelemetry.io/otel/metric/nonrecording" + "go.opentelemetry.io/otel/metric" sdktrace "go.opentelemetry.io/otel/sdk/trace" "go.uber.org/multierr" "go.uber.org/zap" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/service/internal" "go.opentelemetry.io/collector/service/internal/extensions" "go.opentelemetry.io/collector/service/internal/pipelines" @@ -50,7 +51,7 @@ func newService(set *settings) (*service, error) { // needed for supporting the zpages extension sdktrace.WithSampler(internal.AlwaysRecord()), ), - MeterProvider: nonrecording.NewNoopMeterProvider(), + MeterProvider: metric.NewNoopMeterProvider(), MetricsLevel: set.Config.Telemetry.Metrics.Level, }, host: &serviceHost{ @@ -97,9 +98,11 @@ func newService(set *settings) (*service, error) { return nil, fmt.Errorf("cannot build pipelines: %w", err) } - // The process telemetry initialization requires the ballast size, which is available after the extensions are initialized. - if err = telemetry.RegisterProcessMetrics(srv.telemetryInitializer.ocRegistry, getBallastSize(srv.host)); err != nil { - return nil, fmt.Errorf("failed to register process metrics: %w", err) + if set.Config.Telemetry.Metrics.Level != configtelemetry.LevelNone && set.Config.Telemetry.Metrics.Address != "" { + // The process telemetry initialization requires the ballast size, which is available after the extensions are initialized. + if err = telemetry.RegisterProcessMetrics(srv.telemetryInitializer.ocRegistry, getBallastSize(srv.host)); err != nil { + return nil, fmt.Errorf("failed to register process metrics: %w", err) + } } return srv, nil diff --git a/service/telemetry.go b/service/telemetry.go index a25199d609f..7379964b1fa 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -28,7 +28,6 @@ import ( "go.opencensus.io/stats/view" otelprometheus "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/metric/nonrecording" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" "go.opentelemetry.io/otel/sdk/metric/export/aggregation" @@ -76,7 +75,7 @@ func newColTelemetry(registry *featuregate.Registry) *telemetryInitializer { }) return &telemetryInitializer{ registry: registry, - mp: nonrecording.NewNoopMeterProvider(), + mp: metric.NewNoopMeterProvider(), } } diff --git a/service/testdata/otelcol-noaddress.yaml b/service/testdata/otelcol-noaddress.yaml new file mode 100644 index 00000000000..c363f848e53 --- /dev/null +++ b/service/testdata/otelcol-noaddress.yaml @@ -0,0 +1,14 @@ +receivers: + nop: + +exporters: + nop: + +service: + telemetry: + metrics: + address: "" + pipelines: + metrics: + receivers: [nop] + exporters: [nop] diff --git a/service/testdata/otelcol-nometrics.yaml b/service/testdata/otelcol-nometrics.yaml new file mode 100644 index 00000000000..a35cf1fbbff --- /dev/null +++ b/service/testdata/otelcol-nometrics.yaml @@ -0,0 +1,14 @@ +receivers: + nop: + +exporters: + nop: + +service: + telemetry: + metrics: + level: none + pipelines: + metrics: + receivers: [nop] + exporters: [nop] diff --git a/versions.yaml b/versions.yaml index e640d56ea44..38aefcffc91 100644 --- a/versions.yaml +++ b/versions.yaml @@ -14,7 +14,7 @@ module-sets: collector-core: - version: v0.54.0 + version: v0.55.0 modules: - go.opentelemetry.io/collector - go.opentelemetry.io/collector/cmd/builder