From 551cfce3d8ceba4fb97047924b56dc8e849cb60b Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Thu, 14 Sep 2023 23:11:14 -0700 Subject: [PATCH 01/55] update filelog to latest snapshot to fix regression with default flush period (#3640) * update filelog to latest snapshot to fix regression with default flush period * adopt API change from snapshot --- go.mod | 6 +++--- go.sum | 12 ++++++------ internal/receiver/scriptedinputsreceiver/config.go | 2 +- tests/receivers/filelog/testdata/syslog | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 972985fb54..902455c56a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/alecthomas/participle/v2 v2.1.0 - github.com/antonmedv/expr v1.15.1 + github.com/antonmedv/expr v1.15.2 github.com/apache/pulsar-client-go v0.11.0 github.com/cenkalti/backoff/v4 v4.2.1 github.com/fsnotify/fsnotify v1.6.0 @@ -34,7 +34,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.85.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.85.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.85.1-0.20230914192633-636cd78c3909 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.85.0 @@ -54,7 +54,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/cloudfoundryreceiver v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver v0.85.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.85.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.85.1-0.20230914192633-636cd78c3909 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.85.0 diff --git a/go.sum b/go.sum index 33323bfc9b..69ea3de3f8 100644 --- a/go.sum +++ b/go.sum @@ -175,8 +175,8 @@ github.com/aliyun/alibaba-cloud-sdk-go v1.62.301 h1:8mgvCpqsv3mQAcqZ/baAaMGUBj5J github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antonmedv/expr v1.15.1 h1:mxeRIkH8GQJo4MRRFgp0ArlV4AA+0DmcJNXEsG70rGU= -github.com/antonmedv/expr v1.15.1/go.mod h1:0E/6TxnOlRNp81GMzX9QfDPAmHo2Phg00y4JUv1ihsE= +github.com/antonmedv/expr v1.15.2 h1:afFXpDWIC2n3bF+kTZE1JvFo+c34uaM3sTqh8z0xfdU= +github.com/antonmedv/expr v1.15.2/go.mod h1:0E/6TxnOlRNp81GMzX9QfDPAmHo2Phg00y4JUv1ihsE= github.com/apache/arrow/go/v12 v12.0.1 h1:JsR2+hzYYjgSUkBSaahpqCetqZMr76djX80fF/DiJbg= github.com/apache/arrow/go/v12 v12.0.1/go.mod h1:weuTY7JvTG/HDPtMQxEUp7pU73vkLWMLpY67QwZ/WWw= github.com/apache/pulsar-client-go v0.11.0 h1:fniyVbewAOcMSMLwxzhdrCFmFTorCW40jfnmQVcsrJw= @@ -1185,8 +1185,8 @@ github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.85.0/ github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.85.0 h1:spVx9VQV8KV6EsvyeBjoz7lfZxApg0InR8Ju6j3Yyk0= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.85.0/go.mod h1:h5h6CZwte3hBoitlWffAO2OHtc38jBRdr1UAS9hyXFs= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.85.0 h1:HxYC9D6ghO9qjUbuNscASG6D2ONTmf3izq3Pb8Kb7/s= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.85.0 h1:Y/J4GknLNfn1u2I1Ncys42uuBVYSGkbmsFynZlCd4k0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.85.0/go.mod h1:Ngii/WWPVHwJKVFvGnmp35Tm8/5kI3OQ6FxWv3zVLC4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.85.1-0.20230914192633-636cd78c3909 h1:F2kDKJa+7+8BC/tlJRR1q1EKlOq5fgn/7o8jlEhTD0s= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.85.1-0.20230914192633-636cd78c3909/go.mod h1:EYLs6dtnqmHxLpjz/T/ik+CvcF8MhsGZ4y9OA5Ms6bc= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.85.0 h1:QKGCvj0d39TS9UqgATvxZw7Uv1T7K3ltQDZCqvuIA70= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.85.0/go.mod h1:KY3tDk0Qw1ljMm0ZURFirGzK0CDQ2FdcO2bAUbO4Ces= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.85.0 h1:xM+OELzJqaDJrYt+GoDdVgjruJVPL4jtaaUxM3CNvM8= @@ -1234,8 +1234,8 @@ github.com/open-telemetry/opentelemetry-collector-contrib/receiver/cloudfoundryr github.com/open-telemetry/opentelemetry-collector-contrib/receiver/cloudfoundryreceiver v0.85.0/go.mod h1:KyFheIY+UVPE5mPi1uV6CHvReIpDP/r+HbKyz/Nnw9s= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver v0.85.0 h1:NPXaK+Sau5bgAKrFYso/gy+BnZVNFIUl4YERFmNd9nM= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver v0.85.0/go.mod h1:8zWYGfcFXX8crwY5w8aVlzsxNnWF37Z4AvVvJCAc/GY= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.85.0 h1:1IX7pCdRNaQD0akmvi3rz1JU8BXwytgUE9e4a2z7vao= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.85.0/go.mod h1:UyvwxidXlU4YaVeEFMIZHege+0BWzHCdkiuyYWzoJYI= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.85.1-0.20230914192633-636cd78c3909 h1:oePV0eGwUSfHui9ZcvKTk5DFYwYfnuZCdBzUHKrdvg8= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.85.1-0.20230914192633-636cd78c3909/go.mod h1:5pzTyB2Ag2zhYF5yFMuEPDSJ0AoMdrNULWp1ZNMMTQw= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.85.0 h1:HASNtwfyXe/d7PX+WHOAIK2CgfLcxv7f7Icn20KOM98= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.85.0/go.mod h1:vVncCfYLK/J9RKJ9AfKyaRIPGR/XS6HjGBz52fObfZY= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.85.0 h1:18q+cnYgHm3J0tR99YOv6pX/uszMqzBtnA1s3liPJMY= diff --git a/internal/receiver/scriptedinputsreceiver/config.go b/internal/receiver/scriptedinputsreceiver/config.go index 2c72aeee33..527d7fc277 100644 --- a/internal/receiver/scriptedinputsreceiver/config.go +++ b/internal/receiver/scriptedinputsreceiver/config.go @@ -111,7 +111,7 @@ func (c *Config) Build(logger *zap.SugaredLogger) (operator.Operator, error) { if c.Multiline.LineStartPattern == "" && c.Multiline.LineEndPattern == "" { splitFunc = split.NoSplitFunc(int(c.MaxLogSize)) } else { - splitFunc, err = c.Multiline.Func(enc, true, int(c.MaxLogSize), nil) + splitFunc, err = c.Multiline.Func(enc, true, int(c.MaxLogSize)) if err != nil { return nil, err } diff --git a/tests/receivers/filelog/testdata/syslog b/tests/receivers/filelog/testdata/syslog index 0869537162..6c49800c60 100644 --- a/tests/receivers/filelog/testdata/syslog +++ b/tests/receivers/filelog/testdata/syslog @@ -5,4 +5,4 @@ <4>Oct 6 14:45:33 debian kernel: [17099.344322] device veth4f642f0 left promiscuous mode <5>Oct 6 14:45:33 debian kernel: [17099.344328] docker0: port 1(veth4f642f0) entered disabled state <6>Oct 6 14:45:33 debian avahi-daemon[564]: Withdrawing address record for aa::bb:cc:dd:ee on veth4f642f0. -<7>Oct 6 14:45:33 debian NetworkManager[567]: [1665081933.1506] device (veth4f642f0): released from master device docker0 +<7>Oct 6 14:45:33 debian NetworkManager[567]: [1665081933.1506] device (veth4f642f0): released from master device docker0 \ No newline at end of file From d8ac9b96b769371047bea39c81c22e089691c439 Mon Sep 17 00:00:00 2001 From: Jeff Cheng <83052155+jeffreyc-splunk@users.noreply.github.com> Date: Fri, 15 Sep 2023 14:48:35 -0400 Subject: [PATCH 02/55] Update sample conf file for collector systemd service (#3644) --- .../splunk-otel-collector.conf.example | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/internal/buildscripts/packaging/fpm/etc/otel/collector/splunk-otel-collector.conf.example b/internal/buildscripts/packaging/fpm/etc/otel/collector/splunk-otel-collector.conf.example index 3ebb60a2a6..fa393d2221 100644 --- a/internal/buildscripts/packaging/fpm/etc/otel/collector/splunk-otel-collector.conf.example +++ b/internal/buildscripts/packaging/fpm/etc/otel/collector/splunk-otel-collector.conf.example @@ -1,18 +1,28 @@ -# Sample environment file for passing variables to the splunk-otel-collector service. -# See /etc/otel/collector/agent_config.yaml for how these variables will be consumed. +# Sample systemd environment file for passing environment variables to the splunk-otel-collector service and the +# collector configuration file. -# To use this file, update the values below appropriately, -# and save the changes to "/etc/otel/collector/splunk-otel-collector.conf". +# See https://www.freedesktop.org/software/systemd/man/systemd.exec.html#EnvironmentFile= for general information about +# systemd environment files, supported syntax, and limitations. -# Then run the following commands to apply the changes and restart the service: -# sudo systemctl restart splunk-otel-collector.service +# To use this file: +# 1. Add/Update the environment variables below. +# 2. Save/Rename this file as "/etc/otel/collector/splunk-otel-collector.conf". +# 3. Run the following command to restart the service and apply the changes: +# sudo systemctl restart splunk-otel-collector.service -# Command-line options for the splunk-otel-collector service. Run `/usr/bin/otelcol --help` to see all available options. + +# Command-line options for the splunk-otel-collector service. +# Run `/usr/bin/otelcol --help` to see all available options. OTELCOL_OPTIONS="" + # Path to the config file for the collector. +# Required, unless the OTELCOL_OPTIONS environment variable above includes the '--config ' option. SPLUNK_CONFIG=/etc/otel/collector/agent_config.yaml + +# The following environment variables are referenced in the default /etc/otel/collector/agent_config.yaml config file. + # Access token to authenticate requests. SPLUNK_ACCESS_TOKEN=12345 @@ -49,3 +59,6 @@ SPLUNK_BUNDLE_DIR=/usr/lib/splunk-otel-collector/agent-bundle # The path to the collectd config directory for the Smart Agent. # This directory must be read/writable by the collector process. SPLUNK_COLLECTD_DIR=/usr/lib/splunk-otel-collector/agent-bundle/run/collectd + +# Network interface the collector receivers listen on. +SPLUNK_LISTEN_INTERFACE=127.0.0.1 From d7e935dcc56c50cfc824733e2148d50b3a72478d Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Fri, 15 Sep 2023 13:46:41 -0700 Subject: [PATCH 03/55] Add warnings regarding the change of default value from 0.0.0.0 to 127.0.0.1 in installers (#3642) * Add warnings regarding the change of default value from 0.0.0.0 to 127.0.0.1 in installers * move notices to the end of the installers --- internal/buildscripts/packaging/installer/install.ps1 | 4 ++++ internal/buildscripts/packaging/installer/install.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/internal/buildscripts/packaging/installer/install.ps1 b/internal/buildscripts/packaging/installer/install.ps1 index 379f432f9f..e14cdc58aa 100644 --- a/internal/buildscripts/packaging/installer/install.ps1 +++ b/internal/buildscripts/packaging/installer/install.ps1 @@ -693,3 +693,7 @@ if ($with_fluentd) { start_service -name "$fluentd_service_name" -config_path "$fluentd_config_path" echo "- Started" } + +if ($network_interface -Eq "0.0.0.0") { + echo "[NOTICE] Starting with version 0.86.0, the collector installer will change its default network listening interface from 0.0.0.0 to 127.0.0.1. Please consult the release notes for more information and configuration options." +} \ No newline at end of file diff --git a/internal/buildscripts/packaging/installer/install.sh b/internal/buildscripts/packaging/installer/install.sh index a6282d2f69..599d572a65 100755 --- a/internal/buildscripts/packaging/installer/install.sh +++ b/internal/buildscripts/packaging/installer/install.sh @@ -1305,6 +1305,10 @@ WARNING: Fluentd was not installed since it is currently not supported for ${dis EOH fi + if [ "$listen_interface" = "0.0.0.0" ]; then + echo "[NOTICE] Starting with version 0.86.0, the collector installer will change its default network listening interface from 0.0.0.0 to 127.0.0.1. Please consult the release notes for more information and configuration options." + fi + exit 0 } From 20270b317a9e47fce67223bef1100299172f0b18 Mon Sep 17 00:00:00 2001 From: srv-gh-o11y-gdi <98980563+srv-gh-o11y-gdi@users.noreply.github.com> Date: Fri, 15 Sep 2023 17:29:46 -0400 Subject: [PATCH 04/55] Update splunk-otel-javaagent to latest (#3647) --- instrumentation/packaging/java-agent-release.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/packaging/java-agent-release.txt b/instrumentation/packaging/java-agent-release.txt index df407721ef..c70e541091 100644 --- a/instrumentation/packaging/java-agent-release.txt +++ b/instrumentation/packaging/java-agent-release.txt @@ -1 +1 @@ -v1.27.0 +v1.28.0 From c5113bd07e112dbb8aeb0363dfc6bf43073b620c Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Fri, 15 Sep 2023 14:36:06 -0700 Subject: [PATCH 05/55] Add changelog for 0.85.0 (#3645) --- CHANGELOG.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b94e8c11af..6e89c4c66d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,50 @@ ## Unreleased +## v0.85.0 + +***ADVANCED NOTICE - SPLUNK_LISTEN_INTERFACE DEFAULTS*** + +Starting with version 0.86.0 (next release), the collector installer will change the default value of the network listening interface option from `0.0.0.0` to `127.0.0.1`. + +### 🛑 Breaking changes 🛑 + +- (Contrib) `k8sclusterreceiver`: Remove deprecated Kubernetes API resources ([#23612](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23612), [#26551](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/26551)) +Drop support of `HorizontalPodAutoscaler` `v2beta2` version and `CronJob` `v1beta1` version. +Note that metrics for those resources will not be emitted anymore on Kubernetes 1.22 and older. +- (Contrib) `prometheusexporters`: Append prometheus type and unit suffixes by default in prometheus exporters. ([#26488](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/26488)) +Suffixes can be disabled by setting add_metric_suffixes to false on the exporter. +- (Contrib) `attributesprocessor`, `resourceprocessor`: Transition featuregate `coreinternal.attraction.hash.sha256` to stable ([#4759](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/4759)) + +### 💡 Enhancements 💡 + +- (Splunk) `wavefrontreceiver`: Add wavefrontreceiver ([#3629](https://github.com/signalfx/splunk-otel-collector/pull/3629)) +- (Splunk) Update `splunk-otel-javaagent` to 1.28.0 ([#3647](https://github.com/signalfx/splunk-otel-collector/pull/3647)) +- (Contrib) `postgresqlreceiver`: Added postgresql.database.locks metric. ([#26317](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/26317)) +- (Contrib) `receiver/statsdreceiver`: Add support for distribution type metrics in the statsdreceiver. ([#24768](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/24768)) +- (Contrib) `pkg/ottl`: Add converters to convert time to unix nanoseconds, unix microseconds, unix milliseconds or unix seconds ([#24686](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/24686)) +- (Contrib) `receiver/hostmetrics`: Don't collect connections data from the host if system.network.connections metric is disabled to not waste CPU cycles. ([#25815](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/25815)) +- (Contrib) `jaegerreceiver`,`jaegerremotesamplingextension`: Add featuregates to replace Thrift-gen with Proto-gen types for sampling strategies ([#18401](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/18401)) + + Available featuregates are: + * `extension.jaegerremotesampling.replaceThriftWithProto` + * `receiver.jaegerreceiver.replaceThriftWithProto` +- (Contrib) `k8sclusterreceiver`: Add optional `k8s.kubelet.version`, `k8s.kubeproxy.version` node resource attributes ([#24835](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/24835)) +- (Contrib) `k8sclusterreceiver`: Add `k8s.pod.status_reason` option metric ([#24034](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/24034)) +- (Contrib) `k8sobjectsreceiver`: Adds logic to properly handle 410 response codes when watching. This improves the reliability of the receiver. ([#26098](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/26098)) +- (Contrib) `k8sobjectreceiver`: Adds option to exclude event types (`MODIFIED`, `DELETED`, etc) in watch mode. ([#26042](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/26042)) +- (Core) `confighttp`: Add option to disable HTTP keep-alives ([#8260](https://github.com/open-telemetry/opentelemetry-collector/issues/8260)) + +### 🧰 Bug fixes 🧰 + +- (Splunk) `fluentd`: Update fluentd url for windows ([#3635](https://github.com/signalfx/splunk-otel-collector/pull/3635)) +- (Contrib) `processor/routing`: When using attributes instead of resource attributes, the routing processor would crash the collector. This does not affect the connector version of this component. ([#26462](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/26462)) +- (Contrib) `processor/tailsampling`: Added saving instrumentation library information for tail-sampling ([#13642](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/13642)) +- (Contrib) `receiver/kubeletstats`: Fixes client to refresh service account token when authenticating with kubelet ([#26120](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/26120)) +- (Contrib) `filelogreceiver`: Fix the behavior of the add operator to continue to support `EXPR(env("MY_ENV_VAR"))` expressions ([#26373](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/26373)) +- (Contrib) `pkg/stanza`: Fix issue unsupported type 'syslog_parser' ([#26452](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/26452)) +- (Core) `confmap`: fix bugs of unmarshalling slice values ([#4001](https://github.com/open-telemetry/opentelemetry-collector/issues/4001)) + ## v0.84.0 ### 🛑 Breaking changes 🛑 From d8c87cae0bac1e9745a5b8bcaca301be9c198887 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:45:06 -0400 Subject: [PATCH 06/55] Bump docker/setup-qemu-action from 2 to 3 (#3649) Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3. - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](https://github.com/docker/setup-qemu-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/setup-qemu-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/auto-instrumentation.yml | 6 +++--- .github/workflows/installer-script-test.yml | 2 +- .github/workflows/integration-test.yml | 6 +++--- .github/workflows/linux-package-test.yml | 6 +++--- .github/workflows/vuln-scans.yml | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/auto-instrumentation.yml b/.github/workflows/auto-instrumentation.yml index a5ca3dd1c6..80408b1d1a 100644 --- a/.github/workflows/auto-instrumentation.yml +++ b/.github/workflows/auto-instrumentation.yml @@ -26,7 +26,7 @@ jobs: - name: Set up QEMU if: ${{ matrix.ARCH == 'arm64' }} - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 image: tonistiigi/binfmt:qemu-v7.0.0 @@ -102,7 +102,7 @@ jobs: - name: Set up QEMU if: ${{ matrix.ARCH == 'arm64' }} - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 image: tonistiigi/binfmt:qemu-v7.0.0 @@ -131,7 +131,7 @@ jobs: - name: Set up QEMU if: ${{ matrix.ARCH == 'arm64'}} - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 image: tonistiigi/binfmt:qemu-v7.0.0 diff --git a/.github/workflows/installer-script-test.yml b/.github/workflows/installer-script-test.yml index 5967073fa2..ecd6f02884 100644 --- a/.github/workflows/installer-script-test.yml +++ b/.github/workflows/installer-script-test.yml @@ -59,7 +59,7 @@ jobs: - name: Check out the codebase. uses: actions/checkout@v4 - - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-qemu-action@v3 if: ${{ matrix.ARCH != 'amd64' }} with: platforms: ${{ matrix.ARCH }} diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 07af5b90af..9e43c83c76 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -49,7 +49,7 @@ jobs: key: agent-bundle-buildx-${{ matrix.ARCH }}-${{ hashFiles('internal/signalfx-agent/bundle/**') }} restore-keys: | agent-bundle-buildx-${{ matrix.ARCH }}- - - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-qemu-action@v3 if: ${{ matrix.ARCH != 'amd64' }} with: platforms: ${{ matrix.ARCH }} @@ -86,7 +86,7 @@ jobs: with: name: otelcol-${{ matrix.ARCH }} path: ./bin - - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-qemu-action@v3 if: ${{ matrix.ARCH != 'amd64' }} with: platforms: ${{ matrix.ARCH }} @@ -119,7 +119,7 @@ jobs: with: name: otelcol-${{ matrix.ARCH }} path: ./bin - - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-qemu-action@v3 if: ${{ matrix.ARCH != 'amd64' }} with: platforms: ${{ matrix.ARCH }} diff --git a/.github/workflows/linux-package-test.yml b/.github/workflows/linux-package-test.yml index 9e931ed5d6..0669447d24 100644 --- a/.github/workflows/linux-package-test.yml +++ b/.github/workflows/linux-package-test.yml @@ -93,7 +93,7 @@ jobs: restore-keys: | agent-bundle-buildx-${{ matrix.ARCH }}- - - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-qemu-action@v3 if: ${{ matrix.ARCH != 'amd64' }} with: platforms: ${{ matrix.ARCH }} @@ -200,7 +200,7 @@ jobs: name: ${{ env.SYS_PACKAGE }}-${{ matrix.ARCH }}-package path: ./dist - - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-qemu-action@v3 if: ${{ matrix.ARCH != 'amd64' }} with: platforms: ${{ matrix.ARCH }} @@ -269,7 +269,7 @@ jobs: - name: Set up QEMU if: ${{ matrix.ARCH != 'amd64' }} - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: ${{ matrix.ARCH }} image: tonistiigi/binfmt:qemu-v7.0.0 diff --git a/.github/workflows/vuln-scans.yml b/.github/workflows/vuln-scans.yml index b6baf0faa4..e2c46f24ec 100644 --- a/.github/workflows/vuln-scans.yml +++ b/.github/workflows/vuln-scans.yml @@ -65,7 +65,7 @@ jobs: key: agent-bundle-buildx-${{ matrix.ARCH }}-${{ hashFiles('internal/signalfx-agent/bundle/**') }} restore-keys: | agent-bundle-buildx-${{ matrix.ARCH }}- - - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-qemu-action@v3 if: ${{ matrix.ARCH != 'amd64' }} with: platforms: ${{ matrix.ARCH }} @@ -91,7 +91,7 @@ jobs: fail-fast: false steps: - uses: actions/checkout@v4 - - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-qemu-action@v3 if: ${{ matrix.ARCH != 'amd64' }} with: platforms: ${{ matrix.ARCH }} @@ -122,7 +122,7 @@ jobs: GRYPE_PLATFORM: ${{ matrix.ARCH }} steps: - uses: actions/checkout@v4 - - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-qemu-action@v3 if: ${{ matrix.ARCH != 'amd64' }} with: platforms: ${{ matrix.ARCH }} From 01c767f58e2087fb4328f31efa97960204fd58f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:46:33 -0400 Subject: [PATCH 07/55] Bump com.signalfx.public:signalfx-protoc (#3651) Bumps [com.signalfx.public:signalfx-protoc](https://github.com/signalfx/signalfx-java) from 1.0.34 to 1.0.35. - [Release notes](https://github.com/signalfx/signalfx-java/releases) - [Commits](https://github.com/signalfx/signalfx-java/compare/v1.0.34...v1.0.35) --- updated-dependencies: - dependency-name: com.signalfx.public:signalfx-protoc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- internal/signalfx-agent/bundle/java/runner/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/signalfx-agent/bundle/java/runner/pom.xml b/internal/signalfx-agent/bundle/java/runner/pom.xml index f7930ffbaf..a7d284ecd2 100644 --- a/internal/signalfx-agent/bundle/java/runner/pom.xml +++ b/internal/signalfx-agent/bundle/java/runner/pom.xml @@ -22,7 +22,7 @@ com.signalfx.public signalfx-protoc - 1.0.34 + 1.0.35 com.google.guava From 03ea0d6bfd5f444d7d05b23e4fdf8b89edd0e263 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:47:00 -0400 Subject: [PATCH 08/55] Bump pytest-html in /internal/buildscripts/packaging/tests (#3655) Bumps [pytest-html](https://github.com/pytest-dev/pytest-html) from 4.0.1 to 4.0.2. - [Release notes](https://github.com/pytest-dev/pytest-html/releases) - [Changelog](https://github.com/pytest-dev/pytest-html/blob/master/docs/changelog.rst) - [Commits](https://github.com/pytest-dev/pytest-html/compare/4.0.1...4.0.2) --- updated-dependencies: - dependency-name: pytest-html dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- internal/buildscripts/packaging/tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/buildscripts/packaging/tests/requirements.txt b/internal/buildscripts/packaging/tests/requirements.txt index 4d9db07010..535b574aab 100644 --- a/internal/buildscripts/packaging/tests/requirements.txt +++ b/internal/buildscripts/packaging/tests/requirements.txt @@ -1,7 +1,7 @@ docker==6.1.3 psutil==5.9.5 pytest==7.4.2 -pytest-html==4.0.1 +pytest-html==4.0.2 pytest-xdist==3.3.1 py>=1.8.2 requests<2.32.0 From 2de018849bb97c4db67317b94ecc71df62ad4537 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:47:28 -0400 Subject: [PATCH 09/55] Bump boto3 in /internal/buildscripts/packaging/release (#3664) Bumps [boto3](https://github.com/boto/boto3) from 1.28.44 to 1.28.49. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.28.44...1.28.49) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- internal/buildscripts/packaging/release/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/buildscripts/packaging/release/requirements.txt b/internal/buildscripts/packaging/release/requirements.txt index ebdd3258d9..34cc4f68ce 100644 --- a/internal/buildscripts/packaging/release/requirements.txt +++ b/internal/buildscripts/packaging/release/requirements.txt @@ -1,4 +1,4 @@ PyGithub==1.59.1 -boto3==1.28.44 +boto3==1.28.49 docker==6.1.3 requests==2.31.0 \ No newline at end of file From 1283f360ad93832553b27f26ca204944a3a4cdf4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:50:29 -0400 Subject: [PATCH 10/55] Bump com.signalfx.public:signalfx-commons-protoc-java (#3650) Bumps [com.signalfx.public:signalfx-commons-protoc-java](https://github.com/signalfx/signalfx-java) from 1.0.34 to 1.0.35. - [Release notes](https://github.com/signalfx/signalfx-java/releases) - [Commits](https://github.com/signalfx/signalfx-java/compare/v1.0.34...v1.0.35) --- updated-dependencies: - dependency-name: com.signalfx.public:signalfx-commons-protoc-java dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- internal/signalfx-agent/bundle/java/runner/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/signalfx-agent/bundle/java/runner/pom.xml b/internal/signalfx-agent/bundle/java/runner/pom.xml index a7d284ecd2..f3e9b5b4e2 100644 --- a/internal/signalfx-agent/bundle/java/runner/pom.xml +++ b/internal/signalfx-agent/bundle/java/runner/pom.xml @@ -32,7 +32,7 @@ com.signalfx.public signalfx-commons-protoc-java - 1.0.34 + 1.0.35 com.google.guava From 77f9868757a3f0af0016586e94fb65e5e703cfde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:54:43 -0400 Subject: [PATCH 11/55] Bump k8s.io/kubectl from 0.28.1 to 0.28.2 in /tests (#3659) * Bump k8s.io/kubectl from 0.28.1 to 0.28.2 in /tests Bumps [k8s.io/kubectl](https://github.com/kubernetes/kubectl) from 0.28.1 to 0.28.2. - [Commits](https://github.com/kubernetes/kubectl/compare/v0.28.1...v0.28.2) --- updated-dependencies: - dependency-name: k8s.io/kubectl dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- go.mod | 6 ++--- go.sum | 12 ++++----- pkg/extension/smartagentextension/go.sum | 6 ++--- pkg/receiver/smartagentreceiver/go.mod | 6 ++--- pkg/receiver/smartagentreceiver/go.sum | 12 ++++----- tests/go.mod | 16 ++++++------ tests/go.sum | 32 ++++++++++++------------ 7 files changed, 45 insertions(+), 45 deletions(-) diff --git a/go.mod b/go.mod index 902455c56a..85233243e9 100644 --- a/go.mod +++ b/go.mod @@ -519,9 +519,9 @@ require ( gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.28.1 // indirect - k8s.io/apimachinery v0.28.1 // indirect - k8s.io/client-go v0.28.1 // indirect + k8s.io/api v0.28.2 // indirect + k8s.io/apimachinery v0.28.2 // indirect + k8s.io/client-go v0.28.2 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect k8s.io/kubelet v0.28.1 // indirect diff --git a/go.sum b/go.sum index 69ea3de3f8..e1c41e206a 100644 --- a/go.sum +++ b/go.sum @@ -2248,12 +2248,12 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.28.1 h1:i+0O8k2NPBCPYaMB+uCkseEbawEt/eFaiRqUx8aB108= -k8s.io/api v0.28.1/go.mod h1:uBYwID+66wiL28Kn2tBjBYQdEU0Xk0z5qF8bIBqk/Dg= -k8s.io/apimachinery v0.28.1 h1:EJD40og3GizBSV3mkIoXQBsws32okPOy+MkRyzh6nPY= -k8s.io/apimachinery v0.28.1/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw= -k8s.io/client-go v0.28.1 h1:pRhMzB8HyLfVwpngWKE8hDcXRqifh1ga2Z/PU9SXVK8= -k8s.io/client-go v0.28.1/go.mod h1:pEZA3FqOsVkCc07pFVzK076R+P/eXqsgx5zuuRWukNE= +k8s.io/api v0.28.2 h1:9mpl5mOb6vXZvqbQmankOfPIGiudghwCoLl1EYfUZbw= +k8s.io/api v0.28.2/go.mod h1:RVnJBsjU8tcMq7C3iaRSGMeaKt2TWEUXcpIt/90fjEg= +k8s.io/apimachinery v0.28.2 h1:KCOJLrc6gu+wV1BYgwik4AF4vXOlVJPdiqn0yAWWwXQ= +k8s.io/apimachinery v0.28.2/go.mod h1:RdzF87y/ngqk9H4z3EL2Rppv5jj95vGS/HaFXrLDApU= +k8s.io/client-go v0.28.2 h1:DNoYI1vGq0slMBN/SWKMZMw0Rq+0EQW6/AK4v9+3VeY= +k8s.io/client-go v0.28.2/go.mod h1:sMkApowspLuc7omj1FOSUxSoqjr+d5Q0Yc0LOFnYFJY= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index 30fc5edb64..200134b729 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -936,9 +936,9 @@ gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.28.1 h1:i+0O8k2NPBCPYaMB+uCkseEbawEt/eFaiRqUx8aB108= -k8s.io/apimachinery v0.28.1 h1:EJD40og3GizBSV3mkIoXQBsws32okPOy+MkRyzh6nPY= -k8s.io/client-go v0.28.1 h1:pRhMzB8HyLfVwpngWKE8hDcXRqifh1ga2Z/PU9SXVK8= +k8s.io/api v0.28.2 h1:9mpl5mOb6vXZvqbQmankOfPIGiudghwCoLl1EYfUZbw= +k8s.io/apimachinery v0.28.2 h1:KCOJLrc6gu+wV1BYgwik4AF4vXOlVJPdiqn0yAWWwXQ= +k8s.io/client-go v0.28.2 h1:DNoYI1vGq0slMBN/SWKMZMw0Rq+0EQW6/AK4v9+3VeY= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index 456ff326ac..a474e6dc93 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -315,9 +315,9 @@ require ( gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.28.1 // indirect - k8s.io/apimachinery v0.28.1 // indirect - k8s.io/client-go v0.28.1 // indirect + k8s.io/api v0.28.2 // indirect + k8s.io/apimachinery v0.28.2 // indirect + k8s.io/client-go v0.28.2 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect k8s.io/kubelet v0.28.1 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index 8dfc3d936d..dc11ead369 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -1726,12 +1726,12 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.28.1 h1:i+0O8k2NPBCPYaMB+uCkseEbawEt/eFaiRqUx8aB108= -k8s.io/api v0.28.1/go.mod h1:uBYwID+66wiL28Kn2tBjBYQdEU0Xk0z5qF8bIBqk/Dg= -k8s.io/apimachinery v0.28.1 h1:EJD40og3GizBSV3mkIoXQBsws32okPOy+MkRyzh6nPY= -k8s.io/apimachinery v0.28.1/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw= -k8s.io/client-go v0.28.1 h1:pRhMzB8HyLfVwpngWKE8hDcXRqifh1ga2Z/PU9SXVK8= -k8s.io/client-go v0.28.1/go.mod h1:pEZA3FqOsVkCc07pFVzK076R+P/eXqsgx5zuuRWukNE= +k8s.io/api v0.28.2 h1:9mpl5mOb6vXZvqbQmankOfPIGiudghwCoLl1EYfUZbw= +k8s.io/api v0.28.2/go.mod h1:RVnJBsjU8tcMq7C3iaRSGMeaKt2TWEUXcpIt/90fjEg= +k8s.io/apimachinery v0.28.2 h1:KCOJLrc6gu+wV1BYgwik4AF4vXOlVJPdiqn0yAWWwXQ= +k8s.io/apimachinery v0.28.2/go.mod h1:RdzF87y/ngqk9H4z3EL2Rppv5jj95vGS/HaFXrLDApU= +k8s.io/client-go v0.28.2 h1:DNoYI1vGq0slMBN/SWKMZMw0Rq+0EQW6/AK4v9+3VeY= +k8s.io/client-go v0.28.2/go.mod h1:sMkApowspLuc7omj1FOSUxSoqjr+d5Q0Yc0LOFnYFJY= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= diff --git a/tests/go.mod b/tests/go.mod index 7b5c51bb0a..671b88db96 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -34,11 +34,11 @@ require ( golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.28.1 - k8s.io/apimachinery v0.28.1 - k8s.io/cli-runtime v0.28.1 - k8s.io/client-go v0.28.1 - k8s.io/kubectl v0.28.1 + k8s.io/api v0.28.2 + k8s.io/apimachinery v0.28.2 + k8s.io/cli-runtime v0.28.2 + k8s.io/client-go v0.28.2 + k8s.io/kubectl v0.28.2 sigs.k8s.io/kind v0.20.0-alpha sigs.k8s.io/yaml v1.3.0 ) @@ -165,11 +165,11 @@ require ( google.golang.org/grpc v1.57.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - k8s.io/component-base v0.28.1 // indirect - k8s.io/component-helpers v0.28.1 // indirect + k8s.io/component-base v0.28.2 // indirect + k8s.io/component-helpers v0.28.2 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect - k8s.io/metrics v0.28.1 // indirect + k8s.io/metrics v0.28.2 // indirect k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect diff --git a/tests/go.sum b/tests/go.sum index 9f61dc87f9..359ac87bf3 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -1673,26 +1673,26 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -k8s.io/api v0.28.1 h1:i+0O8k2NPBCPYaMB+uCkseEbawEt/eFaiRqUx8aB108= -k8s.io/api v0.28.1/go.mod h1:uBYwID+66wiL28Kn2tBjBYQdEU0Xk0z5qF8bIBqk/Dg= -k8s.io/apimachinery v0.28.1 h1:EJD40og3GizBSV3mkIoXQBsws32okPOy+MkRyzh6nPY= -k8s.io/apimachinery v0.28.1/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw= -k8s.io/cli-runtime v0.28.1 h1:7Njc4eD5kaO4tYdSYVJJEs54koYD/vT6gxOq8dEVf9g= -k8s.io/cli-runtime v0.28.1/go.mod h1:yIThSWkAVLqeRs74CMkq6lNFW42GyJmvMtcNn01SZho= -k8s.io/client-go v0.28.1 h1:pRhMzB8HyLfVwpngWKE8hDcXRqifh1ga2Z/PU9SXVK8= -k8s.io/client-go v0.28.1/go.mod h1:pEZA3FqOsVkCc07pFVzK076R+P/eXqsgx5zuuRWukNE= -k8s.io/component-base v0.28.1 h1:LA4AujMlK2mr0tZbQDZkjWbdhTV5bRyEyAFe0TJxlWg= -k8s.io/component-base v0.28.1/go.mod h1:jI11OyhbX21Qtbav7JkhehyBsIRfnO8oEgoAR12ArIU= -k8s.io/component-helpers v0.28.1 h1:ts/vykhyUmPLhUl/hdLdf+a4BWA0giQ3f25HAIhl+RI= -k8s.io/component-helpers v0.28.1/go.mod h1:rHFPj33uXNbgppg+ilmjJ4oR73prZQNRRmg+utVOAb0= +k8s.io/api v0.28.2 h1:9mpl5mOb6vXZvqbQmankOfPIGiudghwCoLl1EYfUZbw= +k8s.io/api v0.28.2/go.mod h1:RVnJBsjU8tcMq7C3iaRSGMeaKt2TWEUXcpIt/90fjEg= +k8s.io/apimachinery v0.28.2 h1:KCOJLrc6gu+wV1BYgwik4AF4vXOlVJPdiqn0yAWWwXQ= +k8s.io/apimachinery v0.28.2/go.mod h1:RdzF87y/ngqk9H4z3EL2Rppv5jj95vGS/HaFXrLDApU= +k8s.io/cli-runtime v0.28.2 h1:64meB2fDj10/ThIMEJLO29a1oujSm0GQmKzh1RtA/uk= +k8s.io/cli-runtime v0.28.2/go.mod h1:bTpGOvpdsPtDKoyfG4EG041WIyFZLV9qq4rPlkyYfDA= +k8s.io/client-go v0.28.2 h1:DNoYI1vGq0slMBN/SWKMZMw0Rq+0EQW6/AK4v9+3VeY= +k8s.io/client-go v0.28.2/go.mod h1:sMkApowspLuc7omj1FOSUxSoqjr+d5Q0Yc0LOFnYFJY= +k8s.io/component-base v0.28.2 h1:Yc1yU+6AQSlpJZyvehm/NkJBII72rzlEsd6MkBQ+G0E= +k8s.io/component-base v0.28.2/go.mod h1:4IuQPQviQCg3du4si8GpMrhAIegxpsgPngPRR/zWpzc= +k8s.io/component-helpers v0.28.2 h1:r/XJ265PMirW9EcGXr/F+2yWrLPo2I69KdvcY/h9HAo= +k8s.io/component-helpers v0.28.2/go.mod h1:pF1R5YWQ+sgf0i6EbVm+MQCzkYuqutDUibdrkvAa6aI= k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= -k8s.io/kubectl v0.28.1 h1:jAq4yKEqQL+fwkWcEsUWxhJ7uIRcOYQraJxx4SyAMTY= -k8s.io/kubectl v0.28.1/go.mod h1:a0nk/lMMeKBulp0lMTJAKbkjZg1ykqfLfz/d6dnv1ak= -k8s.io/metrics v0.28.1 h1:Q0AsAEZKlAzhqrvfoGyHjz2qAFlef0SqfGJ1YWJ+ITU= -k8s.io/metrics v0.28.1/go.mod h1:8lKkAajigcZWu0o9XCEBr++YVCzT48q1ck+f9CEBhZY= +k8s.io/kubectl v0.28.2 h1:fOWOtU6S0smdNjG1PB9WFbqEIMlkzU5ahyHkc7ESHgM= +k8s.io/kubectl v0.28.2/go.mod h1:6EQWTPySF1fn7yKoQZHYf9TPwIl2AygHEcJoxFekr64= +k8s.io/metrics v0.28.2 h1:Z/oMk5SmiT/Ji1SaWOPfW2l9W831BLO9/XxDq9iS3ak= +k8s.io/metrics v0.28.2/go.mod h1:QTIIdjMrq+KodO+rmp6R9Pr1LZO8kTArNtkWoQXw0sw= k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= From 8b5f56f5befc46d20756a47c2684f99dac4f2417 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:56:17 -0400 Subject: [PATCH 12/55] Bump setuptools in /internal/signalfx-agent/bundle/scripts (#3666) Bumps [setuptools](https://github.com/pypa/setuptools) from 68.2.0 to 68.2.2. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/setuptools/compare/v68.2.0...v68.2.2) --- updated-dependencies: - dependency-name: setuptools dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- internal/signalfx-agent/bundle/scripts/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/signalfx-agent/bundle/scripts/requirements.txt b/internal/signalfx-agent/bundle/scripts/requirements.txt index 7485c73889..56d7baa621 100644 --- a/internal/signalfx-agent/bundle/scripts/requirements.txt +++ b/internal/signalfx-agent/bundle/scripts/requirements.txt @@ -1,4 +1,4 @@ PyYAML~=5.0 WMI==1.5.1; sys_platform == "win32" dbus-python==1.3.2; sys_platform == "linux" -setuptools==68.2.0 +setuptools==68.2.2 From e1b906e0e011da95a7ee44e2f30f3432bba7afc1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 10:06:14 -0400 Subject: [PATCH 13/55] Bump go.uber.org/zap from 1.25.0 to 1.26.0 in /pkg/processor/timestampprocessor (#3652) * Bump go.uber.org/zap in /pkg/processor/timestampprocessor Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.25.0 to 1.26.0. - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/zap/compare/v1.25.0...v1.26.0) --- updated-dependencies: - dependency-name: go.uber.org/zap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- go.mod | 3 +-- go.sum | 6 ++---- pkg/processor/timestampprocessor/go.mod | 2 +- pkg/processor/timestampprocessor/go.sum | 5 ++--- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 85233243e9..9e4226a064 100644 --- a/go.mod +++ b/go.mod @@ -123,7 +123,7 @@ require ( go.opentelemetry.io/otel/trace v1.17.0 go.uber.org/atomic v1.11.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.25.0 + go.uber.org/zap v1.26.0 golang.org/x/sys v0.12.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -249,7 +249,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/s3 v1.31.0 // indirect github.com/aws/smithy-go v1.14.2 // indirect github.com/beevik/ntp v1.3.0 // indirect - github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect diff --git a/go.sum b/go.sum index e1c41e206a..151426fd37 100644 --- a/go.sum +++ b/go.sum @@ -267,8 +267,6 @@ github.com/axiomhq/hyperloglog v0.0.0-20220105174342-98591331716a h1:eqjiAL3qoof github.com/beevik/ntp v1.3.0 h1:/w5VhpW5BGKS37vFm1p9oVk/t4HnnkKZAZIubHM6F7Q= github.com/beevik/ntp v1.3.0/go.mod h1:vD6h1um4kzXpqmLTuu0cCLcC+NfvC0IC+ltmEDA8E78= 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= @@ -1745,8 +1743,8 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= diff --git a/pkg/processor/timestampprocessor/go.mod b/pkg/processor/timestampprocessor/go.mod index 19d99bcff0..77c2fa276d 100644 --- a/pkg/processor/timestampprocessor/go.mod +++ b/pkg/processor/timestampprocessor/go.mod @@ -9,7 +9,7 @@ require ( go.opentelemetry.io/collector/consumer v0.85.0 go.opentelemetry.io/collector/pdata v1.0.0-rcv0014 go.opentelemetry.io/collector/processor v0.85.0 - go.uber.org/zap v1.25.0 + go.uber.org/zap v1.26.0 ) require ( diff --git a/pkg/processor/timestampprocessor/go.sum b/pkg/processor/timestampprocessor/go.sum index 2b1679845d..5d4d1fcbe2 100644 --- a/pkg/processor/timestampprocessor/go.sum +++ b/pkg/processor/timestampprocessor/go.sum @@ -21,7 +21,6 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72H github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -286,8 +285,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= From 513247a645452a56054ec1317f3c58f50dc6df71 Mon Sep 17 00:00:00 2001 From: Jeff Cheng <83052155+jeffreyc-splunk@users.noreply.github.com> Date: Mon, 18 Sep 2023 10:29:21 -0400 Subject: [PATCH 14/55] Revert "Bump signalfx/splunk-otel-collector (#3600)" (#3671) This reverts commit 2e7138bca4bd2d0b30b37a61b223a95c1df8cbc7. --- examples/prometheusexec-migration/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/prometheusexec-migration/Dockerfile b/examples/prometheusexec-migration/Dockerfile index d29e38e24a..44875d17b6 100644 --- a/examples/prometheusexec-migration/Dockerfile +++ b/examples/prometheusexec-migration/Dockerfile @@ -1,3 +1,3 @@ -FROM quay.io/signalfx/splunk-otel-collector:0.84.0 +FROM quay.io/signalfx/splunk-otel-collector:0.82.0 COPY --from=quay.io/prometheus/node-exporter:v1.6.1 --chown=999 /bin/node_exporter /usr/bin/node_exporter CMD ["otelcol"] From b358a98e76fd865abe92f9cddcb2bad96fafe681 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 10:36:31 -0400 Subject: [PATCH 15/55] Bump go.uber.org/zap in /examples/prometheus-federation/prom-counter (#3648) Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.25.0 to 1.26.0. - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/zap/compare/v1.25.0...v1.26.0) --- updated-dependencies: - dependency-name: go.uber.org/zap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- examples/prometheus-federation/prom-counter/go.mod | 2 +- examples/prometheus-federation/prom-counter/go.sum | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/prometheus-federation/prom-counter/go.mod b/examples/prometheus-federation/prom-counter/go.mod index 7666504912..51472df0b0 100644 --- a/examples/prometheus-federation/prom-counter/go.mod +++ b/examples/prometheus-federation/prom-counter/go.mod @@ -6,7 +6,7 @@ require ( go.opentelemetry.io/otel v0.20.0 go.opentelemetry.io/otel/exporters/metric/prometheus v0.20.0 go.opentelemetry.io/otel/metric v0.20.0 - go.uber.org/zap v1.25.0 + go.uber.org/zap v1.26.0 ) require ( diff --git a/examples/prometheus-federation/prom-counter/go.sum b/examples/prometheus-federation/prom-counter/go.sum index 1f52b374fd..cbf2baa5e2 100644 --- a/examples/prometheus-federation/prom-counter/go.sum +++ b/examples/prometheus-federation/prom-counter/go.sum @@ -20,8 +20,8 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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= @@ -311,8 +311,8 @@ go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= From d0c06b2a6efbeb430e95ac117b7c58e7eda11e11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 10:51:53 -0400 Subject: [PATCH 16/55] Bump github.com/hashicorp/vault from 1.14.2 to 1.14.3 in /internal/signalfx-agent (#3662) * Bump github.com/hashicorp/vault in /internal/signalfx-agent Bumps [github.com/hashicorp/vault](https://github.com/hashicorp/vault) from 1.14.2 to 1.14.3. - [Release notes](https://github.com/hashicorp/vault/releases) - [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/vault/compare/v1.14.2...v1.14.3) --- updated-dependencies: - dependency-name: github.com/hashicorp/vault dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- go.mod | 2 +- go.sum | 6 +++--- internal/signalfx-agent/go.mod | 5 ++++- internal/signalfx-agent/go.sum | 16 +++++++++------- pkg/extension/smartagentextension/go.mod | 2 +- pkg/extension/smartagentextension/go.sum | 12 ++++++------ pkg/receiver/smartagentreceiver/go.mod | 2 +- pkg/receiver/smartagentreceiver/go.sum | 12 ++++++------ 8 files changed, 31 insertions(+), 26 deletions(-) diff --git a/go.mod b/go.mod index 9e4226a064..2e32c97a8d 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/fsnotify/fsnotify v1.6.0 github.com/go-zookeeper/zk v1.0.3 github.com/gogo/protobuf v1.3.2 - github.com/hashicorp/vault v1.14.2 + github.com/hashicorp/vault v1.14.3 github.com/hashicorp/vault-plugin-auth-gcp v0.16.1 github.com/hashicorp/vault/api v1.10.0 github.com/jaegertracing/jaeger v1.48.0 diff --git a/go.sum b/go.sum index 151426fd37..46c9b2df4f 100644 --- a/go.sum +++ b/go.sum @@ -696,7 +696,7 @@ github.com/hashicorp/go-kms-wrapping/v2 v2.0.10/go.mod h1:NtMaPhqSlfQ72XWDD2g80o github.com/hashicorp/go-kms-wrapping/wrappers/aead/v2 v2.0.7-1 h1:ZV26VJYcITBom0QqYSUOIj4HOHCVPEFjLqjxyXV/AbA= github.com/hashicorp/go-kms-wrapping/wrappers/alicloudkms/v2 v2.0.1 h1:ydUCtmr8f9F+mHZ1iCsvzqFTXqNVpewX3s9zcYipMKI= github.com/hashicorp/go-kms-wrapping/wrappers/awskms/v2 v2.0.7 h1:E3eEWpkofgPNrYyYznfS1+drq4/jFcqHQVNcL7WhUCo= -github.com/hashicorp/go-kms-wrapping/wrappers/azurekeyvault/v2 v2.0.7 h1:X27JWuPW6Gmi2l7NMm0pvnp7z7hhtns2TeIOQU93mqI= +github.com/hashicorp/go-kms-wrapping/wrappers/azurekeyvault/v2 v2.0.8-0.20230905162003-bfa3347a7c85 h1:yZqD2ZQ4kWyVI2reKGC8Hl78ywWBtl1iLz/Bb5GBvMA= github.com/hashicorp/go-kms-wrapping/wrappers/gcpckms/v2 v2.0.8 h1:16I8OqBEuxZIowwn3jiLvhlx+z+ia4dJc9stvz0yUBU= github.com/hashicorp/go-kms-wrapping/wrappers/ocikms/v2 v2.0.7 h1:KeG3QGrbxbr2qAqCJdf3NR4ijAYwdcWLTmwSbR0yusM= github.com/hashicorp/go-kms-wrapping/wrappers/transit/v2 v2.0.7 h1:G25tZFw/LrAzJWxvS0/BFI7V1xAP/UsAIsgBwiE0mwo= @@ -770,8 +770,8 @@ github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKEN github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -github.com/hashicorp/vault v1.14.2 h1:wgJSMMGlBpJcUR/L7F7/OkK8E3/nzXo5mCtJtNh6pIU= -github.com/hashicorp/vault v1.14.2/go.mod h1:9JtUETMikpprXcdwRssyxRVKyON/9jZ2fAcwQPt5ItE= +github.com/hashicorp/vault v1.14.3 h1:Q9wvxTRcIxdiGVHFnEJbRofh+Dotc/4YdBf3+qCpvM0= +github.com/hashicorp/vault v1.14.3/go.mod h1:w9/QkPZlVfpDShSDrISE+N/k82m4qvkB6OjgxOJfuPQ= github.com/hashicorp/vault-plugin-auth-gcp v0.16.1 h1:KasqciAWHP3Htruowdu8fhO5X1YFfY0Qi3nrsBlpDkU= github.com/hashicorp/vault-plugin-auth-gcp v0.16.1/go.mod h1:pLF4l4SjTMR24/FTsE1idVpKEeO8ah0x1Kpulw+I09I= github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index 492ccd3fd0..58f3f28e56 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -49,7 +49,7 @@ require ( github.com/google/cadvisor v0.47.3 github.com/gorilla/mux v1.8.0 github.com/hashicorp/consul/api v1.24.0 - github.com/hashicorp/vault v1.14.2 // required for newer google.golang.org/api compatibility + github.com/hashicorp/vault v1.14.3 // required for newer google.golang.org/api compatibility github.com/hashicorp/vault-plugin-auth-gcp v0.16.1 github.com/hashicorp/vault/api v1.10.0 github.com/iancoleman/strcase v0.3.0 @@ -129,6 +129,9 @@ require ( require ( cloud.google.com/go/compute v1.23.0 // indirect cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 // indirect + cloud.google.com/go/iam v1.1.1 // indirect + cloud.google.com/go/kms v1.15.0 // indirect + cloud.google.com/go/monitoring v1.15.1 // indirect code.cloudfoundry.org/go-diodes v0.0.0-20180905200951-72629b5276e3 // indirect code.cloudfoundry.org/rfc5424 v0.0.0-20180905210152-236a6d29298a // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index e417193638..69f07b7d59 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -25,7 +25,6 @@ cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aD cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.110.2 h1:sdFPBr6xG9/wkBbfhmUz/JmZC7X6LavQgcrVINrKiVA= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -38,9 +37,12 @@ cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 h1:aRV cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68/go.mod h1:1a3eRNYX12fs5UABBIXS8HXVvQbX9hRB/RkEBPORpe8= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/iam v1.0.1 h1:lyeCAU6jpnVNrE9zGQkTl3WgNgK/X+uWwaw0kynZJMU= -cloud.google.com/go/kms v1.10.2 h1:8UePKEypK3SQ6g+4mn/s/VgE5L7XOh+FwGGRUqvY3Hw= -cloud.google.com/go/monitoring v1.13.0 h1:2qsrgXGVoRXpP7otZ14eE1I568zAa92sJSDPyOJvwjM= +cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y= +cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= +cloud.google.com/go/kms v1.15.0 h1:xYl5WEaSekKYN5gGRyhjvZKM22GVBBCzegGNVPy+aIs= +cloud.google.com/go/kms v1.15.0/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= +cloud.google.com/go/monitoring v1.15.1 h1:65JhLMd+JiYnXr6j5Z63dUYCuOg770p8a/VC+gil/58= +cloud.google.com/go/monitoring v1.15.1/go.mod h1:lADlSAlFdbqQuwwpaImhsJXu1QSdd3ojypXrFSMr2rM= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -566,7 +568,7 @@ github.com/hashicorp/go-kms-wrapping/v2 v2.0.10/go.mod h1:NtMaPhqSlfQ72XWDD2g80o github.com/hashicorp/go-kms-wrapping/wrappers/aead/v2 v2.0.7-1 h1:ZV26VJYcITBom0QqYSUOIj4HOHCVPEFjLqjxyXV/AbA= github.com/hashicorp/go-kms-wrapping/wrappers/alicloudkms/v2 v2.0.1 h1:ydUCtmr8f9F+mHZ1iCsvzqFTXqNVpewX3s9zcYipMKI= github.com/hashicorp/go-kms-wrapping/wrappers/awskms/v2 v2.0.7 h1:E3eEWpkofgPNrYyYznfS1+drq4/jFcqHQVNcL7WhUCo= -github.com/hashicorp/go-kms-wrapping/wrappers/azurekeyvault/v2 v2.0.7 h1:X27JWuPW6Gmi2l7NMm0pvnp7z7hhtns2TeIOQU93mqI= +github.com/hashicorp/go-kms-wrapping/wrappers/azurekeyvault/v2 v2.0.8-0.20230905162003-bfa3347a7c85 h1:yZqD2ZQ4kWyVI2reKGC8Hl78ywWBtl1iLz/Bb5GBvMA= github.com/hashicorp/go-kms-wrapping/wrappers/gcpckms/v2 v2.0.8 h1:16I8OqBEuxZIowwn3jiLvhlx+z+ia4dJc9stvz0yUBU= github.com/hashicorp/go-kms-wrapping/wrappers/ocikms/v2 v2.0.7 h1:KeG3QGrbxbr2qAqCJdf3NR4ijAYwdcWLTmwSbR0yusM= github.com/hashicorp/go-kms-wrapping/wrappers/transit/v2 v2.0.7 h1:G25tZFw/LrAzJWxvS0/BFI7V1xAP/UsAIsgBwiE0mwo= @@ -629,8 +631,8 @@ github.com/hashicorp/raft-snapshot v1.0.4 h1:EuDuayAJPdiDmVk1ygTDnG2zDzrs0/6/yBu github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -github.com/hashicorp/vault v1.14.2 h1:wgJSMMGlBpJcUR/L7F7/OkK8E3/nzXo5mCtJtNh6pIU= -github.com/hashicorp/vault v1.14.2/go.mod h1:9JtUETMikpprXcdwRssyxRVKyON/9jZ2fAcwQPt5ItE= +github.com/hashicorp/vault v1.14.3 h1:Q9wvxTRcIxdiGVHFnEJbRofh+Dotc/4YdBf3+qCpvM0= +github.com/hashicorp/vault v1.14.3/go.mod h1:w9/QkPZlVfpDShSDrISE+N/k82m4qvkB6OjgxOJfuPQ= github.com/hashicorp/vault-plugin-auth-gcp v0.16.1 h1:KasqciAWHP3Htruowdu8fhO5X1YFfY0Qi3nrsBlpDkU= github.com/hashicorp/vault-plugin-auth-gcp v0.16.1/go.mod h1:pLF4l4SjTMR24/FTsE1idVpKEeO8ah0x1Kpulw+I09I= github.com/hashicorp/vault/api v1.10.0 h1:/US7sIjWN6Imp4o/Rj1Ce2Nr5bki/AXi9vAW3p2tOJQ= diff --git a/pkg/extension/smartagentextension/go.mod b/pkg/extension/smartagentextension/go.mod index 5c1cc5c10c..af83720226 100644 --- a/pkg/extension/smartagentextension/go.mod +++ b/pkg/extension/smartagentextension/go.mod @@ -73,7 +73,7 @@ require ( github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect github.com/hashicorp/serf v0.10.1 // indirect - github.com/hashicorp/vault v1.14.2 // indirect + github.com/hashicorp/vault v1.14.3 // indirect github.com/hashicorp/vault-plugin-auth-gcp v0.16.1 // indirect github.com/hashicorp/vault/api v1.10.0 // indirect github.com/hashicorp/vault/sdk v0.9.2 // indirect diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index 200134b729..8b11a3ef0a 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -5,9 +5,9 @@ cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopT cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 h1:aRVqY1p2IJaBGStWMsQMpkAa83cPkCDLl80eOj0Rbz4= cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68/go.mod h1:1a3eRNYX12fs5UABBIXS8HXVvQbX9hRB/RkEBPORpe8= -cloud.google.com/go/iam v1.0.1 h1:lyeCAU6jpnVNrE9zGQkTl3WgNgK/X+uWwaw0kynZJMU= -cloud.google.com/go/kms v1.10.2 h1:8UePKEypK3SQ6g+4mn/s/VgE5L7XOh+FwGGRUqvY3Hw= -cloud.google.com/go/monitoring v1.13.0 h1:2qsrgXGVoRXpP7otZ14eE1I568zAa92sJSDPyOJvwjM= +cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y= +cloud.google.com/go/kms v1.15.0 h1:xYl5WEaSekKYN5gGRyhjvZKM22GVBBCzegGNVPy+aIs= +cloud.google.com/go/monitoring v1.15.1 h1:65JhLMd+JiYnXr6j5Z63dUYCuOg770p8a/VC+gil/58= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8 h1:V8krnnfGj4pV65YLUm3C0/8bl7V5Nry2Pwvy3ru/wLc= github.com/Azure/azure-sdk-for-go v67.2.0+incompatible h1:Uu/Ww6ernvPTrpq31kITVTIm/I5jlJ1wjtEH/bmSB2k= @@ -291,7 +291,7 @@ github.com/hashicorp/go-kms-wrapping/v2 v2.0.10/go.mod h1:NtMaPhqSlfQ72XWDD2g80o github.com/hashicorp/go-kms-wrapping/wrappers/aead/v2 v2.0.7-1 h1:ZV26VJYcITBom0QqYSUOIj4HOHCVPEFjLqjxyXV/AbA= github.com/hashicorp/go-kms-wrapping/wrappers/alicloudkms/v2 v2.0.1 h1:ydUCtmr8f9F+mHZ1iCsvzqFTXqNVpewX3s9zcYipMKI= github.com/hashicorp/go-kms-wrapping/wrappers/awskms/v2 v2.0.7 h1:E3eEWpkofgPNrYyYznfS1+drq4/jFcqHQVNcL7WhUCo= -github.com/hashicorp/go-kms-wrapping/wrappers/azurekeyvault/v2 v2.0.7 h1:X27JWuPW6Gmi2l7NMm0pvnp7z7hhtns2TeIOQU93mqI= +github.com/hashicorp/go-kms-wrapping/wrappers/azurekeyvault/v2 v2.0.8-0.20230905162003-bfa3347a7c85 h1:yZqD2ZQ4kWyVI2reKGC8Hl78ywWBtl1iLz/Bb5GBvMA= github.com/hashicorp/go-kms-wrapping/wrappers/gcpckms/v2 v2.0.8 h1:16I8OqBEuxZIowwn3jiLvhlx+z+ia4dJc9stvz0yUBU= github.com/hashicorp/go-kms-wrapping/wrappers/ocikms/v2 v2.0.7 h1:KeG3QGrbxbr2qAqCJdf3NR4ijAYwdcWLTmwSbR0yusM= github.com/hashicorp/go-kms-wrapping/wrappers/transit/v2 v2.0.7 h1:G25tZFw/LrAzJWxvS0/BFI7V1xAP/UsAIsgBwiE0mwo= @@ -358,8 +358,8 @@ github.com/hashicorp/raft-snapshot v1.0.4 h1:EuDuayAJPdiDmVk1ygTDnG2zDzrs0/6/yBu github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -github.com/hashicorp/vault v1.14.2 h1:wgJSMMGlBpJcUR/L7F7/OkK8E3/nzXo5mCtJtNh6pIU= -github.com/hashicorp/vault v1.14.2/go.mod h1:9JtUETMikpprXcdwRssyxRVKyON/9jZ2fAcwQPt5ItE= +github.com/hashicorp/vault v1.14.3 h1:Q9wvxTRcIxdiGVHFnEJbRofh+Dotc/4YdBf3+qCpvM0= +github.com/hashicorp/vault v1.14.3/go.mod h1:w9/QkPZlVfpDShSDrISE+N/k82m4qvkB6OjgxOJfuPQ= github.com/hashicorp/vault-plugin-auth-gcp v0.16.1 h1:KasqciAWHP3Htruowdu8fhO5X1YFfY0Qi3nrsBlpDkU= github.com/hashicorp/vault-plugin-auth-gcp v0.16.1/go.mod h1:pLF4l4SjTMR24/FTsE1idVpKEeO8ah0x1Kpulw+I09I= github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index a474e6dc93..08bf67912f 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -154,7 +154,7 @@ require ( github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect github.com/hashicorp/serf v0.10.1 // indirect - github.com/hashicorp/vault v1.14.2 // indirect + github.com/hashicorp/vault v1.14.3 // indirect github.com/hashicorp/vault-plugin-auth-gcp v0.16.1 // indirect github.com/hashicorp/vault/api v1.10.0 // indirect github.com/hashicorp/vault/sdk v0.9.2 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index dc11ead369..ebaae75bea 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -38,9 +38,9 @@ cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 h1:aRV cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68/go.mod h1:1a3eRNYX12fs5UABBIXS8HXVvQbX9hRB/RkEBPORpe8= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/iam v1.0.1 h1:lyeCAU6jpnVNrE9zGQkTl3WgNgK/X+uWwaw0kynZJMU= -cloud.google.com/go/kms v1.10.2 h1:8UePKEypK3SQ6g+4mn/s/VgE5L7XOh+FwGGRUqvY3Hw= -cloud.google.com/go/monitoring v1.13.0 h1:2qsrgXGVoRXpP7otZ14eE1I568zAa92sJSDPyOJvwjM= +cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y= +cloud.google.com/go/kms v1.15.0 h1:xYl5WEaSekKYN5gGRyhjvZKM22GVBBCzegGNVPy+aIs= +cloud.google.com/go/monitoring v1.15.1 h1:65JhLMd+JiYnXr6j5Z63dUYCuOg770p8a/VC+gil/58= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -569,7 +569,7 @@ github.com/hashicorp/go-kms-wrapping/v2 v2.0.10/go.mod h1:NtMaPhqSlfQ72XWDD2g80o github.com/hashicorp/go-kms-wrapping/wrappers/aead/v2 v2.0.7-1 h1:ZV26VJYcITBom0QqYSUOIj4HOHCVPEFjLqjxyXV/AbA= github.com/hashicorp/go-kms-wrapping/wrappers/alicloudkms/v2 v2.0.1 h1:ydUCtmr8f9F+mHZ1iCsvzqFTXqNVpewX3s9zcYipMKI= github.com/hashicorp/go-kms-wrapping/wrappers/awskms/v2 v2.0.7 h1:E3eEWpkofgPNrYyYznfS1+drq4/jFcqHQVNcL7WhUCo= -github.com/hashicorp/go-kms-wrapping/wrappers/azurekeyvault/v2 v2.0.7 h1:X27JWuPW6Gmi2l7NMm0pvnp7z7hhtns2TeIOQU93mqI= +github.com/hashicorp/go-kms-wrapping/wrappers/azurekeyvault/v2 v2.0.8-0.20230905162003-bfa3347a7c85 h1:yZqD2ZQ4kWyVI2reKGC8Hl78ywWBtl1iLz/Bb5GBvMA= github.com/hashicorp/go-kms-wrapping/wrappers/gcpckms/v2 v2.0.8 h1:16I8OqBEuxZIowwn3jiLvhlx+z+ia4dJc9stvz0yUBU= github.com/hashicorp/go-kms-wrapping/wrappers/ocikms/v2 v2.0.7 h1:KeG3QGrbxbr2qAqCJdf3NR4ijAYwdcWLTmwSbR0yusM= github.com/hashicorp/go-kms-wrapping/wrappers/transit/v2 v2.0.7 h1:G25tZFw/LrAzJWxvS0/BFI7V1xAP/UsAIsgBwiE0mwo= @@ -636,8 +636,8 @@ github.com/hashicorp/raft-snapshot v1.0.4 h1:EuDuayAJPdiDmVk1ygTDnG2zDzrs0/6/yBu github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -github.com/hashicorp/vault v1.14.2 h1:wgJSMMGlBpJcUR/L7F7/OkK8E3/nzXo5mCtJtNh6pIU= -github.com/hashicorp/vault v1.14.2/go.mod h1:9JtUETMikpprXcdwRssyxRVKyON/9jZ2fAcwQPt5ItE= +github.com/hashicorp/vault v1.14.3 h1:Q9wvxTRcIxdiGVHFnEJbRofh+Dotc/4YdBf3+qCpvM0= +github.com/hashicorp/vault v1.14.3/go.mod h1:w9/QkPZlVfpDShSDrISE+N/k82m4qvkB6OjgxOJfuPQ= github.com/hashicorp/vault-plugin-auth-gcp v0.16.1 h1:KasqciAWHP3Htruowdu8fhO5X1YFfY0Qi3nrsBlpDkU= github.com/hashicorp/vault-plugin-auth-gcp v0.16.1/go.mod h1:pLF4l4SjTMR24/FTsE1idVpKEeO8ah0x1Kpulw+I09I= github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= From 5ed7a904e5dcf8434cc545c476714462c7a37dcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 10:54:34 -0400 Subject: [PATCH 17/55] Bump k8s.io/kubelet from 0.28.1 to 0.28.2 in /internal/signalfx-agent (#3665) * Bump k8s.io/kubelet from 0.28.1 to 0.28.2 in /internal/signalfx-agent Bumps [k8s.io/kubelet](https://github.com/kubernetes/kubelet) from 0.28.1 to 0.28.2. - [Commits](https://github.com/kubernetes/kubelet/compare/v0.28.1...v0.28.2) --- updated-dependencies: - dependency-name: k8s.io/kubelet dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: jeffreyc-splunk --- go.mod | 2 +- go.sum | 4 ++-- internal/signalfx-agent/go.mod | 8 ++++---- internal/signalfx-agent/go.sum | 18 +++++++++--------- pkg/receiver/smartagentreceiver/go.mod | 2 +- pkg/receiver/smartagentreceiver/go.sum | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 2e32c97a8d..abc9069216 100644 --- a/go.mod +++ b/go.mod @@ -523,7 +523,7 @@ require ( k8s.io/client-go v0.28.2 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect - k8s.io/kubelet v0.28.1 // indirect + k8s.io/kubelet v0.28.2 // indirect k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect diff --git a/go.sum b/go.sum index 46c9b2df4f..15d2aa7214 100644 --- a/go.sum +++ b/go.sum @@ -2258,8 +2258,8 @@ k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= -k8s.io/kubelet v0.28.1 h1:QRfx+jrzNgkLnMSw/nxGkAN7cjHPO446MDbjPITxLkk= -k8s.io/kubelet v0.28.1/go.mod h1:xYBbbJ0e2Rtb/hv+QFie448lFF81J990ImIptce2AHk= +k8s.io/kubelet v0.28.2 h1:wqe5zKtVhNWwtdABU0mpcWVe8hc6VdVvs2kqQridZRw= +k8s.io/kubelet v0.28.2/go.mod h1:rvd0e7T5TjPcfZvy62P90XhFzp0IhPIOy+Pqy3Rtipo= k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20230711102312-30195339c3c7 h1:ZgnF1KZsYxWIifwSNZFZgNtWE89WI5yiP5WwlfDoIyc= k8s.io/utils v0.0.0-20230711102312-30195339c3c7/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index 58f3f28e56..5cb24e2b44 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -96,10 +96,10 @@ require ( google.golang.org/grpc v1.57.0 gopkg.in/go-playground/validator.v9 v9.31.0 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.28.1 - k8s.io/apimachinery v0.28.1 - k8s.io/client-go v0.28.1 - k8s.io/kubelet v0.28.1 + k8s.io/api v0.28.2 + k8s.io/apimachinery v0.28.2 + k8s.io/client-go v0.28.2 + k8s.io/kubelet v0.28.2 ) require ( diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index 69f07b7d59..2f8ed5c190 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -316,7 +316,7 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw= -github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= +github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= @@ -1775,20 +1775,20 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.28.1 h1:i+0O8k2NPBCPYaMB+uCkseEbawEt/eFaiRqUx8aB108= -k8s.io/api v0.28.1/go.mod h1:uBYwID+66wiL28Kn2tBjBYQdEU0Xk0z5qF8bIBqk/Dg= -k8s.io/apimachinery v0.28.1 h1:EJD40og3GizBSV3mkIoXQBsws32okPOy+MkRyzh6nPY= -k8s.io/apimachinery v0.28.1/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw= -k8s.io/client-go v0.28.1 h1:pRhMzB8HyLfVwpngWKE8hDcXRqifh1ga2Z/PU9SXVK8= -k8s.io/client-go v0.28.1/go.mod h1:pEZA3FqOsVkCc07pFVzK076R+P/eXqsgx5zuuRWukNE= +k8s.io/api v0.28.2 h1:9mpl5mOb6vXZvqbQmankOfPIGiudghwCoLl1EYfUZbw= +k8s.io/api v0.28.2/go.mod h1:RVnJBsjU8tcMq7C3iaRSGMeaKt2TWEUXcpIt/90fjEg= +k8s.io/apimachinery v0.28.2 h1:KCOJLrc6gu+wV1BYgwik4AF4vXOlVJPdiqn0yAWWwXQ= +k8s.io/apimachinery v0.28.2/go.mod h1:RdzF87y/ngqk9H4z3EL2Rppv5jj95vGS/HaFXrLDApU= +k8s.io/client-go v0.28.2 h1:DNoYI1vGq0slMBN/SWKMZMw0Rq+0EQW6/AK4v9+3VeY= +k8s.io/client-go v0.28.2/go.mod h1:sMkApowspLuc7omj1FOSUxSoqjr+d5Q0Yc0LOFnYFJY= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= -k8s.io/kubelet v0.28.1 h1:QRfx+jrzNgkLnMSw/nxGkAN7cjHPO446MDbjPITxLkk= -k8s.io/kubelet v0.28.1/go.mod h1:xYBbbJ0e2Rtb/hv+QFie448lFF81J990ImIptce2AHk= +k8s.io/kubelet v0.28.2 h1:wqe5zKtVhNWwtdABU0mpcWVe8hc6VdVvs2kqQridZRw= +k8s.io/kubelet v0.28.2/go.mod h1:rvd0e7T5TjPcfZvy62P90XhFzp0IhPIOy+Pqy3Rtipo= k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index 08bf67912f..793b0bb1d1 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -320,7 +320,7 @@ require ( k8s.io/client-go v0.28.2 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect - k8s.io/kubelet v0.28.1 // indirect + k8s.io/kubelet v0.28.2 // indirect k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index ebaae75bea..bb12b41372 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -1738,8 +1738,8 @@ k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= -k8s.io/kubelet v0.28.1 h1:QRfx+jrzNgkLnMSw/nxGkAN7cjHPO446MDbjPITxLkk= -k8s.io/kubelet v0.28.1/go.mod h1:xYBbbJ0e2Rtb/hv+QFie448lFF81J990ImIptce2AHk= +k8s.io/kubelet v0.28.2 h1:wqe5zKtVhNWwtdABU0mpcWVe8hc6VdVvs2kqQridZRw= +k8s.io/kubelet v0.28.2/go.mod h1:rvd0e7T5TjPcfZvy62P90XhFzp0IhPIOy+Pqy3Rtipo= k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= From 909986be8a77960b000150c9ae5c794a3b0567f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 11:15:24 -0400 Subject: [PATCH 18/55] Bump go.uber.org/zap from 1.25.0 to 1.26.0 in /examples/splunk-hec/logging (#3654) * Bump go.uber.org/zap in /examples/splunk-hec/logging Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.25.0 to 1.26.0. - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/zap/compare/v1.25.0...v1.26.0) --- updated-dependencies: - dependency-name: go.uber.org/zap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update app name --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: jeffreyc-splunk --- examples/splunk-hec/logging/Dockerfile | 2 +- examples/splunk-hec/logging/go.mod | 2 +- examples/splunk-hec/logging/go.sum | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/splunk-hec/logging/Dockerfile b/examples/splunk-hec/logging/Dockerfile index 6291608436..7857ab06fb 100644 --- a/examples/splunk-hec/logging/Dockerfile +++ b/examples/splunk-hec/logging/Dockerfile @@ -9,4 +9,4 @@ RUN go get RUN go build -CMD /go/src/app/app +CMD /go/src/app/logging diff --git a/examples/splunk-hec/logging/go.mod b/examples/splunk-hec/logging/go.mod index 3da261754f..bae704860d 100644 --- a/examples/splunk-hec/logging/go.mod +++ b/examples/splunk-hec/logging/go.mod @@ -2,7 +2,7 @@ module github.com/signalfx/splunk-otel-collector/examples/splunk-hec/logging go 1.20 -require go.uber.org/zap v1.25.0 +require go.uber.org/zap v1.26.0 require go.uber.org/multierr v1.10.0 // indirect diff --git a/examples/splunk-hec/logging/go.sum b/examples/splunk-hec/logging/go.sum index c4b6d802b2..60d98fd7b4 100644 --- a/examples/splunk-hec/logging/go.sum +++ b/examples/splunk-hec/logging/go.sum @@ -1,10 +1,9 @@ -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From b965136061649b5a4f7fe6b5e9c23a5a8429ed01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 08:38:09 -0700 Subject: [PATCH 19/55] Bump github.com/antonmedv/expr from 1.15.1 to 1.15.2 in /internal/signalfx-agent (#3663) * Bump github.com/antonmedv/expr in /internal/signalfx-agent Bumps [github.com/antonmedv/expr](https://github.com/antonmedv/expr) from 1.15.1 to 1.15.2. - [Release notes](https://github.com/antonmedv/expr/releases) - [Commits](https://github.com/antonmedv/expr/compare/v1.15.1...v1.15.2) --- updated-dependencies: - dependency-name: github.com/antonmedv/expr dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- internal/signalfx-agent/go.mod | 2 +- internal/signalfx-agent/go.sum | 4 ++-- pkg/receiver/smartagentreceiver/go.mod | 2 +- pkg/receiver/smartagentreceiver/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index 5cb24e2b44..22ab4a98fe 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -31,7 +31,7 @@ require ( github.com/SAP/go-hdb v1.3.10 github.com/Sectorbob/mlab-ns2 v0.0.0-20171030222938-d3aa0c295a8a github.com/Showmax/go-fqdn v1.0.0 - github.com/antonmedv/expr v1.15.1 + github.com/antonmedv/expr v1.15.2 github.com/aws/aws-sdk-go v1.45.6 github.com/beevik/ntp v1.3.0 github.com/cloudfoundry-incubator/uaago v0.0.0-20190307164349-8136b7bbe76e diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index 2f8ed5c190..9261249eb5 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -134,8 +134,8 @@ github.com/aliyun/alibaba-cloud-sdk-go v1.62.301 h1:8mgvCpqsv3mQAcqZ/baAaMGUBj5J github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antonmedv/expr v1.15.1 h1:mxeRIkH8GQJo4MRRFgp0ArlV4AA+0DmcJNXEsG70rGU= -github.com/antonmedv/expr v1.15.1/go.mod h1:0E/6TxnOlRNp81GMzX9QfDPAmHo2Phg00y4JUv1ihsE= +github.com/antonmedv/expr v1.15.2 h1:afFXpDWIC2n3bF+kTZE1JvFo+c34uaM3sTqh8z0xfdU= +github.com/antonmedv/expr v1.15.2/go.mod h1:0E/6TxnOlRNp81GMzX9QfDPAmHo2Phg00y4JUv1ihsE= github.com/apache/arrow/go/v12 v12.0.1 h1:JsR2+hzYYjgSUkBSaahpqCetqZMr76djX80fF/DiJbg= github.com/apache/arrow/go/v12 v12.0.1/go.mod h1:weuTY7JvTG/HDPtMQxEUp7pU73vkLWMLpY67QwZ/WWw= github.com/apache/thrift v0.17.0 h1:cMd2aj52n+8VoAtvSvLn4kDC3aZ6IAkBuqWQ2IDu7wo= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index 793b0bb1d1..60391164b7 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -51,7 +51,7 @@ require ( github.com/StackExchange/wmi v1.2.1 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/andybalholm/brotli v1.0.4 // indirect - github.com/antonmedv/expr v1.15.1 // indirect + github.com/antonmedv/expr v1.15.2 // indirect github.com/apache/arrow/go/v12 v12.0.1 // indirect github.com/apache/thrift v0.19.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index bb12b41372..d8cdf3b5fb 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -133,8 +133,8 @@ github.com/aliyun/alibaba-cloud-sdk-go v1.62.301 h1:8mgvCpqsv3mQAcqZ/baAaMGUBj5J github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antonmedv/expr v1.15.1 h1:mxeRIkH8GQJo4MRRFgp0ArlV4AA+0DmcJNXEsG70rGU= -github.com/antonmedv/expr v1.15.1/go.mod h1:0E/6TxnOlRNp81GMzX9QfDPAmHo2Phg00y4JUv1ihsE= +github.com/antonmedv/expr v1.15.2 h1:afFXpDWIC2n3bF+kTZE1JvFo+c34uaM3sTqh8z0xfdU= +github.com/antonmedv/expr v1.15.2/go.mod h1:0E/6TxnOlRNp81GMzX9QfDPAmHo2Phg00y4JUv1ihsE= github.com/apache/arrow/go/v12 v12.0.1 h1:JsR2+hzYYjgSUkBSaahpqCetqZMr76djX80fF/DiJbg= github.com/apache/arrow/go/v12 v12.0.1/go.mod h1:weuTY7JvTG/HDPtMQxEUp7pU73vkLWMLpY67QwZ/WWw= github.com/apache/thrift v0.19.0 h1:sOqkWPzMj7w6XaYbJQG7m4sGqVolaW/0D28Ln7yPzMk= From 4b4cbdb9dd8de5bb6838699b62e71da905d2403c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 11:59:50 -0400 Subject: [PATCH 20/55] Bump google.golang.org/grpc from 1.57.0 to 1.58.1 in /internal/signalfx-agent (#3661) * Bump google.golang.org/grpc in /internal/signalfx-agent Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.57.0 to 1.58.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.57.0...v1.58.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- go.mod | 2 +- go.sum | 4 ++-- internal/signalfx-agent/go.mod | 2 +- internal/signalfx-agent/go.sum | 4 ++-- pkg/extension/smartagentextension/go.mod | 2 +- pkg/extension/smartagentextension/go.sum | 6 +++--- pkg/receiver/smartagentreceiver/go.mod | 2 +- pkg/receiver/smartagentreceiver/go.sum | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index abc9069216..52c4b0cd44 100644 --- a/go.mod +++ b/go.mod @@ -508,7 +508,7 @@ require ( google.golang.org/api v0.139.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect - google.golang.org/grpc v1.58.0 // indirect + google.golang.org/grpc v1.58.1 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/fsnotify.v1 v1.4.7 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect diff --git a/go.sum b/go.sum index 15d2aa7214..c5596dc244 100644 --- a/go.sum +++ b/go.sum @@ -2172,8 +2172,8 @@ google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o= -google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= +google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index 22ab4a98fe..a180e1c99f 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -93,7 +93,7 @@ require ( golang.org/x/sync v0.3.0 golang.org/x/sys v0.12.0 golang.org/x/tools v0.9.3 // indirect - google.golang.org/grpc v1.57.0 + google.golang.org/grpc v1.58.1 gopkg.in/go-playground/validator.v9 v9.31.0 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.28.2 diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index 9261249eb5..b218cd599d 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -1705,8 +1705,8 @@ google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= +google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/pkg/extension/smartagentextension/go.mod b/pkg/extension/smartagentextension/go.mod index af83720226..b5557cfc50 100644 --- a/pkg/extension/smartagentextension/go.mod +++ b/pkg/extension/smartagentextension/go.mod @@ -175,7 +175,7 @@ require ( google.golang.org/api v0.138.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect - google.golang.org/grpc v1.57.0 // indirect + google.golang.org/grpc v1.58.1 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index 8b11a3ef0a..65b48c4761 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -135,7 +135,7 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= @@ -886,8 +886,8 @@ 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.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= +google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index 60391164b7..16cf6bda04 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -307,7 +307,7 @@ require ( google.golang.org/api v0.138.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect - google.golang.org/grpc v1.58.0 // indirect + google.golang.org/grpc v1.58.1 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/fsnotify.v1 v1.4.7 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index d8cdf3b5fb..475c3054c3 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -1660,8 +1660,8 @@ google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o= -google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= +google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From 654df4f6654425ce12ade0f40b889327f48c8dfb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 12:40:14 -0400 Subject: [PATCH 21/55] Bump go.uber.org/zap from 1.25.0 to 1.26.0 in /pkg/receiver/smartagentreceiver (#3669) Dependabot couldn't find the original pull request head commit, 3a042d6eae89fc49e7e9b9d87cea779515e04d04. Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/receiver/smartagentreceiver/go.mod | 2 +- pkg/receiver/smartagentreceiver/go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index 16cf6bda04..4ed8791d00 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -25,7 +25,7 @@ require ( go.opentelemetry.io/collector/receiver v0.85.0 go.opentelemetry.io/otel/metric v1.17.0 go.opentelemetry.io/otel/trace v1.17.0 - go.uber.org/zap v1.25.0 + go.uber.org/zap v1.26.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index 475c3054c3..863c4cf786 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -203,7 +203,6 @@ github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J github.com/axiomhq/hyperloglog v0.0.0-20220105174342-98591331716a h1:eqjiAL3qooftPm8b9C1GsSSRcmlw7iOva8vdBTmV2PY= github.com/beevik/ntp v1.3.0 h1:/w5VhpW5BGKS37vFm1p9oVk/t4HnnkKZAZIubHM6F7Q= github.com/beevik/ntp v1.3.0/go.mod h1:vD6h1um4kzXpqmLTuu0cCLcC+NfvC0IC+ltmEDA8E78= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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= @@ -1255,8 +1254,8 @@ go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= From 1a0980e31bb088737349d5be79317b213a5b12e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:04:49 -0400 Subject: [PATCH 22/55] Bump github.com/aws/aws-sdk-go from 1.45.6 to 1.45.11 in /internal/signalfx-agent (#3667) * Bump github.com/aws/aws-sdk-go in /internal/signalfx-agent Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.6 to 1.45.11. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.45.6...v1.45.11) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: jeffreyc-splunk --- go.mod | 2 +- go.sum | 4 ++-- internal/signalfx-agent/go.mod | 2 +- internal/signalfx-agent/go.sum | 4 ++-- pkg/extension/smartagentextension/go.mod | 2 +- pkg/extension/smartagentextension/go.sum | 4 ++-- pkg/receiver/smartagentreceiver/go.mod | 2 +- pkg/receiver/smartagentreceiver/go.sum | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 52c4b0cd44..9733c5b132 100644 --- a/go.mod +++ b/go.mod @@ -234,7 +234,7 @@ require ( github.com/ardielle/ardielle-go v1.5.2 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/armon/go-radix v1.0.0 // indirect - github.com/aws/aws-sdk-go v1.45.6 // indirect + github.com/aws/aws-sdk-go v1.45.11 // indirect github.com/aws/aws-sdk-go-v2 v1.21.0 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.36 // indirect diff --git a/go.sum b/go.sum index c5596dc244..a2f824aa07 100644 --- a/go.sum +++ b/go.sum @@ -201,8 +201,8 @@ github.com/aws/aws-sdk-go v1.34.0/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU github.com/aws/aws-sdk-go v1.35.24/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= -github.com/aws/aws-sdk-go v1.45.6 h1:Y2isQQBZsnO15dzUQo9YQRThtHgrV200XCH05BRHVJI= -github.com/aws/aws-sdk-go v1.45.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.45.11 h1:8qiSrA12+NRr+2MVpMApi3JxtiFFjDVU1NeWe+80bYg= +github.com/aws/aws-sdk-go v1.45.11/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2 v1.17.7/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index a180e1c99f..ee12d9a838 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -32,7 +32,7 @@ require ( github.com/Sectorbob/mlab-ns2 v0.0.0-20171030222938-d3aa0c295a8a github.com/Showmax/go-fqdn v1.0.0 github.com/antonmedv/expr v1.15.2 - github.com/aws/aws-sdk-go v1.45.6 + github.com/aws/aws-sdk-go v1.45.11 github.com/beevik/ntp v1.3.0 github.com/cloudfoundry-incubator/uaago v0.0.0-20190307164349-8136b7bbe76e github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index b218cd599d..42d793fde5 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -153,8 +153,8 @@ github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl github.com/aws/aws-sdk-go v1.34.0/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.35.24/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= -github.com/aws/aws-sdk-go v1.45.6 h1:Y2isQQBZsnO15dzUQo9YQRThtHgrV200XCH05BRHVJI= -github.com/aws/aws-sdk-go v1.45.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.45.11 h1:8qiSrA12+NRr+2MVpMApi3JxtiFFjDVU1NeWe+80bYg= +github.com/aws/aws-sdk-go v1.45.11/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2 v1.17.7 h1:CLSjnhJSTSogvqUGhIC6LqFKATMRexcxLZ0i/Nzk9Eg= github.com/aws/aws-sdk-go-v2 v1.17.7/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= diff --git a/pkg/extension/smartagentextension/go.mod b/pkg/extension/smartagentextension/go.mod index b5557cfc50..b89ace0747 100644 --- a/pkg/extension/smartagentextension/go.mod +++ b/pkg/extension/smartagentextension/go.mod @@ -20,7 +20,7 @@ require ( github.com/Microsoft/go-winio v0.6.1 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/armon/go-radix v1.0.0 // indirect - github.com/aws/aws-sdk-go v1.45.6 // indirect + github.com/aws/aws-sdk-go v1.45.11 // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/containerd/containerd v1.7.0 // indirect diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index 65b48c4761..d4d17e1257 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -55,8 +55,8 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= github.com/aws/aws-sdk-go v1.34.0/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.45.6 h1:Y2isQQBZsnO15dzUQo9YQRThtHgrV200XCH05BRHVJI= -github.com/aws/aws-sdk-go v1.45.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.45.11 h1:8qiSrA12+NRr+2MVpMApi3JxtiFFjDVU1NeWe+80bYg= +github.com/aws/aws-sdk-go v1.45.11/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index 4ed8791d00..e5b03724ed 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -56,7 +56,7 @@ require ( github.com/apache/thrift v0.19.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/armon/go-radix v1.0.0 // indirect - github.com/aws/aws-sdk-go v1.45.6 // indirect + github.com/aws/aws-sdk-go v1.45.11 // indirect github.com/aws/aws-sdk-go-v2 v1.17.7 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.18 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index 863c4cf786..5c4ae90486 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -150,8 +150,8 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/aws/aws-sdk-go v1.34.0/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.35.24/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= -github.com/aws/aws-sdk-go v1.45.6 h1:Y2isQQBZsnO15dzUQo9YQRThtHgrV200XCH05BRHVJI= -github.com/aws/aws-sdk-go v1.45.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.45.11 h1:8qiSrA12+NRr+2MVpMApi3JxtiFFjDVU1NeWe+80bYg= +github.com/aws/aws-sdk-go v1.45.11/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2 v1.17.7 h1:CLSjnhJSTSogvqUGhIC6LqFKATMRexcxLZ0i/Nzk9Eg= github.com/aws/aws-sdk-go-v2 v1.17.7/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= From 6104067a40902ab76f0073bf36c121815afcad16 Mon Sep 17 00:00:00 2001 From: Jeff Cheng <83052155+jeffreyc-splunk@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:06:03 -0400 Subject: [PATCH 23/55] Update bundle caching in CI to save time and disk space (#3672) --- .gitlab-ci.yml | 4 --- .../signalfx-agent/bundle/scripts/build.sh | 25 ++++++++++--------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 23daac4805..89f75f1995 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -216,10 +216,6 @@ agent-bundle-linux: TAG: arm tags: - $TAG - cache: - key: agent-bundle-${ARCH} - paths: - - .cache/buildx/agent-bundle-${ARCH} script: - *docker-reader-role - docker login -u $CIRCLECI_QUAY_USERNAME -p $CIRCLECI_QUAY_PASSWORD quay.io diff --git a/internal/signalfx-agent/bundle/scripts/build.sh b/internal/signalfx-agent/bundle/scripts/build.sh index 9eea626231..654ee0736c 100755 --- a/internal/signalfx-agent/bundle/scripts/build.sh +++ b/internal/signalfx-agent/bundle/scripts/build.sh @@ -42,21 +42,11 @@ ALL_STAGES=$( grep '^FROM .* as .*' ${SCRIPT_DIR}/../Dockerfile | sed -e 's/.*as export DOCKER_BUILDKIT=1 -if [[ "$CI" = "true" || "$PUSH_CACHE" = "yes" ]]; then +if [[ "$CI" = "true" ]]; then # create and use the docker-container builder for caching when running in github or gitlab docker buildx create --name $IMAGE_NAME --driver docker-container || true BUILDER="--builder ${IMAGE_NAME}" DOCKER_OPTS="$BUILDER $DOCKER_OPTS" - if [[ -d "$CACHE_DIR" ]]; then - # use the restored CI cache if it exists - CACHE_FROM_OPTS="--cache-from=type=local,src=${CACHE_DIR}" - USE_REGISTRY_CACHE="no" - if [[ "${BUNDLE_CACHE_HIT:-}" != "true" ]]; then - # export current build cache to temporary directory - CACHE_TEMP_DIR="$(mktemp -d)" - CACHE_TO_OPTS="--cache-to=type=local,mode=max,dest=${CACHE_TEMP_DIR}" - fi - fi fi if [[ "$PUSH_CACHE" = "yes" ]]; then @@ -67,9 +57,20 @@ if [[ "$PUSH_CACHE" = "yes" ]]; then --tag $stage_image \ --target $stage \ --push \ - $CACHE_TO_OPTS --cache-to=type=inline \ + --cache-to=type=inline \ $DOCKER_OPTS done +else + if [[ -d "$CACHE_DIR" ]]; then + # only use the restored CI cache if it exists to save time and disk space + CACHE_FROM_OPTS="--cache-from=type=local,src=${CACHE_DIR}" + USE_REGISTRY_CACHE="no" + fi + if [[ "$CI" = "true" && "${BUNDLE_CACHE_HIT:-}" != "true" ]]; then + # only export local build cache to replace the existing CI cache when there are changes + CACHE_TEMP_DIR="$(mktemp -d)" + CACHE_TO_OPTS="--cache-to=type=local,mode=max,dest=${CACHE_TEMP_DIR}" + fi fi if [[ "$USE_REGISTRY_CACHE" = "yes" ]]; then From c901668e703257bb5291d82fecbbaeaca4153bf0 Mon Sep 17 00:00:00 2001 From: Jeff Cheng <83052155+jeffreyc-splunk@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:46:44 -0400 Subject: [PATCH 24/55] Add retries for signing jobs (#3674) --- .gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 89f75f1995..f5aaa2f677 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -278,6 +278,7 @@ sign-exe: - .trigger-filter - .submit-signing-request stage: sign-binaries + retry: 2 needs: - compile parallel: @@ -296,6 +297,7 @@ sign-osx: - .trigger-filter - .submit-signing-request stage: sign-binaries + retry: 2 needs: - compile parallel: @@ -405,6 +407,7 @@ sign-debs: - .trigger-filter - .submit-signing-request stage: sign-packages + retry: 2 needs: - build-deb - instrumentation-deb @@ -427,6 +430,7 @@ sign-rpms: - .trigger-filter - .submit-signing-request stage: sign-packages + retry: 2 needs: - build-rpm - instrumentation-rpm @@ -449,6 +453,7 @@ sign-tar: - .trigger-filter - .submit-signing-request stage: sign-packages + retry: 2 needs: - build-tar variables: @@ -472,6 +477,7 @@ sign-msi: - .trigger-filter - .submit-signing-request stage: sign-packages + retry: 2 needs: - build-msi variables: @@ -493,6 +499,7 @@ sign-agent-bundles: - .trigger-filter - .submit-signing-request stage: sign-packages + retry: 2 needs: - agent-bundle-linux - agent-bundle-windows @@ -520,6 +527,7 @@ sign-ps-installer: - .trigger-filter - .submit-signing-request stage: sign-packages + retry: 2 dependencies: [] variables: ARTIFACT: dist/install.ps1 @@ -814,6 +822,7 @@ sign-apt-metadata: - .trigger-filter - .submit-signing-request stage: sign-metadata + retry: 2 resource_group: artifactory-deb needs: - release-debs @@ -832,6 +841,7 @@ sign-yum-metadata: - .trigger-filter - .submit-signing-request stage: sign-metadata + retry: 2 parallel: matrix: - ARCH: ['x86_64', 'aarch64'] From 475062129db5b4ffbd31f10f7492a1ed1b0161eb Mon Sep 17 00:00:00 2001 From: Samiur Arif Date: Tue, 19 Sep 2023 17:48:19 -0700 Subject: [PATCH 25/55] removed Tap writer (#3676) --- .../signalfx-agent/pkg/core/diagnostics.go | 3 +- .../signalfx-agent/pkg/core/writer/multi.go | 9 --- .../pkg/core/writer/signalfx/writer.go | 11 ---- .../signalfx-agent/pkg/core/writer/tap/tap.go | 63 ------------------- 4 files changed, 1 insertion(+), 85 deletions(-) delete mode 100644 internal/signalfx-agent/pkg/core/writer/tap/tap.go diff --git a/internal/signalfx-agent/pkg/core/diagnostics.go b/internal/signalfx-agent/pkg/core/diagnostics.go index e9ba69a174..0c6b9f44af 100644 --- a/internal/signalfx-agent/pkg/core/diagnostics.go +++ b/internal/signalfx-agent/pkg/core/diagnostics.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/url" "runtime" @@ -69,7 +68,7 @@ func readStatusInfo(host string, port uint16, section string) ([]byte, error) { } defer resp.Body.Close() - return ioutil.ReadAll(resp.Body) + return io.ReadAll(resp.Body) } func (a *Agent) internalMetricsHandler(rw http.ResponseWriter, req *http.Request) { diff --git a/internal/signalfx-agent/pkg/core/writer/multi.go b/internal/signalfx-agent/pkg/core/writer/multi.go index 6a954957dc..46e2462c67 100644 --- a/internal/signalfx-agent/pkg/core/writer/multi.go +++ b/internal/signalfx-agent/pkg/core/writer/multi.go @@ -9,7 +9,6 @@ import ( "github.com/signalfx/signalfx-agent/pkg/core/config" "github.com/signalfx/signalfx-agent/pkg/core/writer/signalfx" "github.com/signalfx/signalfx-agent/pkg/core/writer/splunk" - "github.com/signalfx/signalfx-agent/pkg/core/writer/tap" "github.com/signalfx/signalfx-agent/pkg/core/writer/tracetracker" "github.com/signalfx/signalfx-agent/pkg/monitors/types" "github.com/signalfx/signalfx-agent/pkg/utils" @@ -130,11 +129,3 @@ func (w *MultiWriter) DiagnosticText() string { } return "No writer information available" } - -// SetTap allows you to set one datapoint tap at a time to inspect datapoints -// going out of the agent. -func (w *MultiWriter) SetTap(dpTap *tap.DatapointTap) { - if w.signalFxWriter != nil { - w.signalFxWriter.SetTap(dpTap) - } -} diff --git a/internal/signalfx-agent/pkg/core/writer/signalfx/writer.go b/internal/signalfx-agent/pkg/core/writer/signalfx/writer.go index 42fa7ce523..594348c96a 100644 --- a/internal/signalfx-agent/pkg/core/writer/signalfx/writer.go +++ b/internal/signalfx-agent/pkg/core/writer/signalfx/writer.go @@ -32,7 +32,6 @@ import ( "github.com/signalfx/signalfx-agent/pkg/core/config" "github.com/signalfx/signalfx-agent/pkg/core/writer/dimensions" "github.com/signalfx/signalfx-agent/pkg/core/writer/processor" - "github.com/signalfx/signalfx-agent/pkg/core/writer/tap" "github.com/signalfx/signalfx-agent/pkg/core/writer/tracetracker" "github.com/signalfx/signalfx-agent/pkg/monitors/types" "github.com/signalfx/signalfx-agent/pkg/utils" @@ -64,7 +63,6 @@ type Writer struct { cancel context.CancelFunc conf *config.WriterConfig logger *utils.ThrottledLogger - dpTap *tap.DatapointTap // map that holds host-specific ids like AWSUniqueID hostIDDims map[string]string @@ -291,9 +289,6 @@ func (sw *Writer) sendDatapoints(ctx context.Context, dps []*datapoint.Datapoint sw.logger.Debugf("Sent %d datapoints out of the agent", len(dps)) - // dpTap.Accept handles the receiver being nil - sw.dpTap.Accept(dps) - return nil } @@ -394,12 +389,6 @@ func (sw *Writer) listenForEventsAndDimensionUpdates() { } } -// SetTap allows you to set one datapoint tap at a time to inspect datapoints -// going out of the agent. -func (sw *Writer) SetTap(dpTap *tap.DatapointTap) { - sw.dpTap = dpTap -} - // Shutdown the writer and stop sending datapoints func (sw *Writer) Shutdown() { if sw.cancel != nil { diff --git a/internal/signalfx-agent/pkg/core/writer/tap/tap.go b/internal/signalfx-agent/pkg/core/writer/tap/tap.go deleted file mode 100644 index 2e18d6f11f..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/tap/tap.go +++ /dev/null @@ -1,63 +0,0 @@ -package tap - -import ( - "context" - "io" - "net/http" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/signalfx-agent/pkg/core/dpfilters" - "github.com/signalfx/signalfx-agent/pkg/utils" - "github.com/sirupsen/logrus" -) - -// DatapointTap accepts datapoints and asynchronouly writes a string -// representation of them to the output, filtering as requested. -type DatapointTap struct { - filter dpfilters.DatapointFilter - out io.Writer - buffer chan []*datapoint.Datapoint -} - -// New makes a new tap -func New(filter dpfilters.DatapointFilter, out io.Writer) *DatapointTap { - return &DatapointTap{ - filter: filter, - out: out, - buffer: make(chan []*datapoint.Datapoint, 100), - } -} - -// Run the tap and write out datapoints -func (t *DatapointTap) Run(ctx context.Context) { - for { - select { - case <-ctx.Done(): - return - case dps := <-t.buffer: - for _, dp := range dps { - if t.filter != nil && !t.filter.Matches(dp) { - continue - } - _, _ = t.out.Write([]byte(utils.DatapointToString(dp))) - if f, ok := t.out.(http.Flusher); ok { - f.Flush() - } - } - } - } -} - -// Accept should be called by the writer with every datapoint -func (t *DatapointTap) Accept(dps []*datapoint.Datapoint) { - if t == nil { - return - } - - select { - case t.buffer <- dps: - break - default: - logrus.Error("Could not process datapoint in tap due to full buffer") - } -} From a49c7984607478889f1c468e2e1f72b307fb6852 Mon Sep 17 00:00:00 2001 From: weliasz <77732905+weliasz@users.noreply.github.com> Date: Wed, 20 Sep 2023 19:33:19 +0200 Subject: [PATCH 26/55] =?UTF-8?q?feat:=20filelog=20receiver=20config=20equ?= =?UTF-8?q?ivalent=20to=20Splunk=20Addon=20for=20Unix=20and=E2=80=A6=20(#3?= =?UTF-8?q?271)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: filelog receiver config equivalent to Splunk Addon for Unix and Linux File and Directory Inputs * Update cmd/otelcol/config/collector/full_config_linux.yaml Co-authored-by: Antoine Toulme --------- Co-authored-by: Antoine Toulme --- .../config/collector/full_config_linux.yaml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/cmd/otelcol/config/collector/full_config_linux.yaml b/cmd/otelcol/config/collector/full_config_linux.yaml index d0734937e1..e5cad4ea8f 100644 --- a/cmd/otelcol/config/collector/full_config_linux.yaml +++ b/cmd/otelcol/config/collector/full_config_linux.yaml @@ -167,6 +167,48 @@ receivers: fluentforward: endpoint: 0.0.0.0:8006 + # Enables filelog receiver + # Full configuration here: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/filelogreceiver + filelog: + include: + - /Library/Logs/* + - /var/log/*.log* + - /var/log/*log + - /var/log/*messages* + - /var/log/*secure* + - /var/log/*auth* + - /var/log/*mesg + - /var/log/*cron + - /var/log/*acpid + - /var/log/*.out* + - /var/adm/*.log* + - /var/adm/*log + - /var/adm/*messages* + - /etc/*.conf* + - /etc/*.cfg* + - /etc/*config + - /etc/*.ini* + - /etc/*.init* + - /etc/*.cf* + - /etc/*.cnf* + - /etc/*shrc + - /etc/ifcfg* + - /etc/*.profile* + - /etc/*.rc* + - /etc/*.rules* + - /etc/*.tab* + - /etc/*tab + - /etc/*.login* + - /etc/*policy + - /root/.bash_history + - /home/*/.bash_history + exclude: + - /var/log/*lastlog* + - /var/log/*anaconda.syslog* + + include_file_name: false + include_file_path: true + ############################################################################### # Processors # What to do with data as it passes from receivers to exporters From aba2a58f9b7e828ce4a59c6b539e4dba475cdcca Mon Sep 17 00:00:00 2001 From: Jeff Cheng <83052155+jeffreyc-splunk@users.noreply.github.com> Date: Thu, 21 Sep 2023 11:57:24 -0400 Subject: [PATCH 27/55] Fix links (#3681) * Update docker.md * Update README.md * Ignore doc-only changes for nomad workflow --- .github/workflows/nomad.yml | 1 + deployments/nomad/README.md | 2 +- docs/docker.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nomad.yml b/.github/workflows/nomad.yml index 485894a831..1a62ca6e75 100644 --- a/.github/workflows/nomad.yml +++ b/.github/workflows/nomad.yml @@ -8,6 +8,7 @@ on: paths: - 'deployments/nomad/**' - '.github/workflows/nomad.yml' + - '!**.md' permissions: contents: write diff --git a/deployments/nomad/README.md b/deployments/nomad/README.md index 7402f29e0e..bd40b668a2 100644 --- a/deployments/nomad/README.md +++ b/deployments/nomad/README.md @@ -1,6 +1,6 @@ # Splunk OpenTelemetry Collector for HashiCorp Nomad -The Splunk OpenTelemetry Collector for HashiCorp Nomad is an orchestrator deployment to create a job which provides a unified way to receive, process and export metric, and trace data for [Splunk Observability Cloud](https://www.observability.splunk.com/). +The Splunk OpenTelemetry Collector for HashiCorp Nomad is an orchestrator deployment to create a job which provides a unified way to receive, process and export metric, and trace data for [Splunk Observability Cloud](https://docs.splunk.com/Observability). **NOTE**: _Job files are provided as a reference only and are not intended for production use._ diff --git a/docs/docker.md b/docs/docker.md index 003ad8db8d..5614c2d444 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -1,6 +1,6 @@ # Docker Component Requirements -This distribution includes the [Docker container stats monitor](https://docs.splunk.com/Observability/gdi/docker/docker.html) +This distribution includes the [Docker container stats monitor](https://docs.splunk.com/Observability/en/gdi/monitors-hosts/docker.html) via the [Smart Agent Receiver](../pkg/receiver/smartagentreceiver/README.md) to provide the ability to report metrics from containers running on your system. It also includes the [Docker Observer Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/observer/dockerobserver) to enable dynamically instantiating your receivers using the [Receiver Creator](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/receivercreator/README.md) as target service containers From 4e2c16f099b404d795a289ad52b5267adcf164a2 Mon Sep 17 00:00:00 2001 From: Jeff Cheng <83052155+jeffreyc-splunk@users.noreply.github.com> Date: Thu, 21 Sep 2023 14:18:41 -0400 Subject: [PATCH 28/55] Include splunk.zc.method attribute for windows installer script (#3675) * Include splunk.zc.method attribute for windows installer script * update test yamls with signalfx-dotnet-tracing release version --- .github/workflows/win-package-test.yml | 16 ++++++++++++++++ .../buildscripts/packaging/installer/install.ps1 | 7 +++++++ .../testdata/resource_traces/aspnetcore.yaml | 1 + .../testdata/resource_traces/aspnetfx.yaml | 2 ++ 4 files changed, 26 insertions(+) diff --git a/.github/workflows/win-package-test.yml b/.github/workflows/win-package-test.yml index a6d6c34896..be5f8fce34 100644 --- a/.github/workflows/win-package-test.yml +++ b/.github/workflows/win-package-test.yml @@ -158,6 +158,22 @@ jobs: name: msi-build path: ./tests/zeroconfig/windows/testdata/docker-setup/ + - name: Get latest signalfx-dotnet-tracing release + id: dotnet-tracing + uses: pozetroninc/github-action-get-latest-release@v0.7.0 + with: + owner: signalfx + repo: signalfx-dotnet-tracing + excludes: prerelease, draft + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set SIGNALFX_DOTNET_TRACING_VERSION + run: | + version="${{ steps.dotnet-tracing.outputs.release }}" + sed -i "s|SIGNALFX_DOTNET_TRACING_VERSION|${version#v}|" tests/zeroconfig/windows/testdata/resource_traces/aspnetcore.yaml + sed -i "s|SIGNALFX_DOTNET_TRACING_VERSION|${version#v}|" tests/zeroconfig/windows/testdata/resource_traces/aspnetfx.yaml + shell: bash + - name: Run the test script working-directory: tests/zeroconfig/windows/ run: | diff --git a/internal/buildscripts/packaging/installer/install.ps1 b/internal/buildscripts/packaging/installer/install.ps1 index e14cdc58aa..3af3746ea2 100644 --- a/internal/buildscripts/packaging/installer/install.ps1 +++ b/internal/buildscripts/packaging/installer/install.ps1 @@ -669,6 +669,13 @@ if ($with_dotnet_instrumentation) { echo "SIGNALFX_ENV environment variable not set. Unless otherwise defined, will appear as 'unknown' in the UI." } + try { + $dotnet_version = (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where { $_.DisplayName -eq "SignalFx .NET Tracing 64-bit" }).DisplayVersion + update_registry -path "$regkey" -name "SIGNALFX_GLOBAL_TAGS" "splunk.zc.method:signalfx-dotnet-tracing-${dotnet_version}" + } catch { + continue + } + $message = " SignalFx .NET Instrumentation has been installed and configured to forward traces to the Splunk OpenTelemetry Collector. By default, .NET Instrumentation will automatically generate traces for applications running on IIS. diff --git a/tests/zeroconfig/windows/testdata/resource_traces/aspnetcore.yaml b/tests/zeroconfig/windows/testdata/resource_traces/aspnetcore.yaml index 044a5148f1..0a982fd874 100644 --- a/tests/zeroconfig/windows/testdata/resource_traces/aspnetcore.yaml +++ b/tests/zeroconfig/windows/testdata/resource_traces/aspnetcore.yaml @@ -21,3 +21,4 @@ resource_spans: net.peer.ip: signalfx.tracing.library: dotnet-tracing signalfx.tracing.version: + splunk.zc.method: signalfx-dotnet-tracing-SIGNALFX_DOTNET_TRACING_VERSION diff --git a/tests/zeroconfig/windows/testdata/resource_traces/aspnetfx.yaml b/tests/zeroconfig/windows/testdata/resource_traces/aspnetfx.yaml index 2a082d9ca9..a3bb66f2bf 100644 --- a/tests/zeroconfig/windows/testdata/resource_traces/aspnetfx.yaml +++ b/tests/zeroconfig/windows/testdata/resource_traces/aspnetfx.yaml @@ -18,6 +18,7 @@ resource_spans: net.peer.ip: signalfx.tracing.library: dotnet-tracing signalfx.tracing.version: + splunk.zc.method: signalfx-dotnet-tracing-SIGNALFX_DOTNET_TRACING_VERSION - name: GET /api/values/{id} attributes: aspnet.controller: values @@ -28,3 +29,4 @@ resource_spans: http.url: http://localhost/aspnetfxapp/api/values/4 http.user_agent: Go-http-client/1.1 net.peer.ip: + splunk.zc.method: signalfx-dotnet-tracing-SIGNALFX_DOTNET_TRACING_VERSION From 71a350bf37e7749974eac99d1a53d7f502780acc Mon Sep 17 00:00:00 2001 From: Samiur Arif Date: Thu, 21 Sep 2023 14:56:38 -0700 Subject: [PATCH 29/55] removed agent/status (#3678) * removed agent/status * removed agent/status --- go.mod | 3 - go.sum | 7 - internal/signalfx-agent/go.mod | 2 - internal/signalfx-agent/go.sum | 5 - internal/signalfx-agent/pkg/core/agent.go | 262 ---------- .../signalfx-agent/pkg/core/diagnostics.go | 162 ------ internal/signalfx-agent/pkg/core/status.go | 63 --- .../pkg/core/writer/dimensions/client.go | 356 ------------- .../pkg/core/writer/dimensions/client_test.go | 494 ------------------ .../pkg/core/writer/dimensions/dedup.go | 100 ---- .../pkg/core/writer/dimensions/diagnostics.go | 25 - .../signalfx-agent/pkg/core/writer/multi.go | 131 ----- .../pkg/core/writer/processor/processor.go | 137 ----- .../pkg/core/writer/signalfx/diagnostics.go | 82 --- .../pkg/core/writer/signalfx/spans.go | 95 ---- .../pkg/core/writer/signalfx/writer.go | 398 -------------- .../pkg/core/writer/signalfx/writer_test.go | 79 --- .../core/writer/splunk/log_event_ring.gen.go | 118 ----- .../writer/splunk/log_event_writer.gen.go | 323 ------------ .../pkg/core/writer/splunk/splunk.go | 313 ----------- .../pkg/core/writer/splunk/splunk_test.go | 103 ---- .../pkg/core/writer/splunk/types.go | 64 --- .../pkg/core/writer/tracetracker/host.go | 123 ----- .../pkg/core/writer/tracetracker/host_test.go | 120 ----- pkg/receiver/smartagentreceiver/go.mod | 4 - pkg/receiver/smartagentreceiver/go.sum | 9 - 26 files changed, 3578 deletions(-) delete mode 100644 internal/signalfx-agent/pkg/core/agent.go delete mode 100644 internal/signalfx-agent/pkg/core/diagnostics.go delete mode 100644 internal/signalfx-agent/pkg/core/status.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/dimensions/client.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/dimensions/client_test.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/dimensions/dedup.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/dimensions/diagnostics.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/multi.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/processor/processor.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/signalfx/diagnostics.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/signalfx/spans.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/signalfx/writer.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/signalfx/writer_test.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/splunk/log_event_ring.gen.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/splunk/log_event_writer.gen.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/splunk/splunk.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/splunk/splunk_test.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/splunk/types.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/tracetracker/host.go delete mode 100644 internal/signalfx-agent/pkg/core/writer/tracetracker/host_test.go diff --git a/go.mod b/go.mod index 9733c5b132..bec34ee501 100644 --- a/go.mod +++ b/go.mod @@ -256,7 +256,6 @@ require ( github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 // indirect github.com/containerd/containerd v1.7.3 // indirect github.com/coreos/go-semver v0.3.0 // indirect - github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/denisenkom/go-mssqldb v0.12.3 // indirect @@ -388,7 +387,6 @@ require ( github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mattn/go-xmlrpc v0.0.3 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mauricelam/genny v0.0.0-20190320071652-0800202903e5 // indirect github.com/miekg/dns v1.1.55 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect @@ -452,7 +450,6 @@ require ( github.com/signalfx/ingest-protocols v0.2.0 // indirect github.com/signalfx/sapm-proto v0.13.0 // indirect github.com/signalfx/signalfx-agent/pkg/apm v0.0.0-20230222185249-54e5d1064c5b // indirect - github.com/signalfx/signalfx-go v1.33.0 // indirect github.com/sijms/go-ora/v2 v2.7.17 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/snowflakedb/gosnowflake v1.6.24 // indirect diff --git a/go.sum b/go.sum index a2f824aa07..7a5abb25a9 100644 --- a/go.sum +++ b/go.sum @@ -330,8 +330,6 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= -github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= @@ -997,8 +995,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mauricelam/genny v0.0.0-20190320071652-0800202903e5 h1:PnFl95tWh3j7c5DebZG/TGsBJvbnHvPjK4lzltouI4Y= -github.com/mauricelam/genny v0.0.0-20190320071652-0800202903e5/go.mod h1:i2AazGGunAlAR5u0zXGYVmIT7nnwE6j9lwKSMx7N6ko= github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -1465,8 +1461,6 @@ github.com/signalfx/ingest-protocols v0.2.0 h1:axbmVg8eLoBh3wNmwBG9O/2jMjfzCVP7M github.com/signalfx/ingest-protocols v0.2.0/go.mod h1:CYKWPtxFWF9RCUGfN0Hh6javdTTqediTCbXFbW0BF60= github.com/signalfx/sapm-proto v0.13.0 h1:yEkp1+MAU4vZvnJMp56uhVlRjlvCK7KQjBg0g2Apw8k= github.com/signalfx/sapm-proto v0.13.0/go.mod h1:C72HjeCW5v0Llk6pIVJ/ZH8A5GbiZpCCSkE1dSlpWxY= -github.com/signalfx/signalfx-go v1.33.0 h1:+v1fa+is8rYSxGoN1W+9PiDj1dCF5sVjJx60dhNLsTA= -github.com/signalfx/signalfx-go v1.33.0/go.mod h1:IpGZLPvCKNFyspAXoS480jB02mocTpo0KYd8jbl6/T8= github.com/signalfx/telegraf v0.10.2-0.20210820123244-82265917ca87 h1:ayeUHxiUjcxzuEzjWVkXJxf42UYNw8UKmYmIQu9mAqo= github.com/signalfx/telegraf v0.10.2-0.20210820123244-82265917ca87/go.mod h1:1gnMOcwGO3lAxfoMq28M8gjooF2MqVwquPVEvgZ1its= github.com/sijms/go-ora/v2 v2.7.17 h1:M/pYIqjaMUeBxyzOWp2oj4ntF6fHSBloJWGNH9vbmsU= @@ -1965,7 +1959,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190319232107-3f1ed9edd1b4/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index ee12d9a838..525836e774 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -60,7 +60,6 @@ require ( github.com/lib/pq v1.10.9 github.com/mailru/easyjson v0.7.7 github.com/mattn/go-xmlrpc v0.0.3 - github.com/mauricelam/genny v0.0.0-20190320071652-0800202903e5 // indirect github.com/mitchellh/go-wordwrap v1.0.1 github.com/mitchellh/hashstructure v1.1.0 github.com/mongodb/go-client-mongodb-atlas v0.2.0 @@ -81,7 +80,6 @@ require ( github.com/signalfx/defaults v1.2.2-0.20180531161417-70562fe60657 github.com/signalfx/golib/v3 v3.3.53 github.com/signalfx/ingest-protocols v0.2.0 - github.com/signalfx/signalfx-go v1.33.0 github.com/sirupsen/logrus v1.9.3 github.com/snowflakedb/gosnowflake v1.6.24 github.com/stretchr/testify v1.8.4 diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index 42d793fde5..b1fb13d325 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -810,8 +810,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mauricelam/genny v0.0.0-20190320071652-0800202903e5 h1:PnFl95tWh3j7c5DebZG/TGsBJvbnHvPjK4lzltouI4Y= -github.com/mauricelam/genny v0.0.0-20190320071652-0800202903e5/go.mod h1:i2AazGGunAlAR5u0zXGYVmIT7nnwE6j9lwKSMx7N6ko= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= @@ -1044,8 +1042,6 @@ github.com/signalfx/ingest-protocols v0.2.0 h1:axbmVg8eLoBh3wNmwBG9O/2jMjfzCVP7M github.com/signalfx/ingest-protocols v0.2.0/go.mod h1:CYKWPtxFWF9RCUGfN0Hh6javdTTqediTCbXFbW0BF60= github.com/signalfx/sapm-proto v0.12.0 h1:OtOe+Jm8L61Ml8K6X8a89zc8/RlaaMRElCImeGKR/Ew= github.com/signalfx/sapm-proto v0.12.0/go.mod h1:wQEki8RNCYjkv19jw5aWDcmDMTQru0ckfUbgHI69U2E= -github.com/signalfx/signalfx-go v1.33.0 h1:+v1fa+is8rYSxGoN1W+9PiDj1dCF5sVjJx60dhNLsTA= -github.com/signalfx/signalfx-go v1.33.0/go.mod h1:IpGZLPvCKNFyspAXoS480jB02mocTpo0KYd8jbl6/T8= github.com/signalfx/telegraf v0.10.2-0.20211029142026-90d18852ba43 h1:fVPG62geE+RNJihAuqOr6w9cBaXH+4iRPj0gwM/thHc= github.com/signalfx/telegraf v0.10.2-0.20211029142026-90d18852ba43/go.mod h1:1gnMOcwGO3lAxfoMq28M8gjooF2MqVwquPVEvgZ1its= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -1503,7 +1499,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190319232107-3f1ed9edd1b4/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= diff --git a/internal/signalfx-agent/pkg/core/agent.go b/internal/signalfx-agent/pkg/core/agent.go deleted file mode 100644 index 44254035ee..0000000000 --- a/internal/signalfx-agent/pkg/core/agent.go +++ /dev/null @@ -1,262 +0,0 @@ -// Package core contains the central frame of the agent that hooks up the -// various subsystems. -package core - -import ( - "context" - "io" - "net/http" - "os" - "time" - - log "github.com/sirupsen/logrus" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/event" - "github.com/signalfx/golib/v3/trace" - - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/hostid" - "github.com/signalfx/signalfx-agent/pkg/core/meta" - "github.com/signalfx/signalfx-agent/pkg/core/services" - "github.com/signalfx/signalfx-agent/pkg/core/writer" - "github.com/signalfx/signalfx-agent/pkg/core/writer/tracetracker" - "github.com/signalfx/signalfx-agent/pkg/monitors" - "github.com/signalfx/signalfx-agent/pkg/monitors/types" - "github.com/signalfx/signalfx-agent/pkg/observers" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -//go:generate sh -c "test -e `go env GOPATH`/bin/genny > /dev/null || (cd ../.. && go install github.com/mauricelam/genny)" - -const ( - // Items should stay in these channels only very briefly as there should be - // goroutines dedicated to pulling them at all times. Having the capacity - // be non-zero is more an optimization to keep monitors from seizing up - // under extremely heavy load. - datapointChanCapacity = 3000 - eventChanCapacity = 100 - dimensionChanCapacity = 100 - traceSpanChanCapacity = 3000 -) - -// Agent is what hooks up observers, monitors, and the datapoint writer. -type Agent struct { - observers *observers.ObserverManager - monitors *monitors.MonitorManager - writer *writer.MultiWriter - meta *meta.AgentMeta - lastConfig *config.Config - dpChan chan []*datapoint.Datapoint - eventChan chan *event.Event - dimensionChan chan *types.Dimension - spanChan chan []*trace.Span - endpointHostTracker *services.EndpointHostTracker - - diagnosticServer *http.Server - profileServerRunning bool - startTime time.Time -} - -// NewAgent creates an unconfigured agent instance -func NewAgent() *Agent { - agent := Agent{ - dpChan: make(chan []*datapoint.Datapoint, datapointChanCapacity), - eventChan: make(chan *event.Event, eventChanCapacity), - dimensionChan: make(chan *types.Dimension, dimensionChanCapacity), - spanChan: make(chan []*trace.Span, traceSpanChanCapacity), - endpointHostTracker: services.NewEndpointHostTracker(), - startTime: time.Now(), - } - - agent.observers = &observers.ObserverManager{ - CallbackTargets: &observers.ServiceCallbacks{ - Added: agent.endpointAdded, - Removed: agent.endpointRemoved, - }, - } - - agent.meta = &meta.AgentMeta{} - agent.monitors = monitors.NewMonitorManager(agent.meta) - agent.monitors.DPs = agent.dpChan - agent.monitors.Events = agent.eventChan - agent.monitors.DimensionUpdates = agent.dimensionChan - agent.monitors.TraceSpans = agent.spanChan - return &agent -} - -func (a *Agent) configure(conf *config.Config) { - log.SetFormatter(conf.Logging.LogrusFormatter()) - - level := conf.Logging.LogrusLevel() - if level != nil { - log.SetLevel(*level) - } - - log.Infof("Using log level %s", log.GetLevel().String()) - - hostDims := map[string]string{} - if !conf.DisableHostDimensions { - hostDims = hostid.Dimensions(conf) - log.Infof("Using host id dimensions %v", hostDims) - conf.Writer.HostIDDims = hostDims - } - - if conf.EnableProfiling { - a.ensureProfileServerRunning(conf.ProfilingHost, conf.ProfilingPort) - } - - if a.lastConfig == nil || a.lastConfig.Writer.Hash() != conf.Writer.Hash() || a.lastConfig.Cluster != conf.Cluster { - if a.writer != nil { - a.writer.Shutdown() - } - - spanSourceTracker := tracetracker.NewSpanSourceTracker(a.endpointHostTracker, a.dimensionChan, conf.Cluster) - - var err error - a.writer, err = writer.New( - &conf.Writer, - a.dpChan, - a.eventChan, - a.dimensionChan, - a.spanChan, - spanSourceTracker) - if err != nil { - // This is a catastrophic error if we can't write datapoints. - log.WithError(err).Error("Could not configure SignalFx datapoint writer, unable to start up") - os.Exit(4) - } - a.writer.Start() - } - - if conf.Cluster != "" { - startSyncClusterProperty(a.dimensionChan, conf.Cluster, hostDims, conf.SyncClusterOnHostDimension) - } - - a.meta.InternalStatusHost = conf.InternalStatusHost - a.meta.InternalStatusPort = conf.InternalStatusPort - - // The order of Configure calls is very important! - a.monitors.Configure(conf.Monitors, &conf.Collectd, conf.IntervalSeconds) - a.observers.Configure(conf.Observers) - a.lastConfig = conf -} - -func (a *Agent) endpointAdded(service services.Endpoint) { - a.endpointHostTracker.EndpointAdded(service) - a.monitors.EndpointAdded(service) -} - -func (a *Agent) endpointRemoved(service services.Endpoint) { - a.monitors.EndpointRemoved(service) - a.endpointHostTracker.EndpointRemoved(service) -} - -func (a *Agent) shutdown() { - a.observers.Shutdown() - a.monitors.Shutdown() - //neopy.Instance().Shutdown() - a.writer.Shutdown() - if a.diagnosticServer != nil { - a.diagnosticServer.Close() - } -} - -// Startup the agent. Returns a function that can be called to shutdown the -// agent, as well as a channel that will be notified when the agent has -// shutdown. -func Startup(configPath string) (context.CancelFunc, <-chan struct{}) { - cwc, cancel := context.WithCancel(context.Background()) - - configLoads, err := config.LoadConfig(cwc, configPath) - if err != nil { - log.WithFields(log.Fields{ - "error": err, - "configPath": configPath, - }).Error("Error loading main config") - os.Exit(1) - } - - agent := NewAgent() - - shutdownComplete := make(chan struct{}) - - go func(ctx context.Context) { - for { - select { - case config := <-configLoads: - log.Info("New config loaded") - - if config == nil { - log.WithFields(log.Fields{ - "path": configPath, - }).Error("Failed to load config, cannot continue!") - os.Exit(2) - } - - agent.configure(config) - log.Info("Done configuring agent") - - if config.InternalStatusHost != "" { - agent.serveDiagnosticInfo(config.InternalStatusHost, config.InternalStatusPort) - } - - case <-ctx.Done(): - agent.shutdown() - close(shutdownComplete) - return - } - } - }(cwc) - - return cancel, shutdownComplete -} - -// Status reads the text from the diagnostic socket and returns it if available. -func Status(configPath string, section string) ([]byte, error) { - configLoads, err := config.LoadConfig(context.Background(), configPath) - if err != nil { - return nil, err - } - - conf := <-configLoads - return readStatusInfo(conf.InternalStatusHost, conf.InternalStatusPort, section) -} - -// StreamDatapoints reads the text from the diagnostic socket and returns it if available. -func StreamDatapoints(configPath string, metric string, dims string) (io.ReadCloser, error) { - configLoads, err := config.LoadConfig(context.Background(), configPath) - if err != nil { - return nil, err - } - - conf := <-configLoads - return streamDatapoints(conf.InternalStatusHost, conf.InternalStatusPort, metric, dims) -} - -func startSyncClusterProperty(dimChan chan *types.Dimension, cluster string, hostDims map[string]string, setOnHost bool) { - hostDims = utils.CloneStringMap(hostDims) - // Exclude kubernetes_node_uid since it is also managed by the - // kubernetes-cluster monitor and it is very tricky getting them to - // merge cleanly without it clobbing the cluster property. - delete(hostDims, "kubernetes_node_uid") - - for dimName, dimValue := range hostDims { - if len(hostDims) > 1 && dimName == "host" && !setOnHost { - // If we also have a platform-specific host-id dimension that isn't - // the generic 'host' dimension, then skip setting the property on - // 'host' since it tends to get reused frequently. The property - // will still show up on all MTSs that come out of this agent. - continue - } - log.Infof("Setting cluster:%s property on %s:%s dimension", cluster, dimName, dimValue) - dimChan <- &types.Dimension{ - Name: dimName, - Value: dimValue, - Properties: map[string]string{ - "cluster": cluster, - }, - MergeIntoExisting: true, - } - } -} diff --git a/internal/signalfx-agent/pkg/core/diagnostics.go b/internal/signalfx-agent/pkg/core/diagnostics.go deleted file mode 100644 index 0c6b9f44af..0000000000 --- a/internal/signalfx-agent/pkg/core/diagnostics.go +++ /dev/null @@ -1,162 +0,0 @@ -package core - -import ( - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "runtime" - "time" - - // Import for side-effect of registering http handler - _ "net/http/pprof" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/sfxclient" - log "github.com/sirupsen/logrus" -) - -// VersionLine should be populated by the startup logic to contain version -// information that can be reported in diagnostics. -// nolint: gochecknoglobals -var VersionLine string - -// Serves the diagnostic status on the specified path -func (a *Agent) serveDiagnosticInfo(host string, port uint16) { - if a.diagnosticServer != nil { - a.diagnosticServer.Close() - } - - mux := http.NewServeMux() - mux.Handle("/", http.HandlerFunc(a.diagnosticTextHandler)) - mux.Handle("/metrics", http.HandlerFunc(a.internalMetricsHandler)) - - a.diagnosticServer = &http.Server{ - Addr: fmt.Sprintf("%s:%d", host, port), - Handler: mux, - ReadTimeout: 5 * time.Second, - // Set this to 0 so that streaming works. - WriteTimeout: 0, //5 * time.Second, - } - - go func() { - log.Infof("Serving internal metrics at %s:%d", host, port) - for { - err := a.diagnosticServer.ListenAndServe() - if err != nil { - if err == http.ErrServerClosed { - return - } - log.WithFields(log.Fields{ - "host": host, - "port": port, - "error": err, - }).Error("Problem with diagnostic server") - } - // Retry after a cool down since sometimes the port can be still - // bound up from a previously running agent that was restarted. - time.Sleep(15 * time.Second) - } - }() -} - -func readStatusInfo(host string, port uint16, section string) ([]byte, error) { - resp, err := http.Get(fmt.Sprintf("http://%s:%d/?section=%s", host, port, section)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - return io.ReadAll(resp.Body) -} - -func (a *Agent) internalMetricsHandler(rw http.ResponseWriter, req *http.Request) { - jsonOut, err := json.Marshal(a.InternalMetrics()) - if err != nil { - log.WithError(err).Error("Could not serialize internal metrics to JSON") - rw.WriteHeader(500) - _, _ = rw.Write([]byte(err.Error())) - return - } - - rw.Header().Add("Content-Type", "application/json") - rw.WriteHeader(200) - - _, _ = rw.Write(jsonOut) -} - -// InternalMetrics aggregates internal metrics from subcomponents and returns a -// list of datapoints that represent the instaneous state of the agent -func (a *Agent) InternalMetrics() []*datapoint.Datapoint { - out := make([]*datapoint.Datapoint, 0) - - mstat := runtime.MemStats{} - runtime.ReadMemStats(&mstat) - out = append(out, []*datapoint.Datapoint{ - sfxclient.Cumulative("sfxagent.go_total_alloc", nil, int64(mstat.TotalAlloc)), - sfxclient.Gauge("sfxagent.go_sys", nil, int64(mstat.Sys)), - sfxclient.Cumulative("sfxagent.go_mallocs", nil, int64(mstat.Mallocs)), - sfxclient.Cumulative("sfxagent.go_frees", nil, int64(mstat.Frees)), - sfxclient.Gauge("sfxagent.go_heap_alloc", nil, int64(mstat.HeapAlloc)), - sfxclient.Gauge("sfxagent.go_heap_sys", nil, int64(mstat.HeapSys)), - sfxclient.Gauge("sfxagent.go_heap_idle", nil, int64(mstat.HeapIdle)), - sfxclient.Gauge("sfxagent.go_heap_inuse", nil, int64(mstat.HeapInuse)), - sfxclient.Gauge("sfxagent.go_heap_released", nil, int64(mstat.HeapReleased)), - sfxclient.Gauge("sfxagent.go_stack_inuse", nil, int64(mstat.StackInuse)), - sfxclient.Gauge("sfxagent.go_next_gc", nil, int64(mstat.NextGC)), - sfxclient.Cumulative("sfxagent.go_pause_total_ns", nil, int64(mstat.PauseTotalNs)), - sfxclient.Cumulative("sfxagent.go_gc_cpu_fraction", nil, int64(mstat.GCCPUFraction)), - sfxclient.Gauge("sfxagent.go_num_gc", nil, int64(mstat.NumGC)), - sfxclient.Gauge("sfxagent.go_gomaxprocs", nil, int64(runtime.GOMAXPROCS(0))), - sfxclient.Gauge("sfxagent.go_num_goroutine", nil, int64(runtime.NumGoroutine())), - }...) - - out = append(out, a.writer.InternalMetrics()...) - out = append(out, a.observers.InternalMetrics()...) - out = append(out, a.monitors.InternalMetrics()...) - - for i := range out { - if out[i].Dimensions == nil { - out[i].Dimensions = make(map[string]string) - } - - out[i].Dimensions["host"] = a.lastConfig.Hostname - out[i].Timestamp = time.Now() - } - return out -} - -func (a *Agent) ensureProfileServerRunning(host string, port int) { - if !a.profileServerRunning { - // We don't use that much memory so the default mem sampling rate is - // too small to be very useful. Setting to 1 profiles ALL allocations - runtime.MemProfileRate = 1 - // Crank up CPU profile rate too since our CPU usage tends to be pretty - // bursty around read cycles. - runtime.SetCPUProfileRate(-1) - runtime.SetCPUProfileRate(2000) - - go func() { - a.profileServerRunning = true - // This is very difficult to access from the host on mac without - // exposing it on all interfaces - log.Println(http.ListenAndServe(fmt.Sprintf("%s:%d", host, port), nil)) - }() - } -} - -func streamDatapoints(host string, port uint16, metric string, dims string) (io.ReadCloser, error) { - c := http.Client{ - Timeout: 0, - } - qs := url.Values{} - qs.Set("metric", metric) - qs.Set("dims", dims) - resp, err := c.Get(fmt.Sprintf("http://%s:%d/tap-dps?%s", host, port, qs.Encode())) // nolint:bodyclose - if err != nil { - return nil, err - } - - return resp.Body, nil -} diff --git a/internal/signalfx-agent/pkg/core/status.go b/internal/signalfx-agent/pkg/core/status.go deleted file mode 100644 index 74f4e7b713..0000000000 --- a/internal/signalfx-agent/pkg/core/status.go +++ /dev/null @@ -1,63 +0,0 @@ -package core - -import ( - "fmt" - "net/http" - "time" - - "github.com/signalfx/signalfx-agent/pkg/core/common/constants" - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/monitors/kubernetes/leadership" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -func (a *Agent) diagnosticTextHandler(rw http.ResponseWriter, req *http.Request) { - section := req.URL.Query().Get("section") - _, _ = rw.Write([]byte(a.DiagnosticText(section))) -} - -// DiagnosticText returns a simple textual output of the agent's status -func (a *Agent) DiagnosticText(section string) string { - showAll := section == "all" - var out string - if section == "" || showAll { - uptime := time.Since(a.startTime).Round(1 * time.Second).String() - out += - "SignalFx Agent version: " + constants.Version + "\n" + - "Agent uptime: " + uptime + "\n" + - a.observers.DiagnosticText() + "\n" + - a.monitors.SummaryDiagnosticText() + "\n" + - a.writer.DiagnosticText() + "\n" - - k8sLeader := leadership.CurrentLeader() - if k8sLeader != "" { - out += fmt.Sprintf("Kubernetes Leader Node: %s\n", k8sLeader) - } - - if section == "" { - out += "\n" + utils.StripIndent(` - Additional status commands: - - signalfx-agent status config - show resolved config in use by agent - signalfx-agent status endpoints - show discovered endpoints - signalfx-agent status monitors - show active monitors - signalfx-agent status all - show everything - `) - } - } - - if section == "config" || showAll { - out += "Agent Configuration:\n" + - utils.IndentLines(config.ToString(a.lastConfig), 2) + "\n" - } - - if section == "monitors" || showAll { - out += a.monitors.DiagnosticText() + "\n" - } - - if section == "endpoints" || showAll { - out += a.monitors.EndpointsDiagnosticText() - } - - return out -} diff --git a/internal/signalfx-agent/pkg/core/writer/dimensions/client.go b/internal/signalfx-agent/pkg/core/writer/dimensions/client.go deleted file mode 100644 index ea91815fa6..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/dimensions/client.go +++ /dev/null @@ -1,356 +0,0 @@ -package dimensions - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "net" - "net/http" - "net/url" - "reflect" - "strings" - "sync" - "sync/atomic" - "time" - - log "github.com/sirupsen/logrus" - - "github.com/signalfx/signalfx-agent/pkg/apm/requests" - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/propfilters" - "github.com/signalfx/signalfx-agent/pkg/monitors/types" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -// DimensionClient sends updates to dimensions to the SignalFx API -type DimensionClient struct { - sync.RWMutex - ctx context.Context - Token string - APIURL *url.URL - extraHeaders map[string]string - client *http.Client - requestSender *requests.ReqSender - deduplicator *deduplicator - sendDelay time.Duration - // Set of dims that have been queued up for sending. Use map to quickly - // look up in case we need to replace due to flappy prop generation. - delayedSet map[types.DimensionKey]*types.Dimension - // Queue of dimensions to update. The ordering should never change once - // put in the queue so no need for heap/priority queue. - delayedQueue chan *queuedDimension - PropertyFilterSet *propfilters.FilterSet - // For easier unit testing - now func() time.Time - logUpdates bool - - DimensionsCurrentlyDelayed int64 - TotalDimensionsDropped int64 - // The number of dimension updates that happened to the same dimension - // within sendDelay. - TotalFlappyUpdates int64 - TotalClientError4xxResponses int64 - TotalRetriedUpdates int64 - TotalInvalidDimensions int64 - TotalDuplicates int64 -} - -type queuedDimension struct { - *types.Dimension - TimeToSend time.Time -} - -// NewDimensionClient returns a new client -func NewDimensionClient(ctx context.Context, conf *config.WriterConfig) (*DimensionClient, error) { - propFilters, err := conf.PropertyFilters() - if err != nil { - return nil, err - } - - client := &http.Client{ - Timeout: 10 * time.Second, - Transport: &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 5 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - MaxIdleConns: int(conf.PropertiesMaxRequests), - MaxIdleConnsPerHost: int(conf.PropertiesMaxRequests), - IdleConnTimeout: 30 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - }, - } - sender := requests.NewReqSender(ctx, client, conf.PropertiesMaxRequests, "dimension") - - return &DimensionClient{ - ctx: ctx, - Token: conf.SignalFxAccessToken, - APIURL: conf.ParsedAPIURL(), - extraHeaders: conf.ExtraHeaders, - sendDelay: time.Duration(conf.PropertiesSendDelaySeconds) * time.Second, - delayedSet: make(map[types.DimensionKey]*types.Dimension), - delayedQueue: make(chan *queuedDimension, conf.PropertiesMaxBuffered), - deduplicator: newDeduplicator(int(conf.PropertiesHistorySize)), - requestSender: sender, - client: client, - PropertyFilterSet: propFilters, - now: time.Now, - logUpdates: conf.LogDimensionUpdates, - }, nil -} - -// Start the client's processing queue -func (dc *DimensionClient) Start() { - go dc.processQueue() -} - -// AcceptDimension to be sent to the API. This will return fairly quickly and -// won't block. If the buffer is full, the dim update will be dropped. -func (dc *DimensionClient) AcceptDimension(dim *types.Dimension) error { - filteredDim := &(*dim) - - filteredDim = dc.PropertyFilterSet.FilterDimension(filteredDim) - if filteredDim == nil { - return nil - } - - dc.Lock() - defer dc.Unlock() - - if delayedDim := dc.delayedSet[filteredDim.Key()]; delayedDim != nil { - if !reflect.DeepEqual(delayedDim, filteredDim) { - dc.TotalFlappyUpdates++ - - // Don't further delay it if it gets updated so that we are always - // guaranteed to update a dimension at least some times, even if it - // continually gets updated more frequently than `sendDelay` seconds - // (which should be dealt with somewhere else). - - if filteredDim.MergeIntoExisting != delayedDim.MergeIntoExisting { - log.Warnf("Dimension %s/%s is updated with both merging and non-merging, which will result in race conditions and inconsistent data.", filteredDim.Name, filteredDim.Value) - } - // If the dim is a merge request, then update the existing one in - // place, otherwise replace it. - if delayedDim.MergeIntoExisting { - delayedDim.Properties = utils.MergeStringMaps(delayedDim.Properties, filteredDim.Properties) - delayedDim.Tags = utils.MergeStringSets(delayedDim.Tags, filteredDim.Tags) - } else { - delayedDim.Properties = filteredDim.Properties - delayedDim.Tags = filteredDim.Tags - } - } - } else { - atomic.AddInt64(&dc.DimensionsCurrentlyDelayed, int64(1)) - - dc.delayedSet[filteredDim.Key()] = filteredDim - select { - case dc.delayedQueue <- &queuedDimension{ - Dimension: filteredDim, - TimeToSend: dc.now().Add(dc.sendDelay), - }: - break - default: - dc.TotalDimensionsDropped++ - atomic.AddInt64(&dc.DimensionsCurrentlyDelayed, int64(-1)) - return errors.New("dropped dimension update, propertiesMaxBuffered exceeded") - } - } - - return nil -} - -func (dc *DimensionClient) processQueue() { - for { - select { - case <-dc.ctx.Done(): - return - case delayedDim := <-dc.delayedQueue: - now := dc.now() - if now.Before(delayedDim.TimeToSend) { - // dims are always in the channel in order of TimeToSend - time.Sleep(delayedDim.TimeToSend.Sub(now)) - } - - atomic.AddInt64(&dc.DimensionsCurrentlyDelayed, int64(-1)) - - dc.Lock() - delete(dc.delayedSet, delayedDim.Dimension.Key()) - dc.Unlock() - - if err := dc.setPropertiesOnDimension(delayedDim.Dimension); err != nil { - log.WithError(utils.SanitizeHTTPError(err)).WithField("dim", delayedDim.Key()).Error("Could not send dimension update") - } - } - } -} - -// setPropertiesOnDimension will set custom properties on a specific dimension -// value. It will wipe out any description on the dimension. -func (dc *DimensionClient) setPropertiesOnDimension(dim *types.Dimension) error { - var ( - req *http.Request - err error - ) - - if dim.Name == "" || dim.Value == "" { - atomic.AddInt64(&dc.TotalInvalidDimensions, int64(1)) - return fmt.Errorf("dimension %v is missing key or value, cannot send", dim) - } - - if dim.MergeIntoExisting { - req, err = dc.makePatchRequest(dim.Name, dim.Value, dim.Properties, dim.Tags) - } else { - req, err = dc.makeReplaceRequest(dim.Name, dim.Value, dim.Properties, dim.Tags) - } - - for header, val := range dc.extraHeaders { - req.Header.Set(header, val) - } - - if err != nil { - return err - } - - req = req.WithContext( - context.WithValue(req.Context(), requests.RequestFailedCallbackKey, requests.RequestFailedCallback(func(_ []byte, statusCode int, err error) { - if statusCode >= 400 && statusCode < 500 && statusCode != 404 { - atomic.AddInt64(&dc.TotalClientError4xxResponses, int64(1)) - log.WithError(utils.SanitizeHTTPError(err)).WithFields(log.Fields{ - "url": req.URL.String(), - "dim": dim, - }).Error("Unable to update dimension, not retrying") - - // Don't retry if it is a 4xx error (except 404) since these - // imply an input/auth error, which is not going to be remedied - // by retrying. - // 404 errors are special because they can occur due to races - // within the dimension patch endpoint. - return - } - - log.WithError(utils.SanitizeHTTPError(err)).WithFields(log.Fields{ - "url": req.URL.String(), - "dim": dim, - }).Error("Unable to update dimension, retrying") - atomic.AddInt64(&dc.TotalRetriedUpdates, int64(1)) - // The retry is meant to provide some measure of robustness against - // temporary API failures. If the API is down for significant - // periods of time, dimension updates will probably eventually back - // up beyond conf.PropertiesMaxBuffered and start dropping. - if err := dc.AcceptDimension(dim); err != nil { - log.WithFields(log.Fields{ - "error": utils.SanitizeHTTPError(err), - "dim": dim.Key().String(), - }).Errorf("Failed to retry dimension update") - } - }))) - - req = req.WithContext( - context.WithValue(req.Context(), requests.RequestSuccessCallbackKey, requests.RequestSuccessCallback(func([]byte) { - dc.deduplicator.Add(dim) - if dc.logUpdates { - log.WithFields(log.Fields{ - "dim": dim, - }).Info("Updated dimension") - } - }))) - - if !dc.deduplicator.IsDuplicate(dim) { - // This will block if we don't have enough requests - dc.requestSender.Send(req) - } else { - atomic.AddInt64(&dc.TotalDuplicates, int64(1)) - } - - return nil -} - -func (dc *DimensionClient) makeDimURL(key, value string) (*url.URL, error) { - url, err := dc.APIURL.Parse(fmt.Sprintf("/v2/dimension/%s/%s", url.PathEscape(key), url.PathEscape(value))) - if err != nil { - return nil, fmt.Errorf("could not construct dimension property PUT URL with %s / %s: %v", key, value, err) - } - - return url, nil -} - -func (dc *DimensionClient) makePatchRequest(key, value string, props map[string]string, tags map[string]bool) (*http.Request, error) { - tagsToAdd := []string{} - tagsToRemove := []string{} - - for tag, shouldAdd := range tags { - if shouldAdd { - tagsToAdd = append(tagsToAdd, tag) - } else { - tagsToRemove = append(tagsToRemove, tag) - } - } - - if props == nil { - props = map[string]string{} - } - - // The patch endpoint will also accept properties with a null value, in - // which case they will be deleted, but the agent's Dimension type doesn't - // support this yet. - json, err := json.Marshal(map[string]interface{}{ - "customProperties": props, - "tags": tagsToAdd, - "tagsToRemove": tagsToRemove, - }) - if err != nil { - return nil, err - } - - url, err := dc.makeDimURL(key, value) - if err != nil { - return nil, err - } - - req, err := http.NewRequest( - "PATCH", - strings.TrimRight(url.String(), "/")+"/_/sfxagent", - bytes.NewReader(json)) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", "application/json") - req.Header.Add("X-SF-TOKEN", dc.Token) - - return req, nil -} - -func (dc *DimensionClient) makeReplaceRequest(key, value string, props map[string]string, tags map[string]bool) (*http.Request, error) { - json, err := json.Marshal(map[string]interface{}{ - "key": key, - "value": value, - "customProperties": props, - "tags": utils.StringSetToSlice(tags), - }) - if err != nil { - return nil, err - } - - url, err := dc.makeDimURL(key, value) - if err != nil { - return nil, err - } - - req, err := http.NewRequest( - "PUT", - url.String(), - bytes.NewReader(json)) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", "application/json") - req.Header.Add("X-SF-TOKEN", dc.Token) - - return req, nil -} diff --git a/internal/signalfx-agent/pkg/core/writer/dimensions/client_test.go b/internal/signalfx-agent/pkg/core/writer/dimensions/client_test.go deleted file mode 100644 index d728ae0d47..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/dimensions/client_test.go +++ /dev/null @@ -1,494 +0,0 @@ -package dimensions - -import ( - "context" - "encoding/json" - "fmt" - "log" - "net/http" - "net/http/httptest" - "regexp" - "sync/atomic" - "testing" - "time" - - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/monitors/types" - "github.com/stretchr/testify/require" -) - -var putPathRegexp = regexp.MustCompile(`/v2/dimension/([^/]+)/([^/]+)`) -var patchPathRegexp = regexp.MustCompile(`/v2/dimension/([^/]+)/([^/]+)/_/sfxagent`) - -type dim struct { - Key string `json:"key"` - Value string `json:"value"` - Properties map[string]string `json:"customProperties"` - Tags []string `json:"tags"` - TagsToRemove []string `json:"tagsToRemove"` - WasPatch bool `json:"-"` -} - -func waitForDims(dimCh <-chan dim, count, waitSeconds int) []dim { // nolint: unparam - var dims []dim - timeout := time.After(time.Duration(waitSeconds) * time.Second) - -loop: - for { - select { - case dim := <-dimCh: - dims = append(dims, dim) - if len(dims) >= count { - break loop - } - case <-timeout: - break loop - } - } - - return dims -} - -func makeHandler(dimCh chan<- dim, forcedResp *atomic.Value) http.HandlerFunc { - forcedResp.Store(200) - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - forcedRespInt := forcedResp.Load().(int) - if forcedRespInt != 200 { - rw.WriteHeader(forcedRespInt) - return - } - - log.Printf("Test server got request: %s", r.URL.Path) - var re *regexp.Regexp - switch r.Method { - case "PUT": - re = putPathRegexp - case "PATCH": - re = patchPathRegexp - default: - rw.WriteHeader(404) - return - } - match := re.FindStringSubmatch(r.URL.Path) - if match == nil { - rw.WriteHeader(404) - return - } - - var bodyDim dim - if err := json.NewDecoder(r.Body).Decode(&bodyDim); err != nil { - rw.WriteHeader(400) - return - } - bodyDim.WasPatch = r.Method == "PATCH" - bodyDim.Key = match[1] - bodyDim.Value = match[2] - - dimCh <- bodyDim - - rw.WriteHeader(200) - }) -} - -func setup() (*DimensionClient, chan dim, *atomic.Value, context.CancelFunc) { - dimCh := make(chan dim) - - var forcedResp atomic.Value - server := httptest.NewServer(makeHandler(dimCh, &forcedResp)) - - ctx, cancel := context.WithCancel(context.Background()) - go func() { - <-ctx.Done() - server.Close() - }() - - client, err := NewDimensionClient(ctx, &config.WriterConfig{ - PropertiesMaxBuffered: 10, - PropertiesMaxRequests: 10, - PropertiesSendDelaySeconds: 1, - PropertiesHistorySize: 1000, - LogDimensionUpdates: true, - APIURL: server.URL, - }) - if err != nil { - panic("could not make dim client: " + err.Error()) - } - client.Start() - - return client, dimCh, &forcedResp, cancel -} - -func TestDimensionClient(t *testing.T) { - client, dimCh, forcedResp, cancel := setup() - defer cancel() - - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "host", - Value: "test-box", - Properties: map[string]string{ - "a": "b", - "c": "d", - }, - Tags: map[string]bool{ - "active": true, - }, - MergeIntoExisting: true, - })) - - dims := waitForDims(dimCh, 1, 3) - require.Equal(t, dims, []dim{ - { - Key: "host", - Value: "test-box", - Properties: map[string]string{ - "a": "b", - "c": "d", - }, - Tags: []string{"active"}, - TagsToRemove: []string{}, - WasPatch: true, - }, - }) - - t.Run("same dimension with different values", func(t *testing.T) { - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "host", - Value: "test-box", - Properties: map[string]string{ - "e": "f", - }, - Tags: map[string]bool{ - "active": false, - }, - MergeIntoExisting: true, - })) - - dims = waitForDims(dimCh, 1, 3) - require.Equal(t, dims, []dim{ - { - Key: "host", - Value: "test-box", - Properties: map[string]string{ - "e": "f", - }, - Tags: []string{}, - TagsToRemove: []string{"active"}, - WasPatch: true, - }, - }) - }) - - t.Run("property with empty value", func(t *testing.T) { - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "host", - Value: "empty-box", - Properties: map[string]string{ - "a": "", - }, - Tags: map[string]bool{ - "active": false, - }, - MergeIntoExisting: true, - })) - - dims = waitForDims(dimCh, 1, 3) - require.Equal(t, dims, []dim{ - { - Key: "host", - Value: "empty-box", - Properties: map[string]string{ - "a": "", - }, - Tags: []string{}, - TagsToRemove: []string{"active"}, - WasPatch: true, - }, - }) - }) - - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "AWSUniqueID", - Value: "abcd", - Properties: map[string]string{ - "a": "b", - }, - Tags: map[string]bool{ - "is_on": true, - }, - })) - - dims = waitForDims(dimCh, 1, 3) - require.Equal(t, dims, []dim{ - { - Key: "AWSUniqueID", - Value: "abcd", - Properties: map[string]string{ - "a": "b", - }, - Tags: []string{"is_on"}, - WasPatch: false, - }, - }) - - t.Run("send a distinct prop/tag set for existing dim with server error", func(t *testing.T) { - forcedResp.Store(500) - - // send a distinct prop/tag set for same dim with an error - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "AWSUniqueID", - Value: "abcd", - Properties: map[string]string{ - "a": "b", - "c": "d", - }, - Tags: map[string]bool{ - "running": true, - }, - })) - dims = waitForDims(dimCh, 1, 3) - require.Len(t, dims, 0) - - forcedResp.Store(200) - dims = waitForDims(dimCh, 1, 3) - - // After the server recovers the dim should be resent. - require.Equal(t, dims, []dim{ - { - Key: "AWSUniqueID", - Value: "abcd", - Properties: map[string]string{ - "a": "b", - "c": "d", - }, - Tags: []string{"running"}, - WasPatch: false, - }, - }) - }) - - t.Run("does not retry 4xx responses", func(t *testing.T) { - forcedResp.Store(400) - - // send a distinct prop/tag set for same dim with an error - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "AWSUniqueID", - Value: "aslfkj", - Properties: map[string]string{ - "z": "y", - }, - })) - dims = waitForDims(dimCh, 1, 3) - require.Len(t, dims, 0) - - forcedResp.Store(200) - dims = waitForDims(dimCh, 1, 3) - require.Len(t, dims, 0) - }) - - t.Run("does retry 404 responses", func(t *testing.T) { - forcedResp.Store(404) - - // send a distinct prop/tag set for same dim with an error - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "AWSUniqueID", - Value: "id404", - Properties: map[string]string{ - "z": "x", - }, - })) - dims = waitForDims(dimCh, 1, 3) - require.Len(t, dims, 0) - - forcedResp.Store(200) - dims = waitForDims(dimCh, 1, 3) - require.Equal(t, dims, []dim{ - { - Key: "AWSUniqueID", - Value: "id404", - Properties: map[string]string{ - "z": "x", - }, - WasPatch: false, - }, - }) - }) - - t.Run("send a duplicate", func(t *testing.T) { - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "AWSUniqueID", - Value: "abcd", - Properties: map[string]string{ - "a": "b", - "c": "d", - }, - Tags: map[string]bool{ - "running": true, - }, - })) - - dims = waitForDims(dimCh, 1, 3) - require.Len(t, dims, 0) - }) - - // send something unique again - t.Run("send something unique to same dim", func(t *testing.T) { - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "AWSUniqueID", - Value: "abcd", - Properties: map[string]string{ - "c": "d", - }, - Tags: map[string]bool{ - "running": true, - }, - })) - - dims = waitForDims(dimCh, 1, 3) - - require.Equal(t, dims, []dim{ - { - Key: "AWSUniqueID", - Value: "abcd", - Properties: map[string]string{ - "c": "d", - }, - Tags: []string{"running"}, - WasPatch: false, - }, - }) - }) - - t.Run("send a distinct patch that covers the same prop keys", func(t *testing.T) { - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "host", - Value: "test-box", - Properties: map[string]string{ - "a": "z", - }, - MergeIntoExisting: true, - })) - - dims = waitForDims(dimCh, 1, 3) - require.Equal(t, dims, []dim{ - { - Key: "host", - Value: "test-box", - Properties: map[string]string{ - "a": "z", - }, - Tags: []string{}, - TagsToRemove: []string{}, - WasPatch: true, - }, - }) - }) - - t.Run("send a distinct patch that covers the same tags", func(t *testing.T) { - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "host", - Value: "test-box", - Tags: map[string]bool{ - "active": true, - }, - MergeIntoExisting: true, - })) - - dims = waitForDims(dimCh, 1, 3) - require.Equal(t, dims, []dim{ - { - Key: "host", - Value: "test-box", - Properties: map[string]string{}, - Tags: []string{"active"}, - TagsToRemove: []string{}, - WasPatch: true, - }, - }) - }) -} - -func TestFlappyUpdates(t *testing.T) { - client, dimCh, _, cancel := setup() - defer cancel() - - // Do some flappy updates - for i := 0; i < 5; i++ { - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "pod_uid", - Value: "abcd", - Properties: map[string]string{ - "index": fmt.Sprintf("%d", i), - }, - })) - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "pod_uid", - Value: "efgh", - Properties: map[string]string{ - "index": fmt.Sprintf("%d", i), - }, - MergeIntoExisting: true, - })) - } - - dims := waitForDims(dimCh, 2, 3) - require.ElementsMatch(t, []dim{ - { - Key: "pod_uid", - Value: "abcd", - Properties: map[string]string{"index": "4"}, - WasPatch: false, - }, - { - Key: "pod_uid", - Value: "efgh", - Properties: map[string]string{"index": "4"}, - Tags: []string{}, - TagsToRemove: []string{}, - WasPatch: true, - }, - }, dims) - - // Give it enough time to run the counter updates which happen after the - // request is completed. - time.Sleep(1 * time.Second) - - require.Equal(t, int64(8), atomic.LoadInt64(&client.TotalFlappyUpdates)) - require.Equal(t, int64(0), atomic.LoadInt64(&client.DimensionsCurrentlyDelayed)) - require.Equal(t, int64(2), atomic.LoadInt64(&client.requestSender.TotalRequestsStarted)) - require.Equal(t, int64(2), atomic.LoadInt64(&client.requestSender.TotalRequestsCompleted)) - require.Equal(t, int64(0), atomic.LoadInt64(&client.requestSender.TotalRequestsFailed)) -} - -func TestInvalidUpdatesNotSent(t *testing.T) { - client, dimCh, _, cancel := setup() - defer cancel() - - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "host", - Value: "", - Properties: map[string]string{ - "a": "b", - "c": "d", - }, - Tags: map[string]bool{ - "active": true, - }, - MergeIntoExisting: true, - })) - - require.NoError(t, client.AcceptDimension(&types.Dimension{ - Name: "", - Value: "asdf", - Properties: map[string]string{ - "a": "b", - "c": "d", - }, - Tags: map[string]bool{ - "active": true, - }, - })) - - dims := waitForDims(dimCh, 2, 3) - require.Len(t, dims, 0) -} diff --git a/internal/signalfx-agent/pkg/core/writer/dimensions/dedup.go b/internal/signalfx-agent/pkg/core/writer/dimensions/dedup.go deleted file mode 100644 index 088bfe4672..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/dimensions/dedup.go +++ /dev/null @@ -1,100 +0,0 @@ -package dimensions - -import ( - "reflect" - - lru "github.com/hashicorp/golang-lru" - log "github.com/sirupsen/logrus" - - "github.com/signalfx/signalfx-agent/pkg/monitors/types" -) - -type deduplicator struct { - history *lru.Cache -} - -func newDeduplicator(size int) *deduplicator { - history, err := lru.New(size) - if err != nil { - panic("could not make dimension cache: " + err.Error()) - } - - return &deduplicator{ - history: history, - } -} - -func (dd *deduplicator) IsDuplicate(dim *types.Dimension) bool { - cached, ok := dd.history.Get(dim.Key()) - if !ok { - return false - } - - cachedDim := cached.(*types.Dimension) - - if cachedDim.MergeIntoExisting != dim.MergeIntoExisting { - log.Warnf("Dimension %s/%s is updated with both merging and non-merging, which will result in race conditions and inconsistent data.", dim.Name, dim.Value) - return false - } - - if !dim.MergeIntoExisting { - return reflect.DeepEqual(dim, cachedDim) - } - - // The below checks if any value in the passed in dim is different than - // what has been last set before. - - for k := range dim.Properties { - if dim.Properties[k] != cachedDim.Properties[k] { - return false - } - } - - for tag := range dim.Tags { - cachedDimTag, cachedDimTagOk := cachedDim.Tags[tag] - if dim.Tags[tag] != cachedDimTag || !cachedDimTagOk { - return false - } - } - - return true -} - -// Add the dimension to the deduplicator -func (dd *deduplicator) Add(dim *types.Dimension) { - cached, ok := dd.history.Get(dim.Key()) - if !ok { - dd.history.Add(dim.Key(), dim) - return - } - - cachedDim := cached.(*types.Dimension) - - if cachedDim.MergeIntoExisting != dim.MergeIntoExisting { - log.Warnf("Dimension %s/%s is updated with both merging and non-merging, which will result in race conditions and inconsistent data.", dim.Name, dim.Value) - return - } - - if !dim.MergeIntoExisting { - dd.history.Add(dim.Key(), dim) - return - } - - // If we are merging dimension props/tags, then just keep all the updates - // in the cached copy so we will know if an update is going to change - // anything or not. - if cachedDim.Properties == nil { - cachedDim.Properties = map[string]string{} - } - for k, v := range dim.Properties { - // Update the dim in the cache in place - cachedDim.Properties[k] = v - } - - if cachedDim.Tags == nil { - cachedDim.Tags = map[string]bool{} - } - for tag, present := range dim.Tags { - cachedDim.Tags[tag] = present - } -} diff --git a/internal/signalfx-agent/pkg/core/writer/dimensions/diagnostics.go b/internal/signalfx-agent/pkg/core/writer/dimensions/diagnostics.go deleted file mode 100644 index 2efae01537..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/dimensions/diagnostics.go +++ /dev/null @@ -1,25 +0,0 @@ -package dimensions - -import ( - "sync/atomic" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/sfxclient" -) - -// InternalMetrics returns datapoints that describe the current state of the -// dimension update client -func (dc *DimensionClient) InternalMetrics() []*datapoint.Datapoint { - dps := []*datapoint.Datapoint{ - sfxclient.Gauge("sfxagent.dim_updates_currently_delayed", nil, atomic.LoadInt64(&dc.DimensionsCurrentlyDelayed)), - sfxclient.CumulativeP("sfxagent.dim_updates_dropped", nil, &dc.TotalDimensionsDropped), - sfxclient.CumulativeP("sfxagent.dim_updates_invalid", nil, &dc.TotalInvalidDimensions), - sfxclient.CumulativeP("sfxagent.dim_updates_flappy_total", nil, &dc.TotalFlappyUpdates), - sfxclient.CumulativeP("sfxagent.dim_updates_duplicates", nil, &dc.TotalDuplicates), - // All 4xx HTTP responses that are not retried except 404 (which is retried) - sfxclient.CumulativeP("sfxagent.dim_updates_client_errors", nil, &dc.TotalClientError4xxResponses), - sfxclient.CumulativeP("sfxagent.dim_updates_retries", nil, &dc.TotalRetriedUpdates), - sfxclient.Cumulative("sfxagent.dim_updates_deduplicator_size", nil, int64(dc.deduplicator.history.Len())), - } - return append(dps, dc.requestSender.InternalMetrics()...) -} diff --git a/internal/signalfx-agent/pkg/core/writer/multi.go b/internal/signalfx-agent/pkg/core/writer/multi.go deleted file mode 100644 index 46e2462c67..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/multi.go +++ /dev/null @@ -1,131 +0,0 @@ -package writer - -import ( - "context" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/event" - "github.com/signalfx/golib/v3/trace" - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/writer/signalfx" - "github.com/signalfx/signalfx-agent/pkg/core/writer/splunk" - "github.com/signalfx/signalfx-agent/pkg/core/writer/tracetracker" - "github.com/signalfx/signalfx-agent/pkg/monitors/types" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -// MultiWriter combines the SignalFx and Splunk outputs. -type MultiWriter struct { - ctx context.Context - cancel context.CancelFunc - - signalFxWriter *signalfx.Writer - splunkWriter *splunk.Output -} - -func New(conf *config.WriterConfig, dpChan chan []*datapoint.Datapoint, eventChan chan *event.Event, - dimensionChan chan *types.Dimension, spanChan chan []*trace.Span, - spanSourceTracker *tracetracker.SpanSourceTracker) (*MultiWriter, error) { - - w := new(MultiWriter) - w.ctx, w.cancel = context.WithCancel(context.Background()) - - bothEnabled := conf.IsSignalFxOutputEnabled() && conf.IsSplunkOutputEnabled() - - signalFxDPChan := dpChan - splunkDPChan := dpChan - signalFxEventChan := eventChan - splunkEventChan := eventChan - signalFxSpanChan := spanChan - splunkSpanChan := spanChan - - // The channel handling is a bit hacky but we have to broadcast the - // datapoints to both writers if they are both present given our existing - // structure of sending datapoints through a channel. If we ever get more - // than two writers, definitely refactor all of this. - if bothEnabled { - signalFxDPChan = make(chan []*datapoint.Datapoint, cap(dpChan)) - splunkDPChan = make(chan []*datapoint.Datapoint, cap(dpChan)) - signalFxEventChan = make(chan *event.Event, cap(eventChan)) - splunkEventChan = make(chan *event.Event, cap(eventChan)) - splunkSpanChan = make(chan []*trace.Span, cap(spanChan)) - - go func() { - for { - select { - case <-w.ctx.Done(): - return - case dps := <-dpChan: - signalFxDPChan <- utils.CloneDatapointSlice(dps) - splunkDPChan <- dps - case ev := <-eventChan: - signalFxEventChan <- utils.CloneEvent(ev) - splunkEventChan <- ev - case span := <-spanChan: - signalFxSpanChan <- utils.CloneSpanSlice(span) - splunkSpanChan <- span - } - } - }() - } - - if conf.IsSignalFxOutputEnabled() { - var err error - w.signalFxWriter, err = signalfx.New(conf, signalFxDPChan, signalFxEventChan, dimensionChan, signalFxSpanChan, spanSourceTracker) - if err != nil { - return nil, err - } - } - - if conf.IsSplunkOutputEnabled() { - var err error - w.splunkWriter, err = splunk.New(conf, splunkDPChan, splunkEventChan, splunkSpanChan) - if err != nil { - return nil, err - } - } - - return w, nil -} - -func (w *MultiWriter) Start() { - if w.signalFxWriter != nil { - w.signalFxWriter.Start() - } - - if w.splunkWriter != nil { - w.splunkWriter.Start() - } -} - -func (w *MultiWriter) Shutdown() { - if w.cancel != nil { - w.cancel() - } - if w.signalFxWriter != nil { - w.signalFxWriter.Shutdown() - } - if w.splunkWriter != nil { - w.splunkWriter.Shutdown() - } -} - -func (w *MultiWriter) InternalMetrics() []*datapoint.Datapoint { - var dps []*datapoint.Datapoint - - if w.signalFxWriter != nil { - dps = append(dps, w.signalFxWriter.InternalMetrics()...) - } - if w.splunkWriter != nil { - dps = append(dps, w.splunkWriter.InternalMetrics()...) - } - - return dps -} - -func (w *MultiWriter) DiagnosticText() string { - if w.signalFxWriter != nil { - return w.signalFxWriter.DiagnosticText() - } - return "No writer information available" -} diff --git a/internal/signalfx-agent/pkg/core/writer/processor/processor.go b/internal/signalfx-agent/pkg/core/writer/processor/processor.go deleted file mode 100644 index b30abb1440..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/processor/processor.go +++ /dev/null @@ -1,137 +0,0 @@ -package processor - -import ( - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/event" - "github.com/signalfx/golib/v3/trace" - "github.com/signalfx/signalfx-agent/pkg/core/common/constants" - "github.com/signalfx/signalfx-agent/pkg/core/common/dpmeta" - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/dpfilters" -) - -type Processor struct { - globalDims map[string]string - globalSpanTags map[string]string - addGlobalDimensionsAsSpanTags bool - hostIDDims map[string]string - datapointFilters *dpfilters.FilterSet -} - -func New(conf *config.WriterConfig) *Processor { - datapointFilters, _ := conf.DatapointFilters() - - return &Processor{ - hostIDDims: conf.HostIDDims, - globalDims: conf.GlobalDimensions, - globalSpanTags: conf.GlobalSpanTags, - addGlobalDimensionsAsSpanTags: conf.AddGlobalDimensionsAsSpanTags, - datapointFilters: datapointFilters, - } -} - -func (p *Processor) ShouldSendDatapoint(dp *datapoint.Datapoint) bool { - return p.datapointFilters == nil || !p.datapointFilters.Matches(dp) -} - -func (p *Processor) PreprocessDatapoint(dp *datapoint.Datapoint) bool { - if !p.ShouldSendDatapoint(dp) { - return false - } - - dp.Dimensions = p.addGlobalDims(dp.Dimensions) - - // Some metrics aren't really specific to the host they are running - // on and shouldn't have any host-specific dims - if b, ok := dp.Meta[dpmeta.NotHostSpecificMeta].(bool); !ok || !b { - dp.Dimensions = p.addhostIDFields(dp.Dimensions) - } - - return true -} - -func (p *Processor) PreprocessEvent(event *event.Event) bool { - event.Dimensions = p.addGlobalDims(event.Dimensions) - - ps := event.Properties - var notHostSpecific bool - if ps != nil { - if b, ok := ps[dpmeta.NotHostSpecificMeta].(bool); ok { - notHostSpecific = b - // Clear this so it doesn't leak through to ingest - delete(ps, dpmeta.NotHostSpecificMeta) - } - } - // Only override host dimension for now and omit other host id dims. - if !notHostSpecific && p.hostIDDims != nil && p.hostIDDims["host"] != "" { - event.Dimensions["host"] = p.hostIDDims["host"] - } - - return true -} - -func (p *Processor) PreprocessSpan(span *trace.Span) bool { - // Some spans aren't really specific to the host they are running - // on and shouldn't have any host-specific tags. This is indicated by a - // special tag key (value is irrelevant). - if _, ok := span.Tags[dpmeta.NotHostSpecificMeta]; !ok { - span.Tags = p.addhostIDFields(span.Tags) - } else { - // Get rid of the tag so it doesn't pass through to the backend - delete(span.Tags, dpmeta.NotHostSpecificMeta) - } - - span.Tags = p.addGlobalSpanTags(span.Tags) - - if p.addGlobalDimensionsAsSpanTags { - span.Tags = p.addGlobalDims(span.Tags) - } - - span.Tags["signalfx.smartagent.version"] = constants.Version - - return true -} - -// Mutates span tags in place to add global span tags. Also -// returns tags in case they were nil to begin with, so the return value should -// be assigned back to the span Tags field. -func (p *Processor) addGlobalSpanTags(tags map[string]string) map[string]string { - if tags == nil { - tags = make(map[string]string) - } - for name, value := range p.globalSpanTags { - // If the tags are already set, don't override - if _, ok := tags[name]; !ok { - tags[name] = value - } - } - return tags -} - -// Mutates datapoint dimensions in place to add global dimensions. Also -// returns dims in case they were nil to begin with, so the return value should -// be assigned back to the dp Dimensions field. -func (p *Processor) addGlobalDims(dims map[string]string) map[string]string { - if dims == nil { - dims = make(map[string]string) - } - for name, value := range p.globalDims { - // If the dimensions are already set, don't override - if _, ok := dims[name]; !ok { - dims[name] = value - } - } - return dims -} - -// Adds the host ids to the given map (e.g. dimensions/span tags), forcibly -// overridding any existing fields of the same name. -func (p *Processor) addhostIDFields(fields map[string]string) map[string]string { - if fields == nil { - fields = make(map[string]string) - } - for k, v := range p.hostIDDims { - fields[k] = v - } - return fields -} diff --git a/internal/signalfx-agent/pkg/core/writer/signalfx/diagnostics.go b/internal/signalfx-agent/pkg/core/writer/signalfx/diagnostics.go deleted file mode 100644 index ff8af07ee9..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/signalfx/diagnostics.go +++ /dev/null @@ -1,82 +0,0 @@ -package signalfx - -import ( - "fmt" - "sync/atomic" - "time" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/sfxclient" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -// Call this in a goroutine to maintain a moving window average DPM, EPM, and -// SPM, updated every 10 seconds. -func (sw *Writer) maintainLastMinuteActivity() { - t := time.NewTicker(10 * time.Second) - defer t.Stop() - - var dpSamples [6]int64 - var dpFailedSamples [6]int64 - var eventSamples [6]int64 - var spanSamples [6]int64 - idx := 0 - for { - select { - case <-sw.ctx.Done(): - return - case <-t.C: - sw.datapointsLastMinute = atomic.LoadInt64(&sw.datapointWriter.TotalSent) - dpSamples[idx] - dpSamples[idx] += sw.datapointsLastMinute - - sw.datapointsFailedLastMinute = atomic.LoadInt64(&sw.dpsFailedToSend) - dpFailedSamples[idx] - dpFailedSamples[idx] += sw.datapointsFailedLastMinute - - sw.eventsLastMinute = atomic.LoadInt64(&sw.eventsSent) - eventSamples[idx] - eventSamples[idx] += sw.eventsLastMinute - - sw.spansLastMinute = atomic.LoadInt64(&sw.spanWriter.TotalSent) - spanSamples[idx] - spanSamples[idx] += sw.spansLastMinute - - idx = (idx + 1) % 6 - } - } -} - -// DiagnosticText outputs a string that describes the state of the writer to a -// human. -func (sw *Writer) DiagnosticText() string { - return fmt.Sprintf( - "Global Dimensions: %s\n"+ - "GlobalSpanTags: %s\n"+ - "Datapoints sent (last minute): %d\n"+ - "Datapoints failed (last minute): %d\n"+ - "Datapoints overwritten (total): %d\n"+ - "Events Sent (last minute): %d\n"+ - "Trace Spans Sent (last minute): %d\n"+ - "Trace Spans overwritten (total): %d", - utils.FormatStringMapCompact(utils.MergeStringMaps(sw.conf.GlobalDimensions, sw.hostIDDims)), - sw.conf.GlobalSpanTags, - sw.datapointsLastMinute, - sw.datapointsFailedLastMinute, - atomic.LoadInt64(&sw.datapointWriter.TotalOverwritten), - sw.eventsLastMinute, - sw.spansLastMinute, - atomic.LoadInt64(&sw.spanWriter.TotalOverwritten)) -} - -// InternalMetrics returns a set of metrics showing how the writer is currently -// doing. -func (sw *Writer) InternalMetrics() []*datapoint.Datapoint { - return append(append(append(append(append(append([]*datapoint.Datapoint{ - sfxclient.CumulativeP("sfxagent.events_sent", nil, &sw.eventsSent), - sfxclient.Gauge("sfxagent.datapoint_channel_len", nil, int64(len(sw.dpChan))), - sfxclient.Gauge("sfxagent.events_buffered", nil, int64(len(sw.eventBuffer))), - sfxclient.CumulativeP("sfxagent.trace_spans_dropped", nil, &sw.traceSpansDropped), - }, sw.datapointWriter.InternalMetrics("sfxagent.")...), - sw.spanWriter.InternalMetrics("sfxagent.")...), - sw.serviceTracker.InternalMetrics()...), - sw.dimensionClient.InternalMetrics()...), - sw.spanSourceTracker.InternalMetrics()...), - sw.correlationClient.InternalMetrics()...) -} diff --git a/internal/signalfx-agent/pkg/core/writer/signalfx/spans.go b/internal/signalfx-agent/pkg/core/writer/signalfx/spans.go deleted file mode 100644 index bb8e498d15..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/signalfx/spans.go +++ /dev/null @@ -1,95 +0,0 @@ -package signalfx - -import ( - "context" - "encoding/json" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/trace" - log "github.com/sirupsen/logrus" - - apmtracker "github.com/signalfx/signalfx-agent/pkg/apm/tracetracker" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -func (sw *Writer) sendSpans(ctx context.Context, spans []*trace.Span) error { - if sw.serviceTracker != nil { - sw.serviceTracker.AddSpans(sw.ctx, spans) - } - - if sw.client != nil { - // This sends synchonously - err := sw.client.AddSpans(context.Background(), spans) - if err != nil { - var meta log.Fields - if sw.conf.LogTraceSpansFailedToShip { - jsonEncodedSpans, _ := json.Marshal(spans) - meta = log.Fields{ - "error": err, - "payload": string(jsonEncodedSpans), - } - } else { - meta = log.Fields{ - "error": err, - } - } - - log.WithFields(meta).Error("Error shipping spans to SignalFx") - - // If there is an error sending spans then just forget about them. - return err - } - log.Debugf("Sent %d spans out of the agent", len(spans)) - } - return nil -} - -func (sw *Writer) processSpan(span *trace.Span) bool { - if !sw.PreprocessSpan(span) { - return false - } - - sw.spanSourceTracker.AddSourceTagsToSpan(span) - - if sw.conf.LogTraceSpans { - jsonEncoded, _ := json.Marshal(span) - log.Infof("Sending trace span:\n%s", string(jsonEncoded)) - } - - return true -} - -func (sw *Writer) startHostCorrelationTracking() *apmtracker.ActiveServiceTracker { - var sendTraceHostCorrelationMetrics bool - if sw.conf.SendTraceHostCorrelationMetrics != nil { - sendTraceHostCorrelationMetrics = *sw.conf.SendTraceHostCorrelationMetrics - } - - tracker := apmtracker.New( - utils.NewAPMShim(log.StandardLogger()), - sw.conf.StaleServiceTimeout.AsDuration(), - sw.correlationClient, - sw.hostIDDims, - sendTraceHostCorrelationMetrics, - func(dp *datapoint.Datapoint) { - // Immediately send correlation datapoints when we first see a service - sw.dpChan <- []*datapoint.Datapoint{dp} - }, - apmtracker.DefaultDimsToSyncSource, - ) - - // purge the active service tracker periodically - utils.RunOnInterval(sw.ctx, func() { - tracker.Purge() - }, sw.conf.TraceHostCorrelationPurgeInterval.AsDuration()) - - // Send the correlation datapoints at a regular interval to keep the - // service live on the backend. - utils.RunOnInterval(sw.ctx, func() { - for _, dp := range tracker.CorrelationDatapoints() { - sw.dpChan <- []*datapoint.Datapoint{dp} - } - }, sw.conf.TraceHostCorrelationMetricsInterval.AsDuration()) - - return tracker -} diff --git a/internal/signalfx-agent/pkg/core/writer/signalfx/writer.go b/internal/signalfx-agent/pkg/core/writer/signalfx/writer.go deleted file mode 100644 index 594348c96a..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/signalfx/writer.go +++ /dev/null @@ -1,398 +0,0 @@ -// Package signalfx contains the SignalFx writer. The writer is responsible for -// sending datapoints and events to SignalFx ingest. Ideally all data would -// flow through here, but right now a lot of it is written to ingest by -// collectd. -// -// The writer provides a channel that all monitors can submit datapoints on. -// All monitors should include the "monitorType" key in the `Meta` map of the -// datapoint for use in filtering. -package signalfx - -import ( - "context" - "errors" - "fmt" - "io" - "net" - "net/http" - "strings" - "syscall" - "time" - - "github.com/davecgh/go-spew/spew" - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/event" - "github.com/signalfx/golib/v3/sfxclient" - "github.com/signalfx/golib/v3/trace" - sfxwriter "github.com/signalfx/signalfx-go/writer" - log "github.com/sirupsen/logrus" - - "github.com/signalfx/signalfx-agent/pkg/apm/correlations" - libtracker "github.com/signalfx/signalfx-agent/pkg/apm/tracetracker" - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/writer/dimensions" - "github.com/signalfx/signalfx-agent/pkg/core/writer/processor" - "github.com/signalfx/signalfx-agent/pkg/core/writer/tracetracker" - "github.com/signalfx/signalfx-agent/pkg/monitors/types" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -const ( - // There cannot be more than this many events queued to be sent at any - // given time. This should be big enough for any reasonable use case. - eventBufferCapacity = 1000 -) - -// Writer is what sends events and datapoints to SignalFx ingest. It -// receives events/datapoints on two buffered channels and writes them to -// SignalFx on a regular interval. -type Writer struct { - *processor.Processor - - client *sfxclient.HTTPSink - correlationClient correlations.CorrelationClient - dimensionClient *dimensions.DimensionClient - datapointWriter *sfxwriter.DatapointWriter - spanWriter *sfxwriter.SpanWriter - - // Monitors should send events to this - eventChan chan *event.Event - dimensionChan chan *types.Dimension - - ctx context.Context - cancel context.CancelFunc - conf *config.WriterConfig - logger *utils.ThrottledLogger - - // map that holds host-specific ids like AWSUniqueID - hostIDDims map[string]string - - eventBuffer []*event.Event - - // Keeps track of what service names have been seen in trace spans that are - // emitted by the agent - serviceTracker *libtracker.ActiveServiceTracker - spanSourceTracker *tracetracker.SpanSourceTracker - - // Datapoints sent in the last minute - datapointsLastMinute int64 - // Datapoints that tried to be sent but couldn't in the last minute - datapointsFailedLastMinute int64 - // Events sent in the last minute - eventsLastMinute int64 - // Spans sent in the last minute - spansLastMinute int64 - - dpChan chan []*datapoint.Datapoint - spanChan chan []*trace.Span - dpsFailedToSend int64 - traceSpansDropped int64 - eventsSent int64 - startTime time.Time -} - -// New creates a new un-configured writer -func New(conf *config.WriterConfig, dpChan chan []*datapoint.Datapoint, eventChan chan *event.Event, - dimensionChan chan *types.Dimension, spanChan chan []*trace.Span, - spanSourceTracker *tracetracker.SpanSourceTracker) (*Writer, error) { - - logger := utils.NewThrottledLogger(log.WithFields(log.Fields{"component": "writer"}), 20*time.Second) - - ctx, cancel := context.WithCancel(context.Background()) - - dimensionClient, err := dimensions.NewDimensionClient(ctx, conf) - if err != nil { - cancel() - return nil, err - } - - client := &http.Client{ - Timeout: 10 * time.Second, - Transport: &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 5 * time.Second, - KeepAlive: 30 * time.Second, - }).DialContext, - MaxIdleConns: conf.MaxRequests, - MaxIdleConnsPerHost: conf.MaxRequests, - IdleConnTimeout: 30 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - }, - } - - correlationClient, err := correlations.NewCorrelationClient(utils.NewAPMShim(log.StandardLogger()), ctx, client, config.ClientConfigFromWriterConfig(conf)) - if err != nil { - cancel() - return nil, err - } - - sw := &Writer{ - Processor: processor.New(conf), - ctx: ctx, - cancel: cancel, - conf: conf, - logger: logger, - correlationClient: correlationClient, - dimensionClient: dimensionClient, - hostIDDims: conf.HostIDDims, - eventChan: eventChan, - dimensionChan: dimensionChan, - startTime: time.Now(), - spanSourceTracker: spanSourceTracker, - dpChan: dpChan, - spanChan: spanChan, - } - - sinkOptions := []sfxclient.HTTPSinkOption{} - switch strings.ToLower(conf.TraceExportFormat) { - case config.TraceExportFormatZipkin: - sinkOptions = append(sinkOptions, sfxclient.WithZipkinTraceExporter()) - case config.TraceExportFormatSAPM: - sinkOptions = append(sinkOptions, sfxclient.WithSAPMTraceExporter()) - default: - return nil, fmt.Errorf("trace export format '%s' is not supported", conf.TraceExportFormat) - } - - sw.client = sfxclient.NewHTTPSink(sinkOptions...) - sw.client.AuthToken = conf.SignalFxAccessToken - sw.client.AdditionalHeaders = conf.ExtraHeaders - - sw.client.Client.Timeout = conf.Timeout.AsDuration() - - sw.client.Client.Transport = &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 3 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - MaxIdleConns: 100, - MaxIdleConnsPerHost: conf.MaxRequests, - IdleConnTimeout: 30 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - } - - dpEndpointURL, err := conf.ParsedIngestURL().Parse("v2/datapoint") - if err != nil { - logger.WithFields(log.Fields{ - "error": err, - "ingestURL": conf.ParsedIngestURL().String(), - }).Error("Could not construct datapoint ingest URL") - return nil, err - } - sw.client.DatapointEndpoint = dpEndpointURL.String() - - eventEndpointURL := conf.ParsedEventEndpointURL() - if eventEndpointURL == nil { - var err error - eventEndpointURL, err = conf.ParsedIngestURL().Parse("v2/event") - if err != nil { - logger.WithFields(log.Fields{ - "error": err, - "ingestURL": conf.ParsedIngestURL().String(), - }).Error("Could not construct event ingest URL") - return nil, err - } - } - sw.client.EventEndpoint = eventEndpointURL.String() - - traceEndpointURL := conf.ParsedTraceEndpointURL() - if traceEndpointURL == nil { - var err error - traceEndpointURL, err = conf.ParsedIngestURL().Parse(conf.DefaultTraceEndpointPath()) - if err != nil { - logger.WithFields(log.Fields{ - "error": err, - "ingestURL": conf.ParsedIngestURL().String(), - }).Error("Could not construct trace ingest URL") - return nil, err - } - } - sw.client.TraceEndpoint = traceEndpointURL.String() - - sw.datapointWriter = &sfxwriter.DatapointWriter{ - PreprocessFunc: sw.processDatapoint, - SendFunc: sw.sendDatapoints, - OverwriteFunc: func() { - sw.logger.ThrottledWarning(fmt.Sprintf("A datapoint was overwritten in the write buffer, please consider increasing the writer.maxDatapointsBuffered config option to something greater than %d", conf.MaxDatapointsBuffered)) - }, - MaxBatchSize: conf.DatapointMaxBatchSize, - MaxRequests: conf.MaxRequests, - MaxBuffered: conf.MaxDatapointsBuffered, - InputChan: sw.dpChan, - } - - sw.spanWriter = &sfxwriter.SpanWriter{ - PreprocessFunc: sw.processSpan, - SendFunc: sw.sendSpans, - MaxBatchSize: conf.TraceSpanMaxBatchSize, - MaxRequests: conf.MaxRequests, - MaxBuffered: int(conf.MaxTraceSpansInFlight), - InputChan: sw.spanChan, - } - - logger.Infof("Sending datapoints to %s", sw.client.DatapointEndpoint) - logger.Infof("Sending events to %s", sw.client.EventEndpoint) - logger.Infof("Sending trace spans to %s", sw.client.TraceEndpoint) - - return sw, nil -} - -func (sw *Writer) Start() { - // The only reason this is on the struct and not a local var is so we can - // easily get diagnostic metrics from it - sw.serviceTracker = sw.startHostCorrelationTracking() - - go sw.maintainLastMinuteActivity() - - sw.dimensionClient.Start() - sw.correlationClient.Start() - - go sw.listenForEventsAndDimensionUpdates() - - sw.datapointWriter.Start(sw.ctx) - sw.spanWriter.Start(sw.ctx) -} - -func (sw *Writer) processDatapoint(dp *datapoint.Datapoint) bool { - if !sw.PreprocessDatapoint(dp) { - return false - } - - utils.TruncateDimensionValuesInPlace(dp.Dimensions) - - if sw.conf.LogDatapoints { - sw.logger.Debugf("Sending datapoint:\n%s", utils.DatapointToString(dp)) - } - - return true -} - -func (sw *Writer) sendDatapoints(ctx context.Context, dps []*datapoint.Datapoint) error { - // This sends synchronously and retries on transient connection errors - err := sw.client.AddDatapoints(ctx, dps) - if err != nil { - if isTransientError(err) { - sw.logger.Debugf("retrying datapoint submission after receiving temporary network error: %v\n", err) - err = sw.client.AddDatapoints(ctx, dps) - } - if err != nil { - sw.logger.WithFields(log.Fields{ - "error": utils.SanitizeHTTPError(err), - }).Error("Error shipping datapoints to SignalFx") - // If there is an error sending datapoints then just forget about them. - return err - } - - } - - sw.logger.Debugf("Sent %d datapoints out of the agent", len(dps)) - - return nil -} - -// isTransientError will walk through errors wrapped by candidate -// and return true if any is temporary, ECONNRESET, or EOF. -func isTransientError(candidate error) bool { - var isTemporary, isReset, isEOF bool - for candidate != nil { - if temp, ok := candidate.(interface{ Temporary() bool }); ok { - if temp.Temporary() { - isTemporary = true - break - } - } - - if se, ok := candidate.(syscall.Errno); ok { - if se == syscall.ECONNRESET { - isReset = true - break - } - } - - if candidate == io.EOF { - isEOF = true - break - } - candidate = errors.Unwrap(candidate) - } - - return isTemporary || isReset || isEOF -} - -func (sw *Writer) sendEvents(events []*event.Event) error { - for i := range events { - sw.PreprocessEvent(events[i]) - - if sw.conf.LogEvents { - sw.logger.WithFields(log.Fields{ - "event": spew.Sdump(events[i]), - }).Debug("Sending event") - } - } - - if sw.client != nil { - err := sw.client.AddEvents(context.Background(), events) - if err != nil { - return err - } - } - sw.eventsSent += int64(len(events)) - sw.logger.Debugf("Sent %d events to SignalFx", len(events)) - - return nil -} - -func (sw *Writer) listenForEventsAndDimensionUpdates() { - eventTicker := time.NewTicker(time.Duration(sw.conf.EventSendIntervalSeconds) * time.Second) - defer eventTicker.Stop() - - initEventBuffer := func() { - sw.eventBuffer = make([]*event.Event, 0, eventBufferCapacity) - } - initEventBuffer() - - for { - select { - case <-sw.ctx.Done(): - return - - case event := <-sw.eventChan: - if len(sw.eventBuffer) > eventBufferCapacity { - sw.logger.WithFields(log.Fields{ - "eventType": event.EventType, - "eventBufferLength": len(sw.eventBuffer), - }).Error("Dropping event due to overfull buffer") - continue - } - sw.eventBuffer = append(sw.eventBuffer, event) - - case <-eventTicker.C: - if len(sw.eventBuffer) > 0 { - go func(buf []*event.Event) { - if err := sw.sendEvents(buf); err != nil { - - sw.logger.WithError(utils.SanitizeHTTPError(err)).Error("Error shipping events to SignalFx") - } - }(sw.eventBuffer) - initEventBuffer() - } - case dim := <-sw.dimensionChan: - if err := sw.dimensionClient.AcceptDimension(dim); err != nil { - sw.logger.WithFields(log.Fields{ - "dimName": dim.Name, - "dimValue": dim.Value, - }).WithError(utils.SanitizeHTTPError(err)).Warn("Dropping dimension update") - } - } - } -} - -// Shutdown the writer and stop sending datapoints -func (sw *Writer) Shutdown() { - if sw.cancel != nil { - sw.cancel() - } - sw.logger.Debug("Stopped datapoint writer") -} diff --git a/internal/signalfx-agent/pkg/core/writer/signalfx/writer_test.go b/internal/signalfx-agent/pkg/core/writer/signalfx/writer_test.go deleted file mode 100644 index 6d4dab8bda..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/signalfx/writer_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package signalfx - -import ( - "fmt" - "io" - "syscall" - "testing" - "time" - - "github.com/signalfx/signalfx-agent/pkg/utils/timeutil" - - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/stretchr/testify/require" -) - -var essentialWriterConfig = config.WriterConfig{ - SignalFxAccessToken: "11111", - PropertiesHistorySize: 100, - PropertiesSendDelaySeconds: 1, - TraceExportFormat: "zipkin", - TraceHostCorrelationMetricsInterval: timeutil.Duration(1 * time.Second), - TraceHostCorrelationPurgeInterval: timeutil.Duration(1 * time.Second), - StaleServiceTimeout: timeutil.Duration(1 * time.Second), - EventSendIntervalSeconds: 1, -} - -func TestWriterSetup(t *testing.T) { - t.Run("Overrides event URL", func(t *testing.T) { - t.Parallel() - conf := essentialWriterConfig - conf.EventEndpointURL = "http://example.com/v2/event" - writer, err := New(&conf, nil, nil, nil, nil, nil) - - require.Nil(t, err) - require.Equal(t, "http://example.com/v2/event", writer.client.EventEndpoint) - }) - - t.Run("Sets default event URL", func(t *testing.T) { - t.Parallel() - conf := essentialWriterConfig - conf.IngestURL = "http://example.com" - writer, err := New(&conf, nil, nil, nil, nil, nil) - require.Nil(t, err) - require.Equal(t, "http://example.com/v2/event", writer.client.EventEndpoint) - }) -} - -type tempError struct { - temporary func() bool -} - -func (t tempError) Error() string { return fmt.Sprintf("%v", t.temporary()) } -func (t tempError) Temporary() bool { return t.temporary() } - -func TestIsTransientError(t *testing.T) { - tests := []struct { - name string - err error - expected bool - }{ - {"not a transient error", fmt.Errorf("not_transient"), false}, - {"eof error", io.EOF, true}, - {"econnreset error", syscall.ECONNRESET, true}, - {"temporary error", tempError{func() bool { return true }}, true}, - {"not temporary error", tempError{func() bool { return false }}, false}, - } - for i := range tests { - test := tests[i] - t.Run(test.name, func(tt *testing.T) { - require.Equal(tt, test.expected, isTransientError(test.err)) - - wrapped := fmt.Errorf("%w", test.err) - require.Equal(tt, test.expected, isTransientError(wrapped)) - - doublyWrapped := fmt.Errorf("%w", wrapped) - require.Equal(tt, test.expected, isTransientError(doublyWrapped)) - }) - } -} diff --git a/internal/signalfx-agent/pkg/core/writer/splunk/log_event_ring.gen.go b/internal/signalfx-agent/pkg/core/writer/splunk/log_event_ring.gen.go deleted file mode 100644 index 75885b7ec6..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/splunk/log_event_ring.gen.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by genny. DO NOT EDIT. -// This file was automatically generated by genny. -// Any changes will be lost if this file is regenerated. -// see https://github.com/mauricelam/genny - -package splunk - -// nolint: dupl - -// LogEntryRingBuffer is a ring buffer that supports inserting and reading -// chunks of elements in an orderly fashion. It is NOT thread-safe and the -// returned batches are not copied, they are a slice against the original -// backing array of this logEntry. This means that if the buffer wraps around, -// elements in the slice returned by NextBatch will be changed, and you are -// subject to all of the rules of Go's memory model if accessing the data in a -// separate goroutine. -type LogEntryRingBuffer struct { - // The main buffer - buffer []logEntry - // Store length explicitly as optimization - bufferLen int - - nextIdx int - // How many times around the ring buffer we have gone when putting - // datapoints onto the buffer - writtenCircuits int64 - - // The index that indicates the last read position in the buffer. It is - // one greater than the actual index, to match the golang slice high range. - readHigh int - - // How many elements are in the buffer on which processing has not begun. - // This could be calculated from readHigh and nextIdx on demand, but - // precalculate it in Add and NextBatch since it tends to get read often. - // Also by precalculating it, we can tell if the buffer was completely - // overwritten since the last read. - unprocessed int -} - -// NewLogEntryRingBuffer creates a new initialized buffer ready for use. -func NewLogEntryRingBuffer(size int) *LogEntryRingBuffer { - return &LogEntryRingBuffer{ - // Preallocate the buffer to its maximum length - buffer: make([]logEntry, size), - bufferLen: size, - } -} - -// Add an logEntry to the buffer. It will overwrite any existing element in the -// buffer as the buffer wraps around. Returns whether the new element -// overwrites an uncommitted element already in the buffer. -func (b *LogEntryRingBuffer) Add(inst logEntry) (isOverwrite bool) { - if b.unprocessed >= b.bufferLen { - isOverwrite = true - // Drag the read cursor along with the overwritten elements - b.readHigh++ - if b.readHigh > b.bufferLen { - // Wrap around to cover the 0th element of the buffer - b.readHigh = 1 - } - } else { - b.unprocessed++ - } - - b.buffer[b.nextIdx] = inst - b.nextIdx++ - - if b.nextIdx == b.bufferLen { // Wrap around the buffer - b.nextIdx = 0 - b.writtenCircuits++ - } - - return isOverwrite -} - -// Size returns how many elements can fit in the buffer at once. -func (b *LogEntryRingBuffer) Size() int { - return b.bufferLen -} - -// UnprocessedCount returns the number of elements that have been written to -// the buffer but not read via NextBatch. -func (b *LogEntryRingBuffer) UnprocessedCount() int { - return b.unprocessed -} - -// NextBatch returns the next batch of unprocessed elements. If there are -// none, this can return nil. -func (b *LogEntryRingBuffer) NextBatch(maxSize int) []logEntry { - prevReadHigh := b.readHigh - if prevReadHigh == b.bufferLen { - // Wrap around - prevReadHigh = 0 - } - - if b.unprocessed == 0 { - return nil - } - - targetSize := b.unprocessed - if targetSize > maxSize { - targetSize = maxSize - } - - b.readHigh = prevReadHigh + targetSize - if b.readHigh > b.bufferLen { - // Wrap around happened, just take what we have left until wrap around - // so that we can take a single slice of it since slice ranges can't - // wrap around. - b.readHigh = b.bufferLen - } - - b.unprocessed -= b.readHigh - prevReadHigh - - out := b.buffer[prevReadHigh:b.readHigh] - - return out -} diff --git a/internal/signalfx-agent/pkg/core/writer/splunk/log_event_writer.gen.go b/internal/signalfx-agent/pkg/core/writer/splunk/log_event_writer.gen.go deleted file mode 100644 index d85f6853d7..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/splunk/log_event_writer.gen.go +++ /dev/null @@ -1,323 +0,0 @@ -// Code generated by genny. DO NOT EDIT. -// This file was automatically generated by genny. -// Any changes will be lost if this file is regenerated. -// see https://github.com/mauricelam/genny - -package splunk - -// nolint: dupl - -import ( - "context" - "sync/atomic" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/sfxclient" -) - -// LogEntryPreprocessor is used to filter out or otherwise change logEntrys -// before being sent. If the return value is false, the logEntry won't be -// sent. -type LogEntryPreprocessor func(logEntry) bool - -// LogEntrySender is what sends a slice of logEntrys. It should block until -// the logEntrys have been sent, or an error has occurred. -type LogEntrySender func(context.Context, []logEntry) error - -const ( - DefaultLogEntryMaxBuffered = 10000 - DefaultLogEntryMaxRequests = 10 - DefaultLogEntryMaxBatchSize = 1000 -) - -// LogEntryWriter is an abstraction that accepts a bunch of logEntrys, buffers -// them in a circular buffer and sends them out in concurrent batches. This -// prioritizes newer LogEntrys at the expense of older ones, which is generally -// desirable from a monitoring standpoint. -// -// You must call the non-blocking method Start on a created logEntry for it to -// do anything. -type LogEntryWriter struct { - // This must be provided by the user of this writer. - InputChan chan []logEntry - - // PreprocessFunc can be used for filtering or modifying logEntrys before - // being sent. If PreprocessFunc returns false, the logEntry will not be - // sent. PreprocessFunc can be left nil, in which case all logEntrys will - // be sent. - PreprocessFunc LogEntryPreprocessor - - // SendFunc must be provided as the writer is useless without it. SendFunc - // should synchronously process/send the LogEntrys passed to it and not - // return until they have been dealt with. The slice passed to SendFunc - // should not be used after the function returns, as its backing array - // might get reused. - SendFunc LogEntrySender - - // OverwriteFunc can be set to a function that will be called - // whenever an Add call to the underlying ring buffer results in the - // overwriting of an unprocessed logEntry. - OverwriteFunc func() - - // The maximum number of LogEntrys that this writer will hold before - // overwriting. You must set this before calling Start. - MaxBuffered int - // The maximum number of concurrent calls to sendFunc that can be - // active at a given logEntry. You must set this before calling Start. - MaxRequests int - // The biggest batch of LogEntrys the writer will emit to sendFunc at once. - // You must set this before calling Start. - MaxBatchSize int - - shutdownFlag chan struct{} - buff *LogEntryRingBuffer - requestDoneCh chan int64 - - // Holds up to MaxRequests slices that can be used to copy in logEntry - // pointers to avoid reusing the backing array of the ring buffer and - // risking overwriting in the middle of sending. - chunkSliceCache chan []logEntry - - _ int32 - - requestsActive int64 - // LogEntrys waiting to be sent but are blocked due to MaxRequests limit - totalWaiting int64 - - // Purely internal metrics. If accessing any of these externally, use - // atomic.LoadInt64! - TotalReceived int64 - TotalFilteredOut int64 - TotalInFlight int64 - TotalSent int64 - TotalFailedToSend int64 - TotalOverwritten int64 -} - -// WaitForShutdown will block until all of the elements inserted to the writer -// have been processed. -func (w *LogEntryWriter) WaitForShutdown() { - if w.shutdownFlag == nil { - panic("should not wait for writer shutdown when not running") - } - - <-w.shutdownFlag -} - -// Returns a slice that has size len. This reuses the backing array of the -// slices for all requests, so that only MaxRequests must be allocated for the -// lifetime of the writer. Benchmark shows that this improves performance by -// ~5% and reduces allocations within the writer to almost zero. -func (w *LogEntryWriter) getChunkSlice(size int) []logEntry { - slice := <-w.chunkSliceCache - - // Nil out the elements above size in the slice so they will be GCed - // quickly. If you shorten a slice with the s[:n] trick, as below, without - // niling out truncated elements, they won't be cleaned up. If batches are - // roughly the same size this will be minimal. - for i := size; i < len(slice); i++ { - slice[i] = nil - } - - return slice[:size] -} - -// Try and send the next batch in the buffer, if there are requests available. -func (w *LogEntryWriter) tryToSendChunk(ctx context.Context) { - totalUnprocessed := w.buff.UnprocessedCount() - if w.requestsActive >= int64(w.MaxRequests) { - w.totalWaiting = int64(totalUnprocessed) - // The request done handler will notice that there are logEntrys - // waiting to be sent and will call this method again. - return - } - - chunk := w.buff.NextBatch(w.MaxBatchSize) - - count := int64(len(chunk)) - if count == 0 { - return - } - - atomic.AddInt64(&w.TotalInFlight, count) - w.requestsActive++ - - chunkCopy := w.getChunkSlice(len(chunk)) - // Make a copy of the slice in the buffer so that it is safe against - // being overwritten by wrap around (NextBatch returns a slice against - // the original backing array of the buffer). - copy(chunkCopy, chunk) - - // Nil out existing elements in the buffer so they get GCd. - for i := range chunk { - chunk[i] = nil - } - - go func() { - err := w.SendFunc(ctx, chunkCopy) - if err != nil { - // Use atomic so that internal metrics method doesn't have to - // run in the same goroutine. - atomic.AddInt64(&w.TotalFailedToSend, count) - } else { - atomic.AddInt64(&w.TotalSent, count) - } - - w.chunkSliceCache <- chunkCopy - w.requestDoneCh <- count - }() - - w.totalWaiting = int64(w.buff.UnprocessedCount()) -} - -func (w *LogEntryWriter) processInput(ctx context.Context, insts []logEntry) { - atomic.AddInt64(&w.TotalReceived, int64(len(insts))) - for i := range insts { - if w.PreprocessFunc != nil && !w.PreprocessFunc(insts[i]) { - atomic.AddInt64(&w.TotalFilteredOut, 1) - continue - } - - if w.buff.Add(insts[i]) { - atomic.AddInt64(&w.TotalOverwritten, 1) - if w.OverwriteFunc != nil { - w.OverwriteFunc() - } - } - - // Handle request done cleanup and try to send chunks if the buffer - // gets full so that we can avoid overflowing the buffer on big input - // slices where len(insts) > w.MaxBuffered. - select { - case count := <-w.requestDoneCh: - w.handleRequestDone(ctx, count) - default: - // If there isn't any request done then continue on - } - - if w.buff.UnprocessedCount() >= w.MaxBatchSize { - w.tryToSendChunk(ctx) - } - } - -} - -// Start the writer processing loop -func (w *LogEntryWriter) Start(ctx context.Context) { - // Initialize the writer fields in the same goroutine as the one calling - // start to avoid data races when calling WaitForShutdown. - w.shutdownFlag = make(chan struct{}) - - if w.MaxBuffered == 0 { - w.MaxBuffered = DefaultLogEntryMaxBuffered - } - if w.MaxRequests == 0 { - w.MaxRequests = DefaultLogEntryMaxRequests - } - if w.MaxBatchSize == 0 { - w.MaxBatchSize = DefaultLogEntryMaxBatchSize - } - - w.buff = NewLogEntryRingBuffer(w.MaxBuffered) - - go func() { - w.run(ctx) - close(w.shutdownFlag) - }() -} - -func (w *LogEntryWriter) handleRequestDone(ctx context.Context, count int64) { - w.requestsActive-- - atomic.AddInt64(&w.TotalInFlight, -count) - - if w.totalWaiting > 0 { - w.tryToSendChunk(ctx) - } -} - -// run waits for LogEntrys to come in on the provided channel and gives them to -// sendFunc in batches. This function blocks until the provided context is -// canceled. -// nolint: dupl -func (w *LogEntryWriter) run(ctx context.Context) { - // Make the slice copy cache and prime it with preallocated slices - w.chunkSliceCache = make(chan []logEntry, w.MaxRequests) - for i := 0; i < w.MaxRequests; i++ { - w.chunkSliceCache <- make([]logEntry, 0, w.MaxBatchSize) - } - - w.requestDoneCh = make(chan int64, w.MaxRequests) - - waitForRequests := func() { - for w.requestsActive > 0 { - count := <-w.requestDoneCh - w.handleRequestDone(ctx, count) - } - } - - drainInput := func() { - defer waitForRequests() - defer w.tryToSendChunk(ctx) - for { - select { - case insts := <-w.InputChan: - w.processInput(ctx, insts) - default: - return - } - } - } - - // The main loop. The basic technique is to pull as many LogEntrys from - // the input channel as possible until the channel is exhausted, at which - // point the LogEntrys are attempted to be sent. All of the request - // finalization is also handled here so that everything is done within a - // single goroutine and does not require explicit locking. - for { - select { - case <-ctx.Done(): - drainInput() - return - - case insts := <-w.InputChan: - w.processInput(ctx, insts) - - case count := <-w.requestDoneCh: - w.handleRequestDone(ctx, count) - - default: - // The input chan is exhaused, try to send whatever was there. - w.tryToSendChunk(ctx) - - // Duplicate the cases from above to avoid hot looping and using - // unnecessary CPU. - select { - case <-ctx.Done(): - drainInput() - return - - case count := <-w.requestDoneCh: - w.handleRequestDone(ctx, count) - - case insts := <-w.InputChan: - w.processInput(ctx, insts) - } - } - } -} - -// InternalMetrics about the logEntry writer -func (w *LogEntryWriter) InternalMetrics(prefix string) []*datapoint.Datapoint { - return []*datapoint.Datapoint{ - sfxclient.CumulativeP(prefix+"instances_sent", nil, &w.TotalSent), - sfxclient.CumulativeP(prefix+"instances_failed", nil, &w.TotalFailedToSend), - sfxclient.CumulativeP(prefix+"instances_filtered", nil, &w.TotalFilteredOut), - sfxclient.CumulativeP(prefix+"instances_received", nil, &w.TotalReceived), - sfxclient.CumulativeP(prefix+"instances_overwritten", nil, &w.TotalOverwritten), - sfxclient.Gauge(prefix+"instances_buffered", nil, int64(w.buff.UnprocessedCount())), - sfxclient.Gauge(prefix+"instances_max_buffered", nil, int64(w.buff.Size())), - sfxclient.Gauge(prefix+"instances_in_flight", nil, atomic.LoadInt64(&w.TotalInFlight)), - sfxclient.Gauge(prefix+"instances_waiting", nil, atomic.LoadInt64(&w.totalWaiting)), - sfxclient.Gauge(prefix+"instance_requests_active", nil, atomic.LoadInt64(&w.requestsActive)), - } -} diff --git a/internal/signalfx-agent/pkg/core/writer/splunk/splunk.go b/internal/signalfx-agent/pkg/core/writer/splunk/splunk.go deleted file mode 100644 index 813cc11577..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/splunk/splunk.go +++ /dev/null @@ -1,313 +0,0 @@ -package splunk - -//go:generate sh -c "`go env GOPATH`/bin/genny -ast -pkg splunk -in `go env GOPATH`/pkg/mod/github.com/signalfx/signalfx-go@v1.33.0/writer/template/ring.go gen Instance=logEntry | sed -e s/*logEntry/logEntry/g > ./log_event_ring.gen.go" - -//go:generate sh -c "`go env GOPATH`/bin/genny -ast -pkg splunk -in `go env GOPATH`/pkg/mod/github.com/signalfx/signalfx-go@v1.33.0/writer/template/writer.go gen Instance=logEntry | sed -e s/*logEntry/logEntry/g > ./log_event_writer.gen.go" - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "strings" - "time" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/event" - "github.com/signalfx/golib/v3/trace" - "github.com/sirupsen/logrus" - - "github.com/signalfx/signalfx-agent/pkg/core/common/httpclient" - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/writer/processor" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -const ( - unknownHost = "unknown" -) - -// Output posts data to Splunk HTTP Event Collector. -type Output struct { - *processor.Processor - - httpClient *http.Client - url string - token string - metricsSource string - metricsSourceType string - metricsIndex string - eventsSource string - eventsSourceType string - eventsIndex string - skipTLSVerify bool - hostIDDims map[string]string - - entryWriter *LogEntryWriter - - ctx context.Context - cancel context.CancelFunc - - dpChan chan []*datapoint.Datapoint - eventChan chan *event.Event - spanChan chan []*trace.Span -} - -// Build a Splunk Writer. -func New(conf *config.WriterConfig, dpChan chan []*datapoint.Datapoint, eventChan chan *event.Event, spanChan chan []*trace.Span) (*Output, error) { - out := &Output{ - Processor: processor.New(conf), - url: conf.Splunk.URL, - token: conf.Splunk.Token, - metricsSource: conf.Splunk.MetricsSource, - metricsSourceType: conf.Splunk.MetricsSourceType, - metricsIndex: conf.Splunk.MetricsIndex, - eventsSource: conf.Splunk.EventsSource, - eventsSourceType: conf.Splunk.EventsSourceType, - eventsIndex: conf.Splunk.EventsIndex, - skipTLSVerify: conf.Splunk.SkipTLSVerify, - hostIDDims: conf.HostIDDims, - dpChan: dpChan, - eventChan: eventChan, - spanChan: spanChan, - } - - out.ctx, out.cancel = context.WithCancel(context.Background()) - - httpConfig := httpclient.HTTPConfig{ - SkipVerify: conf.Splunk.SkipTLSVerify, - UseHTTPS: strings.HasPrefix(conf.Splunk.URL, "https"), - } - - httpClient, err := httpConfig.Build() - if err != nil { - return nil, err - } - out.httpClient = httpClient - - out.entryWriter = &LogEntryWriter{ - SendFunc: func(ctx context.Context, entries []logEntry) error { - err := out.sendToSplunk(ctx, entries) - if err != nil { - logrus.WithError(utils.SanitizeHTTPError(err)).Error("Failed to send to Splunk HEC") - } - return err - }, - MaxBatchSize: conf.Splunk.MaxBatchSize, - MaxRequests: conf.Splunk.MaxRequests, - MaxBuffered: conf.Splunk.MaxBuffered, - InputChan: make(chan []logEntry, 1000), - } - - return out, nil -} - -func (o *Output) Start() { - o.entryWriter.Start(o.ctx) - - logrus.Infof("Sending Splunk HEC entries to %s", o.url) - - go func() { - for { - var entries []logEntry - - select { - case <-o.ctx.Done(): - return - case dps := <-o.dpChan: - for i := range dps { - if !o.PreprocessDatapoint(dps[i]) { - continue - } - entries = append(entries, o.convertDatapoint(dps[i])) - } - case event := <-o.eventChan: - if !o.PreprocessEvent(event) { - continue - } - entries = append(entries, o.convertEvent(event)) - case spans := <-o.spanChan: - for _, span := range spans { - if !o.PreprocessSpan(span) { - continue - } - entries = append(entries, o.convertSpan(span)) - } - } - - if len(entries) > 0 { - o.entryWriter.InputChan <- entries - } - } - }() -} - -func toString(obj interface{}) string { - if stringer, ok := obj.(fmt.Stringer); ok { - return stringer.String() - } - return fmt.Sprintf("%v", obj) -} - -func computeTime(timestamp time.Time) int64 { - if timestamp.IsZero() { - return time.Now().UnixNano() / time.Millisecond.Nanoseconds() - } - return timestamp.UnixNano() / time.Millisecond.Nanoseconds() -} - -// LogDatapoint logs a datapoint as a Splunk metric event -func (o *Output) convertDatapoint(d *datapoint.Datapoint) *logMetric { - fields := make(map[string]string) - - for key, v := range d.Meta { - if v != nil { - fields[toString(key)] = toString(v) - } - } - for key, v := range d.Dimensions { - fields[toString(key)] = toString(v) - } - - fields["metric_type"] = d.MetricType.String() - fields["metric_name:"+d.Metric] = d.Value.String() - - host := d.Dimensions["host"] - if host == "" { - host = unknownHost - } - return &logMetric{ - Time: computeTime(d.Timestamp), - Host: host, - Source: o.metricsSource, - SourceType: o.metricsSourceType, - Index: o.metricsIndex, - Event: "metric", - Fields: fields, - } -} - -// convertEvent converts an event as a Splunk event -func (o *Output) convertEvent(e *event.Event) *logEvent { - props := make(map[string]string) - for key, v := range e.Properties { - if v != nil { - props[key] = toString(v) - } - } - - meta := make(map[string]string) - for key, v := range e.Meta { - if v != nil { - meta[toString(key)] = toString(v) - } - } - host := e.Dimensions["host"] - if host == "" { - host = unknownHost - } - return &logEvent{ - Time: computeTime(e.Timestamp), - Host: host, - Source: o.eventsSource, - SourceType: o.eventsSourceType, - Index: o.eventsIndex, - Event: eventdata{Properties: props, Dimensions: e.Dimensions, Meta: meta, EventType: e.EventType, Category: e.Category}, - } -} - -// convertSpan converts a span as a Splunk event -func (o *Output) convertSpan(s *trace.Span) *logSpan { - - meta := make(map[string]string) - for key, v := range s.Meta { - if v != nil { - meta[toString(key)] = toString(v) - } - } - - b, err := json.Marshal(s.LocalEndpoint) - var host string - if err != nil { - host = unknownHost - } else { - host = string(b) - } - - ts := *s.Timestamp - if ts == 0 { - ts = time.Now().UnixNano() / time.Millisecond.Nanoseconds() - } - - return &logSpan{ - Time: ts, - Host: host, - Source: o.eventsSource, - SourceType: o.eventsSourceType, - Index: o.eventsIndex, - Event: spandata{TraceID: s.TraceID, ID: s.ID, Name: s.Name, LocalEndpoint: s.LocalEndpoint, RemoteEndpoint: s.RemoteEndpoint, Debug: s.Debug, Duration: s.Duration, Kind: s.Kind, ParentID: s.ParentID, Shared: s.Shared, Tags: s.Tags, Meta: meta, Annotations: s.Annotations}, - } -} - -func (o *Output) sendToSplunk(ctx context.Context, entries []logEntry) error { - buf := new(bytes.Buffer) - encoder := json.NewEncoder(buf) - - for i := range entries { - err := encoder.Encode(entries[i]) - if err != nil { - return err - } - - _, err = buf.WriteString("\r\n\r\n") - if err != nil { - return fmt.Errorf("failed to write line separator: %v", err) - } - } - - return o.doRequest(ctx, buf) -} - -func (o *Output) doRequest(ctx context.Context, b io.Reader) error { - url := o.url - req, err := http.NewRequestWithContext(ctx, "POST", url, b) - if err != nil { - return err - } - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Authorization", "Splunk "+o.token) - - res, err := o.httpClient.Do(req) - if err != nil { - return err - } - - defer res.Body.Close() - - switch res.StatusCode { - case 200: - _, _ = io.Copy(ioutil.Discard, res.Body) - return nil - default: - buf := new(bytes.Buffer) - _, _ = buf.ReadFrom(res.Body) - responseBody := buf.String() - err = fmt.Errorf("non-200 response received (%d): %s", res.StatusCode, responseBody) - } - return err -} - -func (o *Output) Shutdown() { - if o.cancel != nil { - o.cancel() - } -} - -// InternalMetrics returns a set of metrics showing how the writer is currently -// doing. -func (o *Output) InternalMetrics() []*datapoint.Datapoint { - return o.entryWriter.InternalMetrics("splunk_writer.") -} diff --git a/internal/signalfx-agent/pkg/core/writer/splunk/splunk_test.go b/internal/signalfx-agent/pkg/core/writer/splunk/splunk_test.go deleted file mode 100644 index 97baa2f793..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/splunk/splunk_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package splunk - -import ( - "encoding/json" - "testing" - "time" - - "github.com/signalfx/golib/v3/trace" - - "github.com/signalfx/golib/v3/event" -) - -func TestSplunkEventMarshal(t *testing.T) { - myEvent := logEvent{ - Time: time.Date(1990, 1, 1, 0, 0, 0, 0, time.UTC).UnixNano() / int64(time.Millisecond), - Host: "localhost", - Source: "sfx", - SourceType: "sfx", - Index: "sfx", - Event: eventdata{ - Category: event.USERDEFINED, - EventType: "Type", - Meta: map[string]string{"foo": "bar"}, - Dimensions: map[string]string{"foo": "bar"}, - Properties: map[string]string{"foo": "bar"}, - }, - } - b, err := json.Marshal(myEvent) - if err != nil { - t.Fatal(err) - } - expected := "{\"time\":631152000000,\"host\":\"localhost\",\"source\":\"sfx\",\"sourcetype\":\"sfx\",\"index\":\"sfx\",\"event\":{\"category\":1000000,\"eventType\":\"Type\",\"meta\":{\"foo\":\"bar\"},\"dimensions\":{\"foo\":\"bar\"},\"properties\":{\"foo\":\"bar\"}}}" - if string(b) != expected { - t.Fatalf("JSON serialization does not match, expected: %s,\n got %s", expected, string(b)) - } -} - -func TestSplunkMetricMarshal(t *testing.T) { - myMetric := logMetric{ - Time: time.Date(1990, 1, 1, 0, 0, 0, 0, time.UTC).UnixNano() / int64(time.Millisecond), - Host: "localhost", - Source: "sfx", - SourceType: "sfx", - Index: "sfx", - Event: "metric", - Fields: map[string]string{"foo": "bar"}, - } - b, err := json.Marshal(myMetric) - if err != nil { - t.Fatal(err) - } - expected := "{\"time\":631152000000,\"host\":\"localhost\",\"source\":\"sfx\",\"sourcetype\":\"sfx\",\"index\":\"sfx\",\"event\":\"metric\",\"fields\":{\"foo\":\"bar\"}}" - if string(b) != expected { - t.Fatalf("JSON serialization does not match, expected: %s,\n got %s", expected, string(b)) - } -} - -func TestSplunkSpanMarshal(t *testing.T) { - name := "foo" - duration := int64(1000) - kind := "dashboard" - annotations := []*trace.Annotation{{ - Timestamp: &duration, - Value: &name, - }} - serviceName := "myservice" - localhost := "127.0.0.1" - myTrace := logSpan{ - Time: time.Date(1990, 1, 1, 0, 0, 0, 0, time.UTC).UnixNano() / int64(time.Millisecond), - Host: "localhost", - Source: "sfx", - SourceType: "sfx", - Index: "sfx", - Event: spandata{ - Meta: map[string]string{"foo": "bar"}, - Debug: nil, - Name: &name, - Duration: &duration, - Kind: &kind, - ParentID: nil, - Shared: nil, - Tags: map[string]string{"foo": "bar"}, - Annotations: annotations, - ID: "myID", - TraceID: "myTraceID", - LocalEndpoint: &trace.Endpoint{ - ServiceName: &serviceName, - Ipv4: &localhost, - Ipv6: nil, - Port: nil, - }, - RemoteEndpoint: nil, - }, - } - b, err := json.Marshal(myTrace) - if err != nil { - t.Fatal(err) - } - expected := "{\"time\":631152000000,\"host\":\"localhost\",\"source\":\"sfx\",\"sourcetype\":\"sfx\",\"index\":\"sfx\",\"event\":{\"meta\":{\"foo\":\"bar\"},\"name\":\"foo\",\"duration\":1000,\"kind\":\"dashboard\",\"tags\":{\"foo\":\"bar\"},\"annotations\":[{\"timestamp\":1000,\"value\":\"foo\"}],\"id\":\"myID\",\"traceID\":\"myTraceID\",\"localEndpoint\":{\"serviceName\":\"myservice\",\"ipv4\":\"127.0.0.1\"}}}" - if string(b) != expected { - t.Fatalf("JSON serialization does not match, expected: %s,\n got %s", expected, string(b)) - } -} diff --git a/internal/signalfx-agent/pkg/core/writer/splunk/types.go b/internal/signalfx-agent/pkg/core/writer/splunk/types.go deleted file mode 100644 index 3d1cdf74a0..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/splunk/types.go +++ /dev/null @@ -1,64 +0,0 @@ -package splunk - -import ( - "github.com/signalfx/golib/v3/event" - "github.com/signalfx/golib/v3/trace" -) - -// Just a dummy interface that covers all types of HEC inputs -type logEntry interface{} - -type eventdata struct { - Category event.Category `json:"category"` - EventType string `json:"eventType"` - Meta map[string]string `json:"meta"` - Dimensions map[string]string `json:"dimensions"` - Properties map[string]string `json:"properties"` -} - -type spandata struct { - Meta map[string]string `json:"meta"` - Debug *bool `json:"debug,omitempty"` - Name *string `json:"name,omitempty"` - Duration *int64 `json:"duration,omitempty"` - Kind *string `json:"kind,omitempty"` - ParentID *string `json:"parentID,omitempty"` - Shared *bool `json:"shared,omitempty"` - Tags map[string]string `json:"tags"` - Annotations []*trace.Annotation `json:"annotations,omitempty"` - ID string `json:"id"` - TraceID string `json:"traceID"` - LocalEndpoint *trace.Endpoint `json:"localEndpoint,omitempty"` - RemoteEndpoint *trace.Endpoint `json:"remoteEndpoint,omitempty"` -} - -// This is the format that the HEC input accepts -type logMetric struct { - Time int64 `json:"time"` // epoch time - Host string `json:"host"` // hostname - Source string `json:"source,omitempty"` // optional description of the source of the event; typically the app's name - SourceType string `json:"sourcetype,omitempty"` // optional name of a Splunk parsing configuration; this is usually inferred by Splunk - Index string `json:"index,omitempty"` // optional name of the Splunk index to store the event in; not required if the token has a default index set in Splunk - Event string `json:"event"` // type of event: this is a metric. - Fields map[string]string `json:"fields"` // metric data -} - -// This is the format that the HEC input accepts -type logEvent struct { - Time int64 `json:"time"` // epoch time - Host string `json:"host"` // hostname - Source string `json:"source,omitempty"` // optional description of the source of the event; typically the app's name - SourceType string `json:"sourcetype,omitempty"` // optional name of a Splunk parsing configuration; this is usually inferred by Splunk - Index string `json:"index,omitempty"` // optional name of the Splunk index to store the event in; not required if the token has a default index set in Splunk - Event eventdata `json:"event"` // event data -} - -// This is the format that the HEC input accepts -type logSpan struct { - Time int64 `json:"time"` // epoch time - Host string `json:"host"` // hostname - Source string `json:"source,omitempty"` // optional description of the source of the event; typically the app's name - SourceType string `json:"sourcetype,omitempty"` // optional name of a Splunk parsing configuration; this is usually inferred by Splunk - Index string `json:"index,omitempty"` // optional name of the Splunk index to store the event in; not required if the token has a default index set in Splunk - Event spandata `json:"event"` // event data -- span -} diff --git a/internal/signalfx-agent/pkg/core/writer/tracetracker/host.go b/internal/signalfx-agent/pkg/core/writer/tracetracker/host.go deleted file mode 100644 index 2e6d977f50..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/tracetracker/host.go +++ /dev/null @@ -1,123 +0,0 @@ -package tracetracker - -import ( - "net" - - lru "github.com/hashicorp/golang-lru" - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/sfxclient" - "github.com/signalfx/golib/v3/trace" - "github.com/sirupsen/logrus" - - "github.com/signalfx/signalfx-agent/pkg/core/common/constants" - "github.com/signalfx/signalfx-agent/pkg/core/services" - "github.com/signalfx/signalfx-agent/pkg/monitors/types" -) - -// SpanSourceTracker inserts tags into spans that identify the source of the -// span using data that is available to the agent from the observers -// (specifically the dimensions on the observer output listed in -// DimsToSyncSource). It also attaches certain properties about the span local -// service name and the global cluster name to those dimensions. -type SpanSourceTracker struct { - dimChan chan<- *types.Dimension - hostTracker *services.EndpointHostTracker - clusterName string - dimHistory *lru.Cache -} - -const dimHistoryCacheSize = 1000 - -// DefaultDimsToAddToSpans are the default dimensions to add as span tags for correlated environments -var DefaultDimsToAddToSpans = map[string]string{ - "container_id": "container_id", - "kubernetes_pod_uid": "kubernetes_pod_uid", - "kubernetes_pod_name": "kubernetes_pod_name", - "kubernetes_namespace": "kubernetes_namespace", -} - -func NewSpanSourceTracker(hostTracker *services.EndpointHostTracker, dimChan chan<- *types.Dimension, clusterName string) *SpanSourceTracker { - dimHistory, _ := lru.New(dimHistoryCacheSize) - - return &SpanSourceTracker{ - clusterName: clusterName, - dimChan: dimChan, - hostTracker: hostTracker, - dimHistory: dimHistory, - } -} - -func (st *SpanSourceTracker) AddSourceTagsToSpan(span *trace.Span) { - sourceIP, ok := span.Meta[constants.DataSourceIPKey].(net.IP) - if !ok || sourceIP == nil { - return - } - - endpoints := st.hostTracker.GetByHost(sourceIP.String()) - found := 0 - for _, endpoint := range endpoints { - dims := endpoint.Dimensions() - for _, dim := range DefaultDimsToAddToSpans { - if val := dims[dim]; val != "" { - found++ - - if span.LocalEndpoint != nil && span.LocalEndpoint.ServiceName != nil { - st.emitDimensionPropIfNew(dim, val, *span.LocalEndpoint.ServiceName) - } - - if span.Tags == nil { - span.Tags = map[string]string{} - } - - tags := span.Tags - if _, ok := tags[dim]; ok { - // Don't overwrite existing span tags - continue - } - tags[dim] = val - } - } - // Short circuit it if we have added all the desired dimensions with - // this endpoint. - if found == len(DefaultDimsToAddToSpans) { - break - } - } - - if found == 0 { - logrus.Debugf("Could not find source of span %v with sourceIP %s", span, sourceIP) - } -} - -func (st *SpanSourceTracker) emitDimensionPropIfNew(dimName, dimValue, serviceName string) { - key := struct { - dimName string - dimValue string - serviceName string - }{ - dimName: dimName, - dimValue: dimValue, - serviceName: serviceName, - } - - _, ok := st.dimHistory.Get(key) - - if !ok { - st.dimChan <- &types.Dimension{ - Name: dimName, - Value: dimValue, - Properties: map[string]string{ - "service": serviceName, - "cluster": st.clusterName, - }, - MergeIntoExisting: true, - } - st.dimHistory.Add(key, true) - } -} - -func (st *SpanSourceTracker) InternalMetrics() []*datapoint.Datapoint { - return append([]*datapoint.Datapoint{ - sfxclient.Cumulative("sfxagent.span_source_tracker_size", nil, int64(st.dimHistory.Len())), - }, st.hostTracker.InternalMetrics()...) -} diff --git a/internal/signalfx-agent/pkg/core/writer/tracetracker/host_test.go b/internal/signalfx-agent/pkg/core/writer/tracetracker/host_test.go deleted file mode 100644 index 16b0bf9866..0000000000 --- a/internal/signalfx-agent/pkg/core/writer/tracetracker/host_test.go +++ /dev/null @@ -1,120 +0,0 @@ -package tracetracker - -import ( - "fmt" - "net" - "testing" - "time" - - "github.com/signalfx/golib/v3/pointer" - "github.com/signalfx/golib/v3/trace" - "github.com/signalfx/signalfx-agent/pkg/core/common/constants" - "github.com/signalfx/signalfx-agent/pkg/core/services" - "github.com/signalfx/signalfx-agent/pkg/monitors/types" - "github.com/stretchr/testify/require" -) - -const testClusterName = "test-cluster" - -func waitForDims(dimCh <-chan *types.Dimension, count, waitSeconds int) []types.Dimension { // nolint: unparam - var dims []types.Dimension - timeout := time.After(time.Duration(waitSeconds) * time.Second) - -loop: - for { - select { - case dim := <-dimCh: - dims = append(dims, *dim) - if len(dims) >= count { - break loop - } - case <-timeout: - break loop - } - } - - return dims -} - -func TestSourceTracker(t *testing.T) { - dimChan := make(chan *types.Dimension, 1000) - hostTracker := services.NewEndpointHostTracker() - tracker := NewSpanSourceTracker(hostTracker, dimChan, testClusterName) - - t.Run("does basic correlation", func(t *testing.T) { - const count = 100 - - var endpoints []services.Endpoint - for i := 0; i < count; i++ { - endpoint := services.NewEndpointCore(fmt.Sprintf("endpoint-%d", i), "test-endpoint", "nothing", map[string]string{ - "container_id": fmt.Sprintf("container-%d", i), - "kubernetes_pod_uid": fmt.Sprintf("pod-%d", i), - }) - endpoint.Core().Host = fmt.Sprintf("10.0.5.%d", i) - - hostTracker.EndpointAdded(endpoint) - - endpoints = append(endpoints, endpoint) - } - - var spans []*trace.Span - for i := 0; i < count; i++ { - span := &trace.Span{ - Name: pointer.String(fmt.Sprintf("span-%d", i)), - LocalEndpoint: &trace.Endpoint{ - ServiceName: pointer.String(fmt.Sprintf("service-%d", i%5)), - }, - Meta: map[interface{}]interface{}{ - constants.DataSourceIPKey: net.ParseIP(fmt.Sprintf("10.0.5.%d", i)), - }, - } - spans = append(spans, span) - - tracker.AddSourceTagsToSpan(span) - - require.Equal(t, span.Tags, map[string]string{ - "container_id": fmt.Sprintf("container-%d", i), - "kubernetes_pod_uid": fmt.Sprintf("pod-%d", i), - }) - - dims := waitForDims(dimChan, 2, 3) - require.ElementsMatch(t, []types.Dimension{ - { - Name: "container_id", - Value: fmt.Sprintf("container-%d", i), - Properties: map[string]string{ - "service": fmt.Sprintf("service-%d", i%5), - "cluster": testClusterName, - }, - Tags: nil, - MergeIntoExisting: true, - }, - { - Name: "kubernetes_pod_uid", - Value: fmt.Sprintf("pod-%d", i), - Properties: map[string]string{ - "service": fmt.Sprintf("service-%d", i%5), - "cluster": testClusterName, - }, - Tags: nil, - MergeIntoExisting: true, - }, - }, dims) - } - - // Remove the endpoints from the host tracker and make sure they aren't - // tracked any more. - for i := 0; i < count; i++ { - hostTracker.EndpointRemoved(endpoints[i]) - - spans[i].Tags = nil - - tracker.AddSourceTagsToSpan(spans[i]) - - require.Equal(t, spans[i].Tags, map[string]string(nil)) - } - - dims := waitForDims(dimChan, 1, 3) - require.Len(t, dims, 0) - }) -} diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index e5b03724ed..c7dbbd0dba 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -47,7 +47,6 @@ require ( github.com/Microsoft/go-winio v0.6.1 // indirect github.com/SAP/go-hdb v1.3.10 // indirect github.com/Sectorbob/mlab-ns2 v0.0.0-20171030222938-d3aa0c295a8a // indirect - github.com/Showmax/go-fqdn v1.0.0 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/andybalholm/brotli v1.0.4 // indirect @@ -77,7 +76,6 @@ require ( github.com/cloudfoundry-incubator/uaago v0.0.0-20190307164349-8136b7bbe76e // indirect github.com/containerd/containerd v1.7.3 // indirect github.com/coreos/go-semver v0.3.0 // indirect - github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -195,7 +193,6 @@ require ( github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mattn/go-xmlrpc v0.0.3 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mauricelam/genny v0.0.0-20190320071652-0800202903e5 // indirect github.com/miekg/dns v1.1.50 // indirect github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect @@ -247,7 +244,6 @@ require ( github.com/signalfx/ingest-protocols v0.2.0 // indirect github.com/signalfx/sapm-proto v0.12.0 // indirect github.com/signalfx/signalfx-agent/pkg/apm v0.0.0-20230104182534-9eee411fe305 // indirect - github.com/signalfx/signalfx-go v1.33.0 // indirect github.com/snowflakedb/gosnowflake v1.6.24 // indirect github.com/soniah/gosnmp v0.0.0-20190220004421-68e8beac0db9 // indirect github.com/spf13/pflag v1.0.5 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index 5c4ae90486..52b6370ec1 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -118,8 +118,6 @@ github.com/SAP/go-hdb v1.3.10 h1:il31JhpW9zT8/aiZLpAY6rKDVrLHxIhEwXyzx7ZgrDM= github.com/SAP/go-hdb v1.3.10/go.mod h1:XoKPtjnxUY8AIOcy0p6DjkucX1ojdPtOQRLtju7gMc8= github.com/Sectorbob/mlab-ns2 v0.0.0-20171030222938-d3aa0c295a8a h1:KFHLI4QGttB0i7M3qOkAo8Zn/GSsxwwCnInFqBaYtkM= github.com/Sectorbob/mlab-ns2 v0.0.0-20171030222938-d3aa0c295a8a/go.mod h1:D73UAuEPckrDorYZdtlCu2ySOLuPB5W4rhIkmmc/XbI= -github.com/Showmax/go-fqdn v1.0.0 h1:0rG5IbmVliNT5O19Mfuvna9LL7zlHyRfsSvBPZmF9tM= -github.com/Showmax/go-fqdn v1.0.0/go.mod h1:SfrFBzmDCtCGrnHhoDjuvFnKsWjEQX/Q9ARZvOrJAko= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -259,8 +257,6 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= -github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= @@ -817,8 +813,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mauricelam/genny v0.0.0-20190320071652-0800202903e5 h1:PnFl95tWh3j7c5DebZG/TGsBJvbnHvPjK4lzltouI4Y= -github.com/mauricelam/genny v0.0.0-20190320071652-0800202903e5/go.mod h1:i2AazGGunAlAR5u0zXGYVmIT7nnwE6j9lwKSMx7N6ko= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= @@ -1063,8 +1057,6 @@ github.com/signalfx/ingest-protocols v0.2.0 h1:axbmVg8eLoBh3wNmwBG9O/2jMjfzCVP7M github.com/signalfx/ingest-protocols v0.2.0/go.mod h1:CYKWPtxFWF9RCUGfN0Hh6javdTTqediTCbXFbW0BF60= github.com/signalfx/sapm-proto v0.12.0 h1:OtOe+Jm8L61Ml8K6X8a89zc8/RlaaMRElCImeGKR/Ew= github.com/signalfx/sapm-proto v0.12.0/go.mod h1:wQEki8RNCYjkv19jw5aWDcmDMTQru0ckfUbgHI69U2E= -github.com/signalfx/signalfx-go v1.33.0 h1:+v1fa+is8rYSxGoN1W+9PiDj1dCF5sVjJx60dhNLsTA= -github.com/signalfx/signalfx-go v1.33.0/go.mod h1:IpGZLPvCKNFyspAXoS480jB02mocTpo0KYd8jbl6/T8= github.com/signalfx/telegraf v0.10.2-0.20210820123244-82265917ca87 h1:ayeUHxiUjcxzuEzjWVkXJxf42UYNw8UKmYmIQu9mAqo= github.com/signalfx/telegraf v0.10.2-0.20210820123244-82265917ca87/go.mod h1:1gnMOcwGO3lAxfoMq28M8gjooF2MqVwquPVEvgZ1its= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -1460,7 +1452,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190319232107-3f1ed9edd1b4/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= From 894d7ef2564c709c92fb94e4a71ced970020d475 Mon Sep 17 00:00:00 2001 From: Samiur Arif Date: Fri, 22 Sep 2023 14:30:14 -0700 Subject: [PATCH 30/55] removed more dead code. (#3685) --- internal/signalfx-agent/go.mod | 4 +- internal/signalfx-agent/go.sum | 4 - .../signalfx-agent/pkg/core/hostid/aws.go | 48 ----------- .../signalfx-agent/pkg/core/hostid/azure.go | 77 ------------------ .../signalfx-agent/pkg/core/hostid/dims.go | 80 ------------------- .../signalfx-agent/pkg/core/hostid/doc.go | 5 -- .../signalfx-agent/pkg/core/hostid/gcp.go | 61 -------------- .../signalfx-agent/pkg/core/hostid/host.go | 32 -------- .../signalfx-agent/pkg/core/hostid/k8s.go | 56 ------------- .../pkg/core/hostid/machineid.go | 16 ---- 10 files changed, 1 insertion(+), 382 deletions(-) delete mode 100644 internal/signalfx-agent/pkg/core/hostid/aws.go delete mode 100644 internal/signalfx-agent/pkg/core/hostid/azure.go delete mode 100644 internal/signalfx-agent/pkg/core/hostid/dims.go delete mode 100644 internal/signalfx-agent/pkg/core/hostid/doc.go delete mode 100644 internal/signalfx-agent/pkg/core/hostid/gcp.go delete mode 100644 internal/signalfx-agent/pkg/core/hostid/host.go delete mode 100644 internal/signalfx-agent/pkg/core/hostid/k8s.go delete mode 100644 internal/signalfx-agent/pkg/core/hostid/machineid.go diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index 525836e774..867807728c 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -30,12 +30,10 @@ require ( github.com/Microsoft/go-winio v0.6.1 // indirect github.com/SAP/go-hdb v1.3.10 github.com/Sectorbob/mlab-ns2 v0.0.0-20171030222938-d3aa0c295a8a - github.com/Showmax/go-fqdn v1.0.0 github.com/antonmedv/expr v1.15.2 - github.com/aws/aws-sdk-go v1.45.11 + github.com/aws/aws-sdk-go v1.45.11 // indirect github.com/beevik/ntp v1.3.0 github.com/cloudfoundry-incubator/uaago v0.0.0-20190307164349-8136b7bbe76e - github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/denisenkom/go-mssqldb v0.12.3 github.com/docker/docker v24.0.6+incompatible diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index b1fb13d325..05c7256922 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -116,8 +116,6 @@ github.com/Sectorbob/mlab-ns2 v0.0.0-20171030222938-d3aa0c295a8a h1:KFHLI4QGttB0 github.com/Sectorbob/mlab-ns2 v0.0.0-20171030222938-d3aa0c295a8a/go.mod h1:D73UAuEPckrDorYZdtlCu2ySOLuPB5W4rhIkmmc/XbI= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/Showmax/go-fqdn v1.0.0 h1:0rG5IbmVliNT5O19Mfuvna9LL7zlHyRfsSvBPZmF9tM= -github.com/Showmax/go-fqdn v1.0.0/go.mod h1:SfrFBzmDCtCGrnHhoDjuvFnKsWjEQX/Q9ARZvOrJAko= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= @@ -257,8 +255,6 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= -github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= diff --git a/internal/signalfx-agent/pkg/core/hostid/aws.go b/internal/signalfx-agent/pkg/core/hostid/aws.go deleted file mode 100644 index 6ed8c6ae74..0000000000 --- a/internal/signalfx-agent/pkg/core/hostid/aws.go +++ /dev/null @@ -1,48 +0,0 @@ -package hostid - -import ( - "fmt" - "net/http" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/session" - log "github.com/sirupsen/logrus" - - "github.com/signalfx/signalfx-agent/pkg/utils/timeutil" -) - -// AWSUniqueID constructs the unique EC2 instance of the underlying host. If -// not running on EC2, returns the empty string. -func AWSUniqueID(cloudMetadataTimeout timeutil.Duration) string { - // Pass in the HTTP client so cloudMetadataTimeout from the config - // is respected. - c := &http.Client{ - Timeout: cloudMetadataTimeout.AsDuration(), - } - - sess, err := session.NewSession(aws.NewConfig().WithHTTPClient(c)) - if err != nil { - log.WithFields(log.Fields{ - "detail": err, - }).Info("Failed to create new session for AWS metadata collection") - return "" - } - - client := ec2metadata.New(sess) - - doc, err := client.GetInstanceIdentityDocument() - if err != nil { - log.WithFields(log.Fields{ - "detail": err, - }).Info("No AWS metadata server detected, assuming not on EC2") - return "" - } - - if doc.AccountID == "" || doc.InstanceID == "" || doc.Region == "" { - log.Errorf("One (or more) required field is empty. AccountID: %s ; InstanceID: %s ; Region: %s", doc.AccountID, doc.InstanceID, doc.Region) - return "" - } - - return fmt.Sprintf("%s_%s_%s", doc.InstanceID, doc.Region, doc.AccountID) -} diff --git a/internal/signalfx-agent/pkg/core/hostid/azure.go b/internal/signalfx-agent/pkg/core/hostid/azure.go deleted file mode 100644 index 284b0bbdcf..0000000000 --- a/internal/signalfx-agent/pkg/core/hostid/azure.go +++ /dev/null @@ -1,77 +0,0 @@ -package hostid - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "strings" - - "github.com/signalfx/signalfx-agent/pkg/utils/timeutil" - log "github.com/sirupsen/logrus" -) - -// AzureUniqueID constructs the unique ID of the underlying Azure VM. If -// not running on Azure VM, returns the empty string. -// Details about Azure Instance Metadata ednpoint: -// https://docs.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service -func AzureUniqueID(cloudMetadataTimeout timeutil.Duration) string { - c := http.Client{ - Timeout: cloudMetadataTimeout.AsDuration(), - } - req, err := http.NewRequest("GET", "http://169.254.169.254/metadata/instance?api-version=2018-10-01", nil) - if err != nil { - return "" - } - - req.Header.Set("Metadata", "true") - resp, err := c.Do(req) - if err != nil { - log.WithFields(log.Fields{ - "detail": err, - }).Infof("No Azure metadata server detected, assuming not on Azure") - return "" - } - defer resp.Body.Close() - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return "" - } - - type Info struct { - SubscriptionID string `json:"subscriptionId"` - ResourceGroupName string `json:"resourceGroupName"` - Name string `json:"name"` - VMScaleSetName string `json:"vmScaleSetName"` - } - - var compute struct { - Doc Info `json:"compute"` - } - - err = json.Unmarshal(body, &compute) - if err != nil { - return "" - } - - if compute.Doc.SubscriptionID == "" || compute.Doc.ResourceGroupName == "" || compute.Doc.Name == "" { - return "" - } - - if compute.Doc.VMScaleSetName == "" { - return strings.ToLower(fmt.Sprintf("%s/%s/microsoft.compute/virtualmachines/%s", compute.Doc.SubscriptionID, compute.Doc.ResourceGroupName, compute.Doc.Name)) - } - - instanceID := strings.TrimPrefix(compute.Doc.Name, compute.Doc.VMScaleSetName+"_") - - // names of VM's in VMScalesets seem to follow the of `_` - // where scale-set-name is alphanumeric (and is the same as compute.vmScaleSetName - // field from the metadata endpoint) - if instanceID == "" { - return "" - } - - return strings.ToLower(fmt.Sprintf("%s/%s/microsoft.compute/virtualmachinescalesets/%s/virtualmachines/%s", compute.Doc.SubscriptionID, compute.Doc.ResourceGroupName, compute.Doc.VMScaleSetName, instanceID)) - -} diff --git a/internal/signalfx-agent/pkg/core/hostid/dims.go b/internal/signalfx-agent/pkg/core/hostid/dims.go deleted file mode 100644 index 7e91926a8f..0000000000 --- a/internal/signalfx-agent/pkg/core/hostid/dims.go +++ /dev/null @@ -1,80 +0,0 @@ -package hostid - -import ( - "os" - "sync" - - "github.com/signalfx/signalfx-agent/pkg/core/config" - log "github.com/sirupsen/logrus" -) - -// Dimensions returns a map of host-specific dimensions that are derived from -// the environment. -func Dimensions(conf *config.Config) map[string]string { - log.Info("Fetching host id dimensions") - - var g dimGatherer - - g.GatherDim("host", func() string { - if conf.Hostname != "" { - return conf.Hostname - } - // Using the FQDN needs to default to true but the defaults lib that we - // use can't distinguish between false and unspecified, so figure out - // if the user specified it explicitly as false with this logic. - return getHostname(conf.UseFullyQualifiedHost == nil || *conf.UseFullyQualifiedHost) - }) - - // The envvar exists primarily for testing but could be useful otherwise. - // It remains undocumented for the time being though. - if os.Getenv("SKIP_PLATFORM_HOST_DIMS") != "yes" { - g.GatherDim("AWSUniqueId", func() string { - return AWSUniqueID(conf.CloudMetadataTimeout) - }) - g.GatherDim("gcp_id", func() string { - return GoogleComputeID(conf.CloudMetadataTimeout) - }) - g.GatherDim("kubernetes_node_uid", func() string { - return KubernetesNodeUID(conf.Monitors) - }) - g.GatherDim("azure_resource_id", func() string { - return AzureUniqueID(conf.CloudMetadataTimeout) - }) - } - - dims := g.WaitForDimensions() - - return dims -} - -// Helper to fire off the dim lookups in parallel to minimize delay to agent -// start up. -type dimGatherer struct { - lock sync.Mutex - dims map[string]string - wg sync.WaitGroup -} - -// GatherDim inserts the given dim key based on the output of the provider -// func. If the output is blank, the dimension will not be inserted. -func (dg *dimGatherer) GatherDim(key string, provider func() string) { - dg.wg.Add(1) - go func() { - res := provider() - if res != "" { - dg.lock.Lock() - if dg.dims == nil { - dg.dims = make(map[string]string) - } - - dg.dims[key] = res - dg.lock.Unlock() - } - dg.wg.Done() - }() -} - -func (dg *dimGatherer) WaitForDimensions() map[string]string { - dg.wg.Wait() - return dg.dims -} diff --git a/internal/signalfx-agent/pkg/core/hostid/doc.go b/internal/signalfx-agent/pkg/core/hostid/doc.go deleted file mode 100644 index 55b88bb0de..0000000000 --- a/internal/signalfx-agent/pkg/core/hostid/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Package hostid contains methods that can be called upon agent start up to -// determine host-specific values that uniquely identify a particular host, -// particularly ids that can be used to correlate metrics coming from this host -// to other metrics generated elsewhere, such as AWS CloudWatch metrics. -package hostid diff --git a/internal/signalfx-agent/pkg/core/hostid/gcp.go b/internal/signalfx-agent/pkg/core/hostid/gcp.go deleted file mode 100644 index 05b00c4620..0000000000 --- a/internal/signalfx-agent/pkg/core/hostid/gcp.go +++ /dev/null @@ -1,61 +0,0 @@ -package hostid - -import ( - "fmt" - "io/ioutil" - "net/http" - - "github.com/signalfx/signalfx-agent/pkg/utils/timeutil" - log "github.com/sirupsen/logrus" -) - -// GoogleComputeID generates a unique id for the compute instance that the -// agent is running on. It returns a blank string if we are not running on GCP -// or there was an error getting the metadata. -func GoogleComputeID(cloudMetadataTimeout timeutil.Duration) string { - projectID := getMetadata("project/project-id", cloudMetadataTimeout) - if projectID == "" { - return "" - } - instanceID := getMetadata("instance/id", cloudMetadataTimeout) - if instanceID == "" { - return "" - } - - return fmt.Sprintf("%s_%s", projectID, instanceID) -} - -func getMetadata(path string, cloudMetadataTimeout timeutil.Duration) string { - url := fmt.Sprintf("http://metadata.google.internal/computeMetadata/v1/%s", path) - req, err := http.NewRequest("GET", url, nil) - if err != nil { - // This would only be due to a programming bug - panic("Could not construct request for GCP ID") - } - - req.Header.Add("Metadata-Flavor", "Google") - - c := http.Client{ - Timeout: cloudMetadataTimeout.AsDuration(), - } - - resp, err := c.Do(req) - if err != nil { - log.WithFields(log.Fields{ - "detail": err, - }).Infof("No GCP metadata server detected at %s , assuming not on GCP", url) - return "" - } - defer resp.Body.Close() - - if resp.Header.Get("Metadata-Flavor") != "Google" { - return "" - } - - data, err := ioutil.ReadAll(resp.Body) - if err != nil { - return "" - } - - return string(data) -} diff --git a/internal/signalfx-agent/pkg/core/hostid/host.go b/internal/signalfx-agent/pkg/core/hostid/host.go deleted file mode 100644 index e1d2d4022d..0000000000 --- a/internal/signalfx-agent/pkg/core/hostid/host.go +++ /dev/null @@ -1,32 +0,0 @@ -package hostid - -import ( - "os" - - fqdn "github.com/Showmax/go-fqdn" - log "github.com/sirupsen/logrus" -) - -func getHostname(useFullyQualifiedHost bool) string { - var host string - if useFullyQualifiedHost { - log.Info("Trying to get fully qualified hostname") - host = fqdn.Get() - if host == "unknown" || host == "localhost" { - log.Info("Error getting fully qualified hostname, using plain hostname") - host = "" - } - } - - if host == "" { - var err error - host, err = os.Hostname() - if err != nil { - log.Error("Error getting system simple hostname, cannot set hostname") - return "" - } - } - - log.Infof("Using hostname %s", host) - return host -} diff --git a/internal/signalfx-agent/pkg/core/hostid/k8s.go b/internal/signalfx-agent/pkg/core/hostid/k8s.go deleted file mode 100644 index d3bd3689a7..0000000000 --- a/internal/signalfx-agent/pkg/core/hostid/k8s.go +++ /dev/null @@ -1,56 +0,0 @@ -package hostid - -import ( - "context" - "os" - - "github.com/signalfx/signalfx-agent/pkg/core/common/kubernetes" - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/monitors/kubernetes/cluster" - "github.com/sirupsen/logrus" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// KubernetesNodeUID returns the UID of the current K8s node, if running -// on K8s and if the appropriate envvar (MY_NODE_NAME) has been injected in the -// agent pod by the downward API mechanism. This requires being able to do a -// request to the K8s API server to get the UID from the node name, since UID -// is not available locally to the agent. -func KubernetesNodeUID(monitorConf []config.MonitorConfig) string { - nodeName := os.Getenv("MY_NODE_NAME") - if nodeName == "" || os.Getenv("SKIP_KUBERNETES_NODE_UID_DIM") != "" { - return "" - } - - var clusterConf cluster.Config - - // Try and extract K8s API config from the `kubernetes-cluster` monitor if - // available. Otherwise use the standard service account method. - for i := range monitorConf { - conf := monitorConf[i] - if conf.Type != "kubernetes-cluster" { - continue - } - - err := config.DecodeExtraConfig(&conf, &clusterConf, false) - if err != nil { - logrus.Errorf("Could not decode Kubernetes API config from kubernetes-cluster monitor: %s", err) - } - break - } - - // This will use default in cluster config if clusterConf.KubernetesAPI is - // nil. - client, err := kubernetes.MakeClient(clusterConf.KubernetesAPI) - if err != nil { - logrus.Errorf("Could not create Kubernetes client to get node UID: %s", err) - os.Exit(10) - } - node, err := client.CoreV1().Nodes().Get(context.Background(), nodeName, metav1.GetOptions{}) - if err != nil { - logrus.Errorf("Could not fetch node with name %s from K8s API: %v", nodeName, err) - os.Exit(11) - } - - return string(node.UID) -} diff --git a/internal/signalfx-agent/pkg/core/hostid/machineid.go b/internal/signalfx-agent/pkg/core/hostid/machineid.go deleted file mode 100644 index 658e65abb4..0000000000 --- a/internal/signalfx-agent/pkg/core/hostid/machineid.go +++ /dev/null @@ -1,16 +0,0 @@ -package hostid - -import ( - systemdutil "github.com/coreos/go-systemd/util" -) - -// MachineID returns the Linux machine-id, which is present on most newer Linux -// distros. It is more useful than hostname as a unique identifier. See -// http://man7.org/linux/man-pages/man5/machine-id.5.html -func MachineID() string { - mid, err := systemdutil.GetMachineID() - if err != nil { - return "" - } - return mid -} From f221e216e156aaf00d42b9ce2c251f66dcb07707 Mon Sep 17 00:00:00 2001 From: Samiur Arif Date: Fri, 22 Sep 2023 17:21:51 -0700 Subject: [PATCH 31/55] removed more dead code. (#3686) --- .../signalfx-agent/pkg/core/config/loader.go | 150 ------ .../pkg/core/config/loader_test.go | 505 ------------------ internal/signalfx-agent/pkg/utils/events.go | 9 - internal/signalfx-agent/pkg/utils/log.go | 40 -- pkg/extension/smartagentextension/go.sum | 4 - 5 files changed, 708 deletions(-) delete mode 100644 internal/signalfx-agent/pkg/core/config/loader.go delete mode 100644 internal/signalfx-agent/pkg/core/config/loader_test.go delete mode 100644 internal/signalfx-agent/pkg/utils/events.go diff --git a/internal/signalfx-agent/pkg/core/config/loader.go b/internal/signalfx-agent/pkg/core/config/loader.go deleted file mode 100644 index c8e0760f9d..0000000000 --- a/internal/signalfx-agent/pkg/core/config/loader.go +++ /dev/null @@ -1,150 +0,0 @@ -package config - -import ( - "context" - "fmt" - "os" - "regexp" - "time" - - yaml "gopkg.in/yaml.v2" - - "github.com/signalfx/defaults" - "github.com/signalfx/signalfx-agent/pkg/core/config/sources" - "github.com/signalfx/signalfx-agent/pkg/utils" - "github.com/signalfx/signalfx-agent/pkg/utils/structtags" - log "github.com/sirupsen/logrus" -) - -// LoadConfig handles loading the main config file and recursively rendering -// any dynamic values in the config. If watchInterval is 0, the config will be -// loaded once and sent to the returned channel, after which the channel will -// be closed. Otherwise, the returned channel will remain open and will be -// sent any config updates. -func LoadConfig(ctx context.Context, configPath string) (<-chan *Config, error) { - configYAML, configFileChanges, err := sources.ReadConfig(configPath, ctx.Done()) - if err != nil { - return nil, fmt.Errorf("could not read config file %s: %w", configPath, err) - } - - dynamicProvider := sources.DynamicValueProvider{} - - dynamicValueCtx, cancelDynamic := context.WithCancel(ctx) - finalYAML, dynamicChanges, err := dynamicProvider.ReadDynamicValues(configYAML, dynamicValueCtx.Done()) - if err != nil { - cancelDynamic() - return nil, err - } - - config, err := loadYAML(finalYAML) - if err != nil { - cancelDynamic() - return nil, err - } - - // Give it enough room to hold the initial config load. - loads := make(chan *Config, 1) - - loads <- config - - if configFileChanges != nil || dynamicChanges != nil { - go func() { - for { - // We can have changes either in the dynamic values or the - // config file itself. If the config file changes, we have to - // recreate the dynamic value watcher since it is configured - // from the config file. - select { - case configYAML = <-configFileChanges: - cancelDynamic() - - dynamicValueCtx, cancelDynamic = context.WithCancel(ctx) - - finalYAML, dynamicChanges, err = dynamicProvider.ReadDynamicValues(configYAML, dynamicValueCtx.Done()) - if err != nil { - log.WithError(err).Error("Could not read dynamic values in config after change") - time.Sleep(5 * time.Second) - continue - } - - config, err := loadYAML(finalYAML) - if err != nil { - log.WithError(err).Error("Could not parse config after change") - continue - } - - loads <- config - case finalYAML = <-dynamicChanges: - config, err := loadYAML(finalYAML) - if err != nil { - log.WithError(err).Error("Could not parse config after change") - continue - } - loads <- config - case <-ctx.Done(): - cancelDynamic() - return - } - } - }() - } else { - cancelDynamic() - } - return loads, nil -} - -func loadYAML(fileContent []byte) (*Config, error) { - config := &Config{} - - preprocessedContent := preprocessConfig(fileContent) - - err := yaml.UnmarshalStrict(preprocessedContent, config) - if err != nil { - return nil, utils.YAMLErrorWithContext(preprocessedContent, err) - } - - if err := defaults.Set(config); err != nil { - panic(fmt.Sprintf("Config defaults are wrong types: %s", err)) - } - - if err := structtags.CopyTo(config); err != nil { - panic(fmt.Sprintf("Error copying configs to fields: %v", err)) - } - - return config.initialize() -} - -var envVarRE = regexp.MustCompile(`\${\s*([\w-]+?)\s*}`) - -// Hold all of the envvars so that when they are sanitized from the proc we can -// still get to them when we need to rerender config -var envVarCache = make(map[string]string) - -var envVarWhitelist = map[string]bool{ - "MY_NODE_NAME": true, -} - -// Replaces envvar syntax with the actual envvars -func preprocessConfig(content []byte) []byte { - return envVarRE.ReplaceAllFunc(content, func(bs []byte) []byte { - parts := envVarRE.FindSubmatch(bs) - envvar := string(parts[1]) - - val, ok := envVarCache[envvar] - - if !ok { - val = os.Getenv(envvar) - envVarCache[envvar] = val - - log.WithFields(log.Fields{ - "envvar": envvar, - }).Debug("Sanitizing envvar from agent") - - if !envVarWhitelist[envvar] { - os.Unsetenv(envvar) - } - } - - return []byte(val) - }) -} diff --git a/internal/signalfx-agent/pkg/core/config/loader_test.go b/internal/signalfx-agent/pkg/core/config/loader_test.go deleted file mode 100644 index b5e534cab8..0000000000 --- a/internal/signalfx-agent/pkg/core/config/loader_test.go +++ /dev/null @@ -1,505 +0,0 @@ -package config - -import ( - "context" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -var _ = Describe("Config Loader", func() { - var dir string - var ctx context.Context - var cancel func() - - mkFile := func(path string, content string) string { - fullPath := filepath.Join(dir, path) - - err := os.MkdirAll(filepath.Dir(fullPath), 0755) - Expect(err).ShouldNot(HaveOccurred()) - - err = ioutil.WriteFile(fullPath, []byte(content), 0644) - Expect(err).ShouldNot(HaveOccurred()) - - return fullPath - } - - outdent := utils.StripIndent - - BeforeEach(func() { - var err error - dir, err = ioutil.TempDir("", "loader-test") - Expect(err).ShouldNot(HaveOccurred()) - - ctx, cancel = context.WithCancel(context.Background()) - }) - - AfterEach(func() { - if dir != "" { - os.RemoveAll(dir) - } - cancel() - }) - - It("Loads a basic config file", func() { - path := mkFile("agent/agent.yaml", `signalFxAccessToken: abcd`) - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(config.SignalFxAccessToken).To(Equal("abcd")) - }) - - It("Does basic validation checks on a config file", func() { - path := mkFile("agent/agent.yaml", outdent(` - signalFxAccessToken: abcd - monitors: {} - `)) - _, err := LoadConfig(ctx, path) - Expect(err).To(HaveOccurred()) - }) - - It("Errors on missing source path", func() { - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: {"#from": '%s/does-not-exist'} - `, dir))) - - _, err := LoadConfig(ctx, path) - Expect(err).To(HaveOccurred()) - }) - - It("Fills in dynamic values", func() { - tokenPath := mkFile("agent/token", "abcd") - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: {"#from": '%s'} - `, tokenPath))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(config.SignalFxAccessToken).To(Equal("abcd")) - }) - - It("Will merge seq into single seq", func() { - mkFile("agent/conf/mon1.yaml", outdent(` - - a - - b - `)) - - mkFile("agent/conf/mon2.yaml", outdent(` - - c - `)) - - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: abcd - monitors: - - type: collectd/mysql - databases: {"#from": '%s/agent/conf/*.yaml'} - `, dir))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(config.Monitors[0].OtherConfig["databases"]).Should(ConsistOf("a", "b", "c")) - }) - - It("Will error if merging maps and seqs", func() { - mkFile("agent/conf/mon1.yaml", outdent(` - - a - - b - `)) - - mkFile("agent/conf/mon2.yaml", outdent(` - env: dev - `)) - - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: abcd - monitors: - - type: collectd/mysql - databases: {"#from": '%s/agent/conf/*.yaml'} - `, dir))) - - _, err := LoadConfig(ctx, path) - Expect(err).To(HaveOccurred()) - }) - - It("Will render seq into seq", func() { - mkFile("agent/conf/databases.yaml", outdent(` - [a, b, c] - `)) - - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: abcd - monitors: - - type: collectd/mysql - databases: {"#from": '%s/agent/conf/databases.yaml'} - `, dir))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(config.Monitors[0].OtherConfig["databases"]).Should(ConsistOf("a", "b", "c")) - }) - - It("Flattens seqs into seq", func() { - mkFile("agent/conf/mon1.yaml", outdent(` - - type: collectd/cpu - intervalSeconds: 5 - - type: collectd/vmem - `)) - - mkFile("agent/conf/mon2.yaml", outdent(` - - type: collectd/mysql - host: 127.0.0.1 - `)) - - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: abcd - monitors: - - type: fake - - {"#from": '%s/agent/conf/*.yaml', flatten: true} - `, dir))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(len(config.Monitors)).To(Equal(4)) - }) - - It("Will not flatten seqs into map", func() { - mkFile("agent/conf/mon1.yaml", outdent(` - - type: collectd/cpu - intervalSeconds: 5 - - type: collectd/vmem - `)) - - mkFile("agent/conf/mon2.yaml", outdent(` - - type: collectd/mysql - host: 127.0.0.1 - `)) - - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: abcd - monitors: - - type: collectd/mysql - _: {"#from": '%s/agent/conf/*.yaml', flatten: true} - `, dir))) - - _, err := LoadConfig(ctx, path) - Expect(err).To(HaveOccurred()) - }) - - It("Flattens dynamic map into map", func() { - mkFile("agent/conf/mon1.yaml", outdent(` - port: 80 - `)) - - mkFile("agent/conf/mon2.yaml", outdent(` - host: 127.0.0.1 - `)) - - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: abcd - monitors: - - type: collectd/mysql - _: {"#from": '%s/agent/conf/*.yaml', flatten: true} - `, dir))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(len(config.Monitors)).To(Equal(1)) - Expect(config.Monitors[0].OtherConfig["port"]).To(Equal(80)) - }) - - It("Will flatten dynamic map from key that start's with _", func() { - mkFile("agent/conf/mon1.yaml", outdent(` - port: 80 - name: test - `)) - - mkFile("agent/conf/mon2.yaml", outdent(` - host: 127.0.0.1 - `)) - - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: abcd - monitors: - - type: collectd/mysql - _: {"#from": '%s/agent/conf/*.yaml', flatten: true} - `, dir))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(config.Monitors[0].OtherConfig["name"]).To(Equal("test")) - Expect(config.Monitors[0].OtherConfig["port"]).To(Equal(80)) - Expect(config.Monitors[0].OtherConfig["host"]).To(Equal("127.0.0.1")) - }) - - It("Will not flatten dynamic map from key that doesn't start with _", func() { - mkFile("agent/conf/mon1.yaml", outdent(` - port: 80 - name: test - `)) - - mkFile("agent/conf/mon2.yaml", outdent(` - host: 127.0.0.1 - `)) - - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: abcd - monitors: - - type: collectd/mysql - password: {"#from": '%s/agent/conf/*.yaml', flatten: true} - `, dir))) - - _, err := LoadConfig(ctx, path) - Expect(err).To(HaveOccurred()) - }) - - It("Watches dynamic value source for changes", func() { - tokenPath := mkFile("agent/token", "abcd") - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: {"#from": '%s'} - configSources: - file: - pollRateSeconds: 1 - `, tokenPath))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - mkFile("agent/token", "1234") - Eventually(loads, 3).Should(Receive(&config)) - - Expect(config.SignalFxAccessToken).To(Equal("1234")) - }) - - It("Recursively watches dynamic value source for changes", func() { - passwordPath := mkFile("agent/password", "s3cr3t") - - monitorPath := mkFile("agent/token", outdent(fmt.Sprintf(` - type: my-monitor - password: {"#from": '%s'} - `, passwordPath))) - - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: "abcd" - configSources: - file: - pollRateSeconds: 1 - monitors: - - {"#from": '%s'} - `, monitorPath))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(config.Monitors[0].OtherConfig["password"]).To(Equal("s3cr3t")) - - mkFile("agent/password", "sup3rs3cr3t") - Eventually(loads, 2).Should(Receive(&config)) - - Expect(config.Monitors[0].OtherConfig["password"]).To(Equal("sup3rs3cr3t")) - }) - - It("Recursively watches three levels deep for changes", func() { - envPath := mkFile("agent/env", "dev") - - dimPath := mkFile("agent/dim", outdent(fmt.Sprintf(` - author: bob - env: {"#from": '%s'} - `, envPath))) - - monitorPath := mkFile("agent/monitors", outdent(fmt.Sprintf(` - type: my-monitor - extraDimensions: {"#from": '%s'} - `, dimPath))) - - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: "abcd" - configSources: - file: - pollRateSeconds: 1 - monitors: - - {"#from": '%s'} - `, monitorPath))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(config.Monitors[0].ExtraDimensions["env"]).To(Equal("dev")) - - mkFile("agent/env", "prod") - Eventually(loads, 2).Should(Receive(&config)) - - Expect(config.Monitors[0].ExtraDimensions["env"]).To(Equal("prod")) - }) - - It("Handles dynamic value reference loops without blowing out stack", func() { - configPath := mkFile("agent/agent.yaml", "") - - dimPath := mkFile("agent/dims", outdent(fmt.Sprintf(` - env: {"#from": "%s"} - `, configPath))) - - monitorPath := mkFile("agent/monitors", outdent(fmt.Sprintf(` - type: my-monitor - extraDimensions: {"#from": "%s"} - `, dimPath))) - - mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: "abcd" - configSources: - file: - pollRateSeconds: 1 - monitors: - - {"#from": "%s", flatten: true} - `, monitorPath))) - - _, err := LoadConfig(ctx, configPath) - Expect(err).To(HaveOccurred()) - }) - - It("Allows multiple references to the same source path", func() { - tokenPath := mkFile("agent/token", "abcd") - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: {"#from": '%s'} - configSources: - file: - pollRateSeconds: 1 - monitors: - - type: my-monitor - password: {"#from": '%s'} - other: {"#from": '%s'} - `, tokenPath, tokenPath, tokenPath))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - mkFile("agent/token", "1234") - Eventually(loads, 2).Should(Receive(&config)) - - Expect(config.SignalFxAccessToken).To(Equal("1234")) - Expect(config.Monitors[0].OtherConfig["password"]).To(Equal(1234)) - }) - - It("Allows optional values", func() { - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: abcd - monitors: - - type: collectd/mysql - password: {"#from": '%s/agent/mysql-password.yaml', optional: true} - `, dir))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(config.Monitors[0].OtherConfig["password"]).To(BeNil()) - }) - - It("Allows default values", func() { - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: abcd - monitors: - - type: collectd/mysql - password: {"#from": '%s/agent/mysql-password.yaml', default: "s3cr3t"} - `, dir))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(config.Monitors[0].OtherConfig["password"]).To(Equal("s3cr3t")) - }) - - It("Will render raw seq into seq position", func() { - mkFile("agent/conf/config.yaml", outdent(` - LoadPlugin "cpufreq" - `)) - - path := mkFile("agent/agent.yaml", outdent(fmt.Sprintf(` - signalFxAccessToken: abcd - monitors: - - type: collectd/my-monitor - templates: - - {"#from": '%s/agent/conf/*.yaml', flatten: true, raw: true} - `, dir))) - - loads, err := LoadConfig(ctx, path) - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(config.Monitors[0].OtherConfig["templates"]).Should(ConsistOf(`LoadPlugin "cpufreq"`)) - }) - - It("Allows JSONPath processing of source values", func() { - path := mkFile("agent/agent.yaml", outdent(` - signalFxAccessToken: {"#from": "env:ASDF_INFO", jsonPath: "$.token"} - `)) - - os.Setenv("ASDF_INFO", `{"token": "s3cr3t", "app_name": "my_app"}`) - loads, err := LoadConfig(ctx, path) - os.Unsetenv("ASDF_INFO") - - Expect(err).ShouldNot(HaveOccurred()) - - var config *Config - Eventually(loads).Should(Receive(&config)) - - Expect(config.SignalFxAccessToken).Should(Equal(`s3cr3t`)) - }) - -}) - -func TestLoader(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Config Loader") -} diff --git a/internal/signalfx-agent/pkg/utils/events.go b/internal/signalfx-agent/pkg/utils/events.go deleted file mode 100644 index e03cfcd150..0000000000 --- a/internal/signalfx-agent/pkg/utils/events.go +++ /dev/null @@ -1,9 +0,0 @@ -package utils - -import "github.com/signalfx/golib/v3/event" - -// CloneEvent creates a new instance of the event with a shallow copy of all -// map data structures. -func CloneEvent(ev *event.Event) *event.Event { - return event.NewWithProperties(ev.EventType, ev.Category, CloneStringMap(ev.Dimensions), CloneInterfaceMap(ev.Properties), ev.Timestamp) -} diff --git a/internal/signalfx-agent/pkg/utils/log.go b/internal/signalfx-agent/pkg/utils/log.go index bbc6dc3270..ba9247a3c9 100644 --- a/internal/signalfx-agent/pkg/utils/log.go +++ b/internal/signalfx-agent/pkg/utils/log.go @@ -8,48 +8,8 @@ import ( lru "github.com/hashicorp/golang-lru" "github.com/signalfx/golib/v3/log" "github.com/sirupsen/logrus" - - apmlog "github.com/signalfx/signalfx-agent/pkg/apm/log" ) -func NewAPMShim(log logrus.FieldLogger) apmlog.Logger { - return apmShim{log: log} -} - -type apmShim struct { - log logrus.FieldLogger -} - -func (a apmShim) Debug(msg string) { - a.log.Debug(msg) -} - -func (a apmShim) Warn(msg string) { - a.log.Warn(msg) -} - -func (a apmShim) Error(msg string) { - a.log.Error(msg) -} - -func (a apmShim) Info(msg string) { - a.log.Info(msg) -} - -func (a apmShim) Panic(msg string) { - a.log.Panic(msg) -} - -func (a apmShim) WithFields(fields apmlog.Fields) apmlog.Logger { - return apmShim{log: a.log.WithFields(logrus.Fields(fields))} -} - -func (a apmShim) WithError(err error) apmlog.Logger { - return apmShim{log: a.log.WithError(err)} -} - -var _ apmlog.Logger = &apmShim{} - // LogrusGolibShim makes a Logrus logger conform to the golib Log interface type LogrusGolibShim struct { logrus.FieldLogger diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index d4d17e1257..438060ec11 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -503,7 +503,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2 h1:BQ1HW7hr4IVovMwWg0E0PYcyW8CzqDcVmaew9cujU4s= github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= @@ -511,8 +510,6 @@ github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/okta/okta-sdk-golang/v2 v2.12.1 h1:U+smE7trkHSZO8Mval3Ow85dbxawO+pMAr692VZq9gM= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8= @@ -918,7 +915,6 @@ gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 45d9299185232b0b7a760c1ce72b37315955ae10 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Mon, 25 Sep 2023 08:31:07 -0700 Subject: [PATCH 32/55] remove unused utilities (#3687) --- internal/signalfx-agent/pkg/utils/set.go | 26 ---------------------- internal/signalfx-agent/pkg/utils/slice.go | 24 -------------------- 2 files changed, 50 deletions(-) diff --git a/internal/signalfx-agent/pkg/utils/set.go b/internal/signalfx-agent/pkg/utils/set.go index 32a225d99f..293ffdf6ed 100644 --- a/internal/signalfx-agent/pkg/utils/set.go +++ b/internal/signalfx-agent/pkg/utils/set.go @@ -1,20 +1,5 @@ package utils -// UniqueStrings returns a slice with the unique set of strings from the input -func UniqueStrings(strings []string) []string { - unique := map[string]struct{}{} - for _, v := range strings { - unique[v] = struct{}{} - } - - keys := make([]string, 0) - for k := range unique { - keys = append(keys, k) - } - - return keys -} - // StringSliceToMap converts a slice of strings into a map with keys from the slice func StringSliceToMap(strings []string) map[string]bool { // Use bool so that the user can do `if setMap[key] { ... }`` @@ -37,17 +22,6 @@ func StringSetToSlice(set map[string]bool) []string { return out } -// MergeStringSets merges 2+ string map sets into a single output map. -func MergeStringSets(sets ...map[string]bool) map[string]bool { - out := map[string]bool{} - for _, ss := range sets { - for k, v := range ss { - out[k] = v - } - } - return out -} - // StringSet creates a map set from vararg func StringSet(strings ...string) map[string]bool { return StringSliceToMap(strings) diff --git a/internal/signalfx-agent/pkg/utils/slice.go b/internal/signalfx-agent/pkg/utils/slice.go index b873cf1828..c16c83b29b 100644 --- a/internal/signalfx-agent/pkg/utils/slice.go +++ b/internal/signalfx-agent/pkg/utils/slice.go @@ -1,29 +1,5 @@ package utils -// MakeRange creates an int slice containing all ints between `min` and `max` -func MakeRange(min, max int) []int { - a := make([]int, max-min+1) - for i := range a { - a[i] = min + i - } - return a -} - -// InterfaceSliceToStringSlice returns a new slice that contains the elements -// of `is` as strings. Returns nil if any of the elements of `is` are not -// strings. -func InterfaceSliceToStringSlice(is []interface{}) []string { - var ss []string - for _, intf := range is { - if s, ok := intf.(string); ok { - ss = append(ss, s) - } else { - return nil - } - } - return ss -} - // RemoveAllElementsFromStringSlice removes all elements from toRemove that exists // in inputStrings func RemoveAllElementsFromStringSlice(inputStrings []string, toRemoveStrings []string) []string { From 6225582d33af9597dbdd52753facc7ea8fe8006f Mon Sep 17 00:00:00 2001 From: Jeremy Hicks Date: Mon, 25 Sep 2023 15:01:23 -0400 Subject: [PATCH 33/55] Oracledb discovery (#3633) * update bundled test and configs for oraclediscovery * update bundled test and configs for oraclediscovery * running bundled_test now evaluate metrics matching * add working bundled_test * update fail and partial messages for receiver config variables * order of bundled configs matters * make fmt and add more time * lower durations, add in args for endpoint and service * reduce time on image pull and add to windows bundle * add to bundle_windows_test * lower times on tests * address feedback on yaml template and test using env var * gotta make generate-metrics * re-arrange bundled test * add oracledb to the discovery readme * make generate-metrics fmt * address feedback * Update internal/confmapprovider/discovery/README.md Co-authored-by: Ryan Fitzpatrick <10867373+rmfitzpatrick@users.noreply.github.com> * fix to re-check and other attribute fields * add new test data for bundled test * add generated yaml --------- Co-authored-by: greatestusername-splunk <83726369+greatestusername-splunk@users.noreply.github.com> Co-authored-by: Ryan Fitzpatrick <10867373+rmfitzpatrick@users.noreply.github.com> --- .../receivers/oracledb.discovery.yaml | 76 +++++++++++++++++++ internal/confmapprovider/discovery/README.md | 9 ++- .../receivers/oracledb.discovery.yaml | 72 ++++++++++++++++++ .../receivers/oracledb.discovery.yaml.tmpl | 68 +++++++++++++++++ .../discovery/bundle/bundle_gen.go | 2 + .../discovery/bundle/bundle_other_test.go | 1 + .../discovery/bundle/bundle_windows.go | 1 + .../discovery/bundle/bundle_windows_test.go | 1 + tests/receivers/oracledb/bundled_test.go | 61 +++++++++++++++ tests/receivers/oracledb/oracledb_test.go | 2 +- .../oracledb/testdata/otlp_exporter.yaml | 13 ++++ .../testdata/resource_metrics/all.yaml | 1 + .../testdata/resource_metrics/bundled.yaml | 63 +++++++++++++++ 13 files changed, 365 insertions(+), 5 deletions(-) create mode 100644 cmd/otelcol/config/collector/config.d.linux/receivers/oracledb.discovery.yaml create mode 100644 internal/confmapprovider/discovery/bundle/bundle.d/receivers/oracledb.discovery.yaml create mode 100644 internal/confmapprovider/discovery/bundle/bundle.d/receivers/oracledb.discovery.yaml.tmpl create mode 100644 tests/receivers/oracledb/bundled_test.go create mode 100644 tests/receivers/oracledb/testdata/otlp_exporter.yaml create mode 100644 tests/receivers/oracledb/testdata/resource_metrics/bundled.yaml diff --git a/cmd/otelcol/config/collector/config.d.linux/receivers/oracledb.discovery.yaml b/cmd/otelcol/config/collector/config.d.linux/receivers/oracledb.discovery.yaml new file mode 100644 index 0000000000..8dec37f1e9 --- /dev/null +++ b/cmd/otelcol/config/collector/config.d.linux/receivers/oracledb.discovery.yaml @@ -0,0 +1,76 @@ +##################################################################################### +# This file is generated by the Splunk Distribution of the OpenTelemetry Collector. # +# # +# It reflects the default configuration bundled in the Collector executable for use # +# in discovery mode (--discovery) and is provided for reference or customization. # +# Please note that any changes made to this file will need to be reconciled during # +# upgrades of the Collector. # +##################################################################################### +# oracledb: +# enabled: true +# rule: +# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)oracle"}) and not (command matches "splunk.discovery") +# host_observer: type == "hostport" and command matches "(?i)oracle" and not (command matches "splunk.discovery") +# k8s_observer: type == "port" and pod.name matches "(?i)oracle" +# config: +# default: +# endpoint: splunk.discovery.default +# username: splunk.discovery.default +# password: splunk.discovery.default +# service: splunk.discovery.default +# status: +# metrics: +# successful: +# - strict: oracledb.cpu_time +# first_only: true +# log_record: +# severity_text: info +# body: oracledb receiver is working! +# statements: +# failed: +# - regexp: "connection refused" +# first_only: true +# log_record: +# severity_text: info +# append_pattern: true +# body: The container is not serving http connections. +# - regexp: "received goaway and there are no active streams" +# first_only: true +# log_record: +# severity_text: info +# append_pattern: true +# body: Unable to connect and scrape metrics. +# - regexp: "dial tcp: lookup" +# first_only: true +# log_record: +# severity_text: info +# append_pattern: true +# body: Unable to resolve oracledb tcp endpoint +# - regexp: 'error executing select .*: EOF' +# first_only: true +# log_record: +# severity_text: info +# append_pattern: true +# body: Unable to execute select from oracledb. Verify endpoint and user permissions. +# partial: +# - regexp: "listener does not currently know of service requested" +# first_only: true +# log_record: +# severity_text: info +# append_pattern: true +# body: >- +# Make sure your oracledb service is correctly specified using the +# `--set splunk.discovery.receivers.oracledb.config.service=""` command or the +# `SPLUNK_DISCOVERY_RECEIVERS_oracledb_CONFIG_service=""` environment variable. +# - regexp: 'invalid username/password' +# first_only: true +# log_record: +# severity_text: info +# append_pattern: true +# body: >- +# Make sure your user credentials are correctly specified using the +# `--set splunk.discovery.receivers.oracledb.config.username=""` and +# `--set splunk.discovery.receivers.oracledb.config.password=""` command or the +# `SPLUNK_DISCOVERY_RECEIVERS_oracledb_CONFIG_username=""` and +# `SPLUNK_DISCOVERY_RECEIVERS_oracledb_CONFIG_password=""` environment variables. +# \ No newline at end of file diff --git a/internal/confmapprovider/discovery/README.md b/internal/confmapprovider/discovery/README.md index b67b7c1beb..e879836194 100644 --- a/internal/confmapprovider/discovery/README.md +++ b/internal/confmapprovider/discovery/README.md @@ -135,10 +135,11 @@ By default, the discovery mode is provided with pre-made discovery config compon The following components have bundled discovery configurations in the last Splunk OpenTelemetry Collector release: -I. Smart Agent receiver -* `collectd/mysql` monitor type ([Linux](./bundle/bundle.d/receivers/smartagent-collectd-mysql.discovery.yaml)) -* `collectd/nginx` monitor type ([Linux](./bundle/bundle.d/receivers/smartagent-collectd-nginx.discovery.yaml)) -* `postgresql` monitor type ([Linux and Windows](./bundle/bundle.d/receivers/smartagent-postgresql.discovery.yaml)) +I. Receivers +* `oracledb` ([Linux and Windows](./bundle/bundle.d/receivers/oracledb.discovery.yaml)) +* `smartagent` with `collectd/mysql` monitor type ([Linux](./bundle/bundle.d/receivers/smartagent-collectd-mysql.discovery.yaml)) +* `smartagent` with `collectd/nginx` monitor type ([Linux](./bundle/bundle.d/receivers/smartagent-collectd-nginx.discovery.yaml)) +* `smartagent` with `postgresql` monitor type ([Linux and Windows](./bundle/bundle.d/receivers/smartagent-postgresql.discovery.yaml)) II. Extensions * `docker_observer` ([Linux and Windows](./bundle/bundle.d/extensions/docker-observer.discovery.yaml)) diff --git a/internal/confmapprovider/discovery/bundle/bundle.d/receivers/oracledb.discovery.yaml b/internal/confmapprovider/discovery/bundle/bundle.d/receivers/oracledb.discovery.yaml new file mode 100644 index 0000000000..b76e27ff01 --- /dev/null +++ b/internal/confmapprovider/discovery/bundle/bundle.d/receivers/oracledb.discovery.yaml @@ -0,0 +1,72 @@ +##################################################################################### +# Do not edit manually! # +# All changes must be made to associated .tmpl file before running 'make bundle.d'. # +##################################################################################### +oracledb: + enabled: true + rule: + docker_observer: type == "container" and any([name, image, command], {# matches "(?i)oracle"}) and not (command matches "splunk.discovery") + host_observer: type == "hostport" and command matches "(?i)oracle" and not (command matches "splunk.discovery") + k8s_observer: type == "port" and pod.name matches "(?i)oracle" + config: + default: + endpoint: splunk.discovery.default + username: splunk.discovery.default + password: splunk.discovery.default + service: splunk.discovery.default + status: + metrics: + successful: + - strict: oracledb.cpu_time + first_only: true + log_record: + severity_text: info + body: oracledb receiver is working! + statements: + failed: + - regexp: "connection refused" + first_only: true + log_record: + severity_text: info + append_pattern: true + body: The container is not serving http connections. + - regexp: "received goaway and there are no active streams" + first_only: true + log_record: + severity_text: info + append_pattern: true + body: Unable to connect and scrape metrics. + - regexp: "dial tcp: lookup" + first_only: true + log_record: + severity_text: info + append_pattern: true + body: Unable to resolve oracledb tcp endpoint + - regexp: 'error executing select .*: EOF' + first_only: true + log_record: + severity_text: info + append_pattern: true + body: Unable to execute select from oracledb. Verify endpoint and user permissions. + partial: + - regexp: "listener does not currently know of service requested" + first_only: true + log_record: + severity_text: info + append_pattern: true + body: >- + Make sure your oracledb service is correctly specified using the + `--set splunk.discovery.receivers.oracledb.config.service=""` command or the + `SPLUNK_DISCOVERY_RECEIVERS_oracledb_CONFIG_service=""` environment variable. + - regexp: 'invalid username/password' + first_only: true + log_record: + severity_text: info + append_pattern: true + body: >- + Make sure your user credentials are correctly specified using the + `--set splunk.discovery.receivers.oracledb.config.username=""` and + `--set splunk.discovery.receivers.oracledb.config.password=""` command or the + `SPLUNK_DISCOVERY_RECEIVERS_oracledb_CONFIG_username=""` and + `SPLUNK_DISCOVERY_RECEIVERS_oracledb_CONFIG_password=""` environment variables. + \ No newline at end of file diff --git a/internal/confmapprovider/discovery/bundle/bundle.d/receivers/oracledb.discovery.yaml.tmpl b/internal/confmapprovider/discovery/bundle/bundle.d/receivers/oracledb.discovery.yaml.tmpl new file mode 100644 index 0000000000..4b441ecb1d --- /dev/null +++ b/internal/confmapprovider/discovery/bundle/bundle.d/receivers/oracledb.discovery.yaml.tmpl @@ -0,0 +1,68 @@ +{{ receiver "oracledb" }}: + enabled: true + rule: + docker_observer: type == "container" and any([name, image, command], {# matches "(?i)oracle"}) and not (command matches "splunk.discovery") + host_observer: type == "hostport" and command matches "(?i)oracle" and not (command matches "splunk.discovery") + k8s_observer: type == "port" and pod.name matches "(?i)oracle" + config: + default: + endpoint: {{ defaultValue }} + username: {{ defaultValue }} + password: {{ defaultValue }} + service: {{ defaultValue }} + status: + metrics: + successful: + - strict: oracledb.cpu_time + first_only: true + log_record: + severity_text: info + body: oracledb receiver is working! + statements: + failed: + - regexp: "connection refused" + first_only: true + log_record: + severity_text: info + append_pattern: true + body: The container is not serving http connections. + - regexp: "received goaway and there are no active streams" + first_only: true + log_record: + severity_text: info + append_pattern: true + body: Unable to connect and scrape metrics. + - regexp: "dial tcp: lookup" + first_only: true + log_record: + severity_text: info + append_pattern: true + body: Unable to resolve oracledb tcp endpoint + - regexp: 'error executing select .*: EOF' + first_only: true + log_record: + severity_text: info + append_pattern: true + body: Unable to execute select from oracledb. Verify endpoint and user permissions. + partial: + - regexp: "listener does not currently know of service requested" + first_only: true + log_record: + severity_text: info + append_pattern: true + body: >- + Make sure your oracledb service is correctly specified using the + `--set {{ configProperty "service" "" }}` command or the + `{{ configPropertyEnvVar "service" "" }}` environment variable. + - regexp: 'invalid username/password' + first_only: true + log_record: + severity_text: info + append_pattern: true + body: >- + Make sure your user credentials are correctly specified using the + `--set {{ configProperty "username" "" }}` and + `--set {{ configProperty "password" "" }}` command or the + `{{ configPropertyEnvVar "username" "" }}` and + `{{ configPropertyEnvVar "password" "" }}` environment variables. + \ No newline at end of file diff --git a/internal/confmapprovider/discovery/bundle/bundle_gen.go b/internal/confmapprovider/discovery/bundle/bundle_gen.go index 5748baa7e6..71251eb0e3 100644 --- a/internal/confmapprovider/discovery/bundle/bundle_gen.go +++ b/internal/confmapprovider/discovery/bundle/bundle_gen.go @@ -25,6 +25,8 @@ //go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/smartagent-collectd-mysql.discovery.yaml.tmpl //go:generate discoverybundler -r -t bundle.d/receivers/smartagent-collectd-nginx.discovery.yaml.tmpl //go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/smartagent-collectd-nginx.discovery.yaml.tmpl +//go:generate discoverybundler -r -t bundle.d/receivers/oracledb.discovery.yaml.tmpl +//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/oracledb.discovery.yaml.tmpl //go:generate discoverybundler -r -t bundle.d/extensions/docker-observer.discovery.yaml.tmpl //go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/extensions -t bundle.d/extensions/docker-observer.discovery.yaml.tmpl diff --git a/internal/confmapprovider/discovery/bundle/bundle_other_test.go b/internal/confmapprovider/discovery/bundle/bundle_other_test.go index 6ea3b2385f..b1c4b01118 100644 --- a/internal/confmapprovider/discovery/bundle/bundle_other_test.go +++ b/internal/confmapprovider/discovery/bundle/bundle_other_test.go @@ -27,6 +27,7 @@ func TestBundleDir(t *testing.T) { receivers, err := fs.Glob(BundledFS, "bundle.d/receivers/*.discovery.yaml") require.NoError(t, err) require.Equal(t, []string{ + "bundle.d/receivers/oracledb.discovery.yaml", "bundle.d/receivers/smartagent-collectd-mysql.discovery.yaml", "bundle.d/receivers/smartagent-collectd-nginx.discovery.yaml", "bundle.d/receivers/smartagent-postgresql.discovery.yaml", diff --git a/internal/confmapprovider/discovery/bundle/bundle_windows.go b/internal/confmapprovider/discovery/bundle/bundle_windows.go index cf195ac45a..00350e8aa7 100644 --- a/internal/confmapprovider/discovery/bundle/bundle_windows.go +++ b/internal/confmapprovider/discovery/bundle/bundle_windows.go @@ -27,5 +27,6 @@ import ( // build errors. // //go:embed bundle.d/extensions/*.discovery.yaml +//go:embed bundle.d/receivers/oracledb.discovery.yaml //go:embed bundle.d/receivers/smartagent-postgresql.discovery.yaml var BundledFS embed.FS diff --git a/internal/confmapprovider/discovery/bundle/bundle_windows_test.go b/internal/confmapprovider/discovery/bundle/bundle_windows_test.go index 13a00328ad..1a0b10f090 100644 --- a/internal/confmapprovider/discovery/bundle/bundle_windows_test.go +++ b/internal/confmapprovider/discovery/bundle/bundle_windows_test.go @@ -27,6 +27,7 @@ func TestBundleDir(t *testing.T) { receivers, err := fs.Glob(BundledFS, "bundle.d/receivers/*.discovery.yaml") require.NoError(t, err) require.Equal(t, []string{ + "bundle.d/receivers/oracledb.discovery.yaml", "bundle.d/receivers/smartagent-postgresql.discovery.yaml", }, receivers) diff --git a/tests/receivers/oracledb/bundled_test.go b/tests/receivers/oracledb/bundled_test.go new file mode 100644 index 0000000000..a853789d71 --- /dev/null +++ b/tests/receivers/oracledb/bundled_test.go @@ -0,0 +1,61 @@ +// Copyright Splunk, Inc. +// +// 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. + +//go:build integration + +package tests + +import ( + "fmt" + "runtime" + "testing" + + "github.com/signalfx/splunk-otel-collector/tests/testutils" +) + +func TestOracledbDockerObserver(t *testing.T) { + testutils.SkipIfNotContainerTest(t) + if runtime.GOOS == "darwin" { + t.Skip("unable to share sockets between mac and d4m vm: https://github.com/docker/for-mac/issues/483#issuecomment-758836836") + } + + testutils.AssertAllMetricsReceived(t, "bundled.yaml", "otlp_exporter.yaml", + oracledb, []testutils.CollectorBuilder{ + func(c testutils.Collector) testutils.Collector { + cc := c.(*testutils.CollectorContainer) + cc.Container = cc.Container.WithBinds("/var/run/docker.sock:/var/run/docker.sock:ro") + cc.Container = cc.Container.WillWaitForLogs("Discovering for next") + cc.Container = cc.Container.WithUser(fmt.Sprintf("999:%d", testutils.GetDockerGID(t))) + return cc + }, + func(collector testutils.Collector) testutils.Collector { + return collector.WithEnv(map[string]string{ + "ORACLEDB_URL": "oracle://otel:password@localhost:1521/XE", + "SPLUNK_DISCOVERY_DURATION": "10s", + // confirm that debug logging doesn't affect runtime + "SPLUNK_DISCOVERY_LOG_LEVEL": "debug", + "ORACLE_PASSWORD": "password", + }).WithArgs( + "--discovery", + "--set", "splunk.discovery.receivers.oracledb.config.username=otel", + "--set", "splunk.discovery.receivers.oracledb.config.password='${ORACLE_PASSWORD}'", + "--set", "splunk.discovery.receivers.oracledb.config.endpoint=localhost:1521", + "--set", "splunk.discovery.receivers.oracledb.config.service=XE", + "--set", `splunk.discovery.extensions.k8s_observer.enabled=false`, + "--set", `splunk.discovery.extensions.host_observer.enabled=false`, + ) + }, + }, + ) +} diff --git a/tests/receivers/oracledb/oracledb_test.go b/tests/receivers/oracledb/oracledb_test.go index c43727b95f..2774013f55 100644 --- a/tests/receivers/oracledb/oracledb_test.go +++ b/tests/receivers/oracledb/oracledb_test.go @@ -29,7 +29,7 @@ import ( // account for startup time is to wait for the container to be healthy before continuing test. var oracledb = []testutils.Container{testutils.NewContainer().WithContext( path.Join(".", "testdata", "server"), -).WithName("oracledb").WithExposedPorts("1521:1521").WillWaitForHealth(15 * time.Minute)} +).WithName("oracledb").WithExposedPorts("1521:1521").WillWaitForHealth(5 * time.Minute)} // This test ensures the collector can connect to an Oracle DB, and properly get metrics. It's not intended to // test the receiver itself. diff --git a/tests/receivers/oracledb/testdata/otlp_exporter.yaml b/tests/receivers/oracledb/testdata/otlp_exporter.yaml new file mode 100644 index 0000000000..fa00f3c646 --- /dev/null +++ b/tests/receivers/oracledb/testdata/otlp_exporter.yaml @@ -0,0 +1,13 @@ +exporters: + otlp: + endpoint: "${OTLP_ENDPOINT}" + tls: + insecure: true + +service: + telemetry: + logs: + level: debug + pipelines: + metrics: + exporters: [otlp] diff --git a/tests/receivers/oracledb/testdata/resource_metrics/all.yaml b/tests/receivers/oracledb/testdata/resource_metrics/all.yaml index b964878a83..1b24c5b82f 100644 --- a/tests/receivers/oracledb/testdata/resource_metrics/all.yaml +++ b/tests/receivers/oracledb/testdata/resource_metrics/all.yaml @@ -3,6 +3,7 @@ resource_metrics: oracledb.instance.name: localhost:1521/XE scope_metrics: - instrumentation_scope: + attributes: {} name: otelcol/oracledbreceiver version: metrics: diff --git a/tests/receivers/oracledb/testdata/resource_metrics/bundled.yaml b/tests/receivers/oracledb/testdata/resource_metrics/bundled.yaml new file mode 100644 index 0000000000..5138d627a8 --- /dev/null +++ b/tests/receivers/oracledb/testdata/resource_metrics/bundled.yaml @@ -0,0 +1,63 @@ +resource_metrics: + - attributes: + container.image.name: + container.name: oracledb + oracledb.instance.name: localhost:1521/XE + scope_metrics: + - instrumentation_scope: + attributes: {} + name: otelcol/oracledbreceiver + version: + metrics: + - name: oracledb.cpu_time + type: DoubleMonotonicCumulativeSum + - name: oracledb.enqueue_deadlocks + type: IntMonotonicCumulativeSum + - name: oracledb.exchange_deadlocks + type: IntMonotonicCumulativeSum + - name: oracledb.executions + type: IntMonotonicCumulativeSum + - name: oracledb.hard_parses + type: IntMonotonicCumulativeSum + - name: oracledb.logical_reads + type: IntMonotonicCumulativeSum + - name: oracledb.parse_calls + type: IntMonotonicCumulativeSum + - name: oracledb.pga_memory + type: IntMonotonicCumulativeSum + - name: oracledb.physical_reads + type: IntMonotonicCumulativeSum + - name: oracledb.user_commits + type: IntMonotonicCumulativeSum + - name: oracledb.user_rollbacks + type: IntMonotonicCumulativeSum + - name: oracledb.sessions.usage + type: IntGauge + - name: oracledb.processes.usage + type: IntGauge + - name: oracledb.processes.limit + type: IntGauge + - name: oracledb.sessions.usage + type: IntGauge + - name: oracledb.sessions.limit + type: IntGauge + - name: oracledb.enqueue_locks.usage + type: IntGauge + - name: oracledb.enqueue_locks.limit + type: IntGauge + - name: oracledb.enqueue_resources.usage + type: IntGauge + - name: oracledb.enqueue_resources.limit + type: IntGauge + - name: oracledb.transactions.usage + type: IntGauge + - name: oracledb.transactions.limit + type: IntGauge + - name: oracledb.dml_locks.usage + type: IntGauge + - name: oracledb.dml_locks.limit + type: IntGauge + - name: oracledb.tablespace_size.limit + type: IntGauge + - name: oracledb.tablespace_size.usage + type: IntGauge \ No newline at end of file From 905f8e48c8b22783f74b187f4fa73e9244953cb3 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Mon, 25 Sep 2023 14:35:05 -0700 Subject: [PATCH 34/55] Remove the monitor manager used by the agent (#3689) --- go.mod | 1 - go.sum | 2 - internal/signalfx-agent/go.mod | 1 - internal/signalfx-agent/go.sum | 2 - .../pkg/monitors/activemonitor.go | 161 ------ .../pkg/monitors/diagnostics.go | 150 ------ .../signalfx-agent/pkg/monitors/filtering.go | 241 --------- .../pkg/monitors/filtering_test.go | 182 ------- internal/signalfx-agent/pkg/monitors/help.go | 1 - .../pkg/monitors/helpers_test.go | 10 - .../signalfx-agent/pkg/monitors/manager.go | 503 ------------------ .../pkg/monitors/manager_test.go | 500 ----------------- .../signalfx-agent/pkg/monitors/monitor.go | 81 --- .../signalfx-agent/pkg/monitors/output.go | 212 -------- .../pkg/monitors/output_test.go | 245 --------- internal/signalfx-agent/pkg/monitors/proxy.go | 43 -- .../signalfx-agent/pkg/monitors/validation.go | 56 -- pkg/receiver/smartagentreceiver/go.mod | 1 - pkg/receiver/smartagentreceiver/go.sum | 2 - 19 files changed, 2394 deletions(-) delete mode 100644 internal/signalfx-agent/pkg/monitors/activemonitor.go delete mode 100644 internal/signalfx-agent/pkg/monitors/diagnostics.go delete mode 100644 internal/signalfx-agent/pkg/monitors/filtering.go delete mode 100644 internal/signalfx-agent/pkg/monitors/filtering_test.go delete mode 100644 internal/signalfx-agent/pkg/monitors/help.go delete mode 100644 internal/signalfx-agent/pkg/monitors/manager.go delete mode 100644 internal/signalfx-agent/pkg/monitors/manager_test.go delete mode 100644 internal/signalfx-agent/pkg/monitors/output.go delete mode 100644 internal/signalfx-agent/pkg/monitors/output_test.go delete mode 100644 internal/signalfx-agent/pkg/monitors/proxy.go delete mode 100644 internal/signalfx-agent/pkg/monitors/validation.go diff --git a/go.mod b/go.mod index bec34ee501..3b7bbefb5b 100644 --- a/go.mod +++ b/go.mod @@ -391,7 +391,6 @@ require ( github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/hashstructure v1.1.0 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect diff --git a/go.sum b/go.sum index 7a5abb25a9..652d0724ba 100644 --- a/go.sum +++ b/go.sum @@ -1021,8 +1021,6 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= -github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0= github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index 867807728c..d6522e1d32 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -58,7 +58,6 @@ require ( github.com/lib/pq v1.10.9 github.com/mailru/easyjson v0.7.7 github.com/mattn/go-xmlrpc v0.0.3 - github.com/mitchellh/go-wordwrap v1.0.1 github.com/mitchellh/hashstructure v1.1.0 github.com/mongodb/go-client-mongodb-atlas v0.2.0 github.com/olekukonko/tablewriter v0.0.5 diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index 05c7256922..534485a8fe 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -829,8 +829,6 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= -github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0= github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= diff --git a/internal/signalfx-agent/pkg/monitors/activemonitor.go b/internal/signalfx-agent/pkg/monitors/activemonitor.go deleted file mode 100644 index 521aa59dd7..0000000000 --- a/internal/signalfx-agent/pkg/monitors/activemonitor.go +++ /dev/null @@ -1,161 +0,0 @@ -package monitors - -import ( - "fmt" - "reflect" - - "github.com/signalfx/defaults" - - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/meta" - "github.com/signalfx/signalfx-agent/pkg/core/services" - "github.com/signalfx/signalfx-agent/pkg/monitors/types" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -// ActiveMonitor is a wrapper for an actual monitor instance that keeps some -// metadata about the monitor, such as the set of service endpoints attached to -// the monitor, as well as a copy of its configuration. It exposes a lot of -// methods to help manage the monitor as well. -type ActiveMonitor struct { - instance interface{} - id types.MonitorID - configHash uint64 - agentMeta *meta.AgentMeta - output types.FilteringOutput - config config.MonitorCustomConfig - endpoint services.Endpoint - // Is the monitor marked for deletion? - doomed bool -} - -func renderConfig(monConfig config.MonitorCustomConfig, endpoint services.Endpoint) (config.MonitorCustomConfig, error) { - monConfig = utils.CloneInterface(monConfig).(config.MonitorCustomConfig) - if err := defaults.Set(monConfig); err != nil { - return nil, err - } - - if endpoint != nil { - err := config.DecodeExtraConfig(endpoint, monConfig, false) - if err != nil { - return nil, fmt.Errorf("could not inject endpoint config into monitor config: %w", err) - } - - for configKey, rule := range monConfig.MonitorConfigCore().ConfigEndpointMappings { - cem := &services.ConfigEndpointMapping{ - Endpoint: endpoint, - ConfigKey: configKey, - Rule: rule, - } - if err := config.DecodeExtraConfig(cem, monConfig, false); err != nil { - return nil, fmt.Errorf("could not process config mapping: %s => %s -- %s", configKey, rule, err.Error()) - } - } - } - - // Wipe out the other config that has already been decoded since it is not - // redundant. - monConfig.MonitorConfigCore().OtherConfig = nil - return monConfig, nil -} - -// Does some reflection magic to pass the right type to the Configure method of -// each monitor -func (am *ActiveMonitor) configureMonitor(monConfig config.MonitorCustomConfig) error { - monConfig.MonitorConfigCore().MonitorID = am.id - for k, v := range monConfig.MonitorConfigCore().ExtraDimensions { - am.output.AddExtraDimension(k, v) - } - - for k, v := range monConfig.MonitorConfigCore().ExtraDimensionsFromEndpoint { - val, err := services.EvaluateRule(am.endpoint, v, true, true) - if err != nil { - return err - } - am.output.AddExtraDimension(k, fmt.Sprintf("%v", val)) - } - - for k, v := range monConfig.MonitorConfigCore().ExtraSpanTags { - am.output.AddExtraSpanTag(k, v) - } - - for k, v := range monConfig.MonitorConfigCore().ExtraSpanTagsFromEndpoint { - val, err := services.EvaluateRule(am.endpoint, v, true, true) - if err != nil { - return err - } - am.output.AddExtraSpanTag(k, fmt.Sprintf("%v", val)) - } - - for k, v := range monConfig.MonitorConfigCore().DefaultSpanTags { - am.output.AddDefaultSpanTag(k, v) - } - - for k, v := range monConfig.MonitorConfigCore().DefaultSpanTagsFromEndpoint { - val, err := services.EvaluateRule(am.endpoint, v, true, true) - if err != nil { - return err - } - am.output.AddDefaultSpanTag(k, fmt.Sprintf("%v", val)) - } - - if err := validateConfig(monConfig); err != nil { - return err - } - - am.config = monConfig - am.injectAgentMetaIfNeeded() - am.injectOutputIfNeeded() - - return config.CallConfigure(am.instance, monConfig) -} - -func (am *ActiveMonitor) endpointID() services.ID { - if am.endpoint == nil { - return "" - } - return am.endpoint.Core().ID -} - -func (am *ActiveMonitor) injectOutputIfNeeded() bool { - outputValue := utils.FindFieldWithEmbeddedStructs(am.instance, "Output", - reflect.TypeOf((*types.Output)(nil)).Elem()) - - if !outputValue.IsValid() { - // Try and find FilteringOutput type - outputValue = utils.FindFieldWithEmbeddedStructs(am.instance, "Output", - reflect.TypeOf((*types.FilteringOutput)(nil)).Elem()) - if !outputValue.IsValid() { - return false - } - } - - outputValue.Set(reflect.ValueOf(am.output)) - - return true -} - -// Sets the `AgentMeta` field on a monitor if it is present to the agent -// metadata service. Returns whether the field was actually set. -// N.B. that the values in AgentMeta are subject to change at any time. There -// is no notification mechanism for changes, so a monitor should pull the value -// from the struct each time it needs it and not cache it. -func (am *ActiveMonitor) injectAgentMetaIfNeeded() bool { - agentMetaValue := utils.FindFieldWithEmbeddedStructs(am.instance, "AgentMeta", - reflect.TypeOf(&meta.AgentMeta{})) - - if !agentMetaValue.IsValid() { - return false - } - - agentMetaValue.Set(reflect.ValueOf(am.agentMeta)) - - return true -} - -// Shutdown calls Shutdown on the monitor instance if it is provided. -func (am *ActiveMonitor) Shutdown() { - if sh, ok := am.instance.(Shutdownable); ok { - sh.Shutdown() - } -} diff --git a/internal/signalfx-agent/pkg/monitors/diagnostics.go b/internal/signalfx-agent/pkg/monitors/diagnostics.go deleted file mode 100644 index 8b7ec59812..0000000000 --- a/internal/signalfx-agent/pkg/monitors/diagnostics.go +++ /dev/null @@ -1,150 +0,0 @@ -package monitors - -import ( - "fmt" - "strings" - - "github.com/mitchellh/go-wordwrap" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/sfxclient" - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/services" - "github.com/signalfx/signalfx-agent/pkg/monitors/kubernetes/leadership" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -const maxLineLength = 120 - -func endpointToDiagnosticText(endpoint services.Endpoint, isMonitored bool) string { - var items []string - - items = append(items, "internalId: "+string(endpoint.Core().ID)) - if !isMonitored { - items[0] += " (UNMONITORED)" - } - - endpointMap := services.EndpointAsMap(endpoint) - sortedKeys := utils.SortMapKeys(endpointMap) - for _, k := range sortedKeys { - items = append(items, fmt.Sprintf("%s: %v", k, endpointMap[k])) - } - - out := " - " + strings.Join(items, "\n ") - - return out -} - -// EndpointsDiagnosticText returns diagnostic text about discovered endpoints -func (mm *MonitorManager) EndpointsDiagnosticText() string { - mm.lock.Lock() - defer mm.lock.Unlock() - - out := "Discovered Endpoints: " - for _, endpoint := range mm.discoveredEndpoints { - out += "\n" + endpointToDiagnosticText(endpoint, mm.isEndpointMonitored(endpoint)) + "\n" - } - if len(out) == 0 { - out = "None" - } - return out -} - -// SummaryDiagnosticText is a shorter version of DiagnosticText() -func (mm *MonitorManager) SummaryDiagnosticText() string { - return fmt.Sprintf( - "Active Monitors: %d\n"+ - "Configured Monitors: %d\n"+ - "Discovered Endpoint Count: %d\n"+ - "Bad Monitor Config: %s", - len(mm.activeMonitors), - len(mm.monitorConfigs), - len(mm.discoveredEndpoints), - mm.BadConfigDiagnosticText(), - ) -} - -func formatEnabledMetrics(metrics []string, indent int) string { - metricList := strings.Join(metrics, ", ") - enabledMetricsPrefix := utils.IndentLines("Enabled Metrics: ", indent) - text := fmt.Sprintf("%s[%s]", enabledMetricsPrefix, metricList) - - if len(text) <= maxLineLength { - return text - } - - // Single line is too long, wrap it on multiple lines instead. - // fmt string is equally unreadable so just join it all together. - return strings.Join([]string{ - enabledMetricsPrefix, "[\n", - utils.IndentLines(wordwrap.WrapString(metricList, uint(maxLineLength-indent+2)), indent+2), "\n", - utils.IndentLines("]", indent), - }, "") -} - -// DiagnosticText returns a string to be served on the diagnostic socket -func (mm *MonitorManager) DiagnosticText() string { - mm.lock.Lock() - defer mm.lock.Unlock() - - activeMonText := "" - for i := range mm.activeMonitors { - am := mm.activeMonitors[i] - - serviceStats := "Not using auto-discovery" - if am.endpoint != nil { - serviceStats = fmt.Sprintf( - `Discovery Rule: %s -Monitored Endpoint ID: %s -Endpoint Dimensions: %s`, - am.config.MonitorConfigCore().DiscoveryRule, - am.endpoint.Core().ID, - utils.FormatStringMapCompact(am.endpoint.Dimensions()), - ) - } - activeMonText += fmt.Sprintf( - `%s. %s - Reporting Interval (seconds): %d -%s -%s - Config: -%s -`, - am.config.MonitorConfigCore().MonitorID, - am.config.MonitorConfigCore().Type, - am.config.MonitorConfigCore().IntervalSeconds, - formatEnabledMetrics(am.output.EnabledMetrics(), 4), - utils.IndentLines(serviceStats, 4), - utils.IndentLines(config.ToString(am.config), 6)) - } - return "Active Monitors:\n" + activeMonText -} - -// BadConfigDiagnosticText returns a text representation of any bad monitor -// config that is preventing things from being monitored. -func (mm *MonitorManager) BadConfigDiagnosticText() string { - mm.lock.Lock() - defer mm.lock.Unlock() - - if len(mm.badConfigs) > 0 { - var texts []string - for k := range mm.badConfigs { - conf := mm.badConfigs[k] - texts = append(texts, fmt.Sprintf("[type: %s, error: %s]", - conf.Type, conf.ValidationError)) - } - return strings.Join(texts, " ") - } - return "None" -} - -// InternalMetrics returns a list of datapoints about the internal status of -// the monitors -func (mm *MonitorManager) InternalMetrics() []*datapoint.Datapoint { - return []*datapoint.Datapoint{ - sfxclient.Gauge("sfxagent.active_monitors", nil, int64(len(mm.activeMonitors))), - sfxclient.Gauge("sfxagent.configured_monitors", nil, int64(len(mm.monitorConfigs))), - sfxclient.Gauge("sfxagent.discovered_endpoints", nil, int64(len(mm.discoveredEndpoints))), - sfxclient.Gauge("sfxagent.k8s_leader", map[string]string{"leader_node": leadership.CurrentLeader()}, 1), - } -} diff --git a/internal/signalfx-agent/pkg/monitors/filtering.go b/internal/signalfx-agent/pkg/monitors/filtering.go deleted file mode 100644 index c885fa5318..0000000000 --- a/internal/signalfx-agent/pkg/monitors/filtering.go +++ /dev/null @@ -1,241 +0,0 @@ -package monitors - -import ( - "errors" - "fmt" - "strings" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/dpfilters" - "github.com/signalfx/signalfx-agent/pkg/utils/filter" - "github.com/sirupsen/logrus" -) - -type monitorFiltering struct { - filterSet *dpfilters.FilterSet - metadata *Metadata - hasExtraMetrics bool -} - -func newMonitorFiltering(conf config.MonitorCustomConfig, metadata *Metadata) (*monitorFiltering, error) { - filterSet, err := buildFilterSet(metadata, conf) - if err != nil { - return nil, err - } - - return &monitorFiltering{ - filterSet: filterSet, - metadata: metadata, - hasExtraMetrics: len(conf.MonitorConfigCore().ExtraMetrics) > 0 || len(conf.MonitorConfigCore().ExtraGroups) > 0, - }, nil -} - -// AddDatapointExclusionFilter to the monitor's filter set. Make sure you do this -// before any datapoints are sent as it is not thread-safe with SendDatapoint. -func (mf *monitorFiltering) AddDatapointExclusionFilter(filter dpfilters.DatapointFilter) { - mf.filterSet.ExcludeFilters = append(mf.filterSet.ExcludeFilters, filter) -} - -func (mf *monitorFiltering) EnabledMetrics() []string { - if mf.metadata == nil { - return nil - } - - // This can be optimized to cache results on the struct if it is worth it. - dp := &datapoint.Datapoint{} - var enabledMetrics []string - - for metric := range mf.metadata.Metrics { - dp.Metric = metric - if !mf.filterSet.Matches(dp) { - enabledMetrics = append(enabledMetrics, metric) - } - } - - return enabledMetrics -} - -// HasEnabledMetricInGroup returns true if there are any metrics enabled that -// fall into the given group. -func (mf *monitorFiltering) HasEnabledMetricInGroup(group string) bool { - if mf.metadata == nil { - return false - } - - for _, m := range mf.EnabledMetrics() { - // TODO: If metric names in metadata.yaml ever support wildcards this - // will have to be enhanced. - if mf.metadata.Metrics[m].Group == group { - return true - } - } - return false -} - -// HasAnyExtraMetrics returns true if there is any custom metric -// enabled for this output instance. -func (mf *monitorFiltering) HasAnyExtraMetrics() bool { - return mf.hasExtraMetrics -} - -func buildFilterSet(metadata *Metadata, conf config.MonitorCustomConfig) (*dpfilters.FilterSet, error) { - coreConfig := conf.MonitorConfigCore() - - filter, err := coreConfig.FilterSet() - if err != nil { - return nil, err - } - - excludeFilters := []dpfilters.DatapointFilter{filter} - - // If sendAll is true or there are no metrics don't bother setting up - // filtering - if metadata != nil && len(metadata.Metrics) > 0 && !metadata.SendAll { - // Make a copy of extra metrics from config so we don't alter what the user configured. - extraMetrics := append([]string{}, coreConfig.ExtraMetrics...) - - // Monitors can add additional extra metrics to allow through such as based on config flags. - if monitorExtra, ok := conf.(config.ExtraMetrics); ok { - extraMetrics = append(extraMetrics, monitorExtra.GetExtraMetrics()...) - } - - includedMetricsFilter, err := newMetricsFilter(metadata, extraMetrics, coreConfig.ExtraGroups) - if err != nil { - return nil, fmt.Errorf("unable to construct extraMetrics filter: %s", err) - } - - // Prepend the included metrics filter. - excludeFilters = append([]dpfilters.DatapointFilter{dpfilters.Negate(includedMetricsFilter)}, excludeFilters...) - } - - filterSet := &dpfilters.FilterSet{ - ExcludeFilters: excludeFilters, - } - - return filterSet, nil -} - -var _ dpfilters.DatapointFilter = &extraMetricsFilter{} - -// Filter of datapoints based on included status and user configuration of -// extraMetrics and extraGroups. -type extraMetricsFilter struct { - metadata *Metadata - extraMetrics map[string]bool - stringFilter *filter.BasicStringFilter -} - -func validateMetricName(metadata *Metadata, metricName string) error { - if strings.TrimSpace(metricName) == "" { - return errors.New("metric name cannot be empty") - } - - if metadata.SendUnknown { - // The metrics list isn't exhaustive so can't do extra validation. - return nil - } - - if strings.ContainsRune(metricName, '*') { - // Make sure a metric pattern matches at least one metric. - m, err := filter.NewBasicStringFilter([]string{metricName}) - if err != nil { - return err - } - - for metric := range metadata.Metrics { - if m.Matches(metric) { - return nil - } - } - - logrus.Warnf("extraMetrics: metric pattern '%s' did not match any available metrics for monitor %s", - metricName, metadata.MonitorType) - } - - if !metadata.HasMetric(metricName) { - logrus.Warnf("extraMetrics: metric '%s' does not exist for monitor %s", metricName, metadata.MonitorType) - } - - return nil -} - -func validateGroup(metadata *Metadata, group string) ([]string, error) { - if strings.TrimSpace(group) == "" { - return nil, errors.New("group cannot be empty") - } - - metrics, ok := metadata.GroupMetricsMap[group] - if !ok { - logrus.Warnf("extraMetrics: group %s does not exist for monitor %s", group, metadata.MonitorType) - } - return metrics, nil -} - -func newMetricsFilter(metadata *Metadata, extraMetrics, extraGroups []string) (*extraMetricsFilter, error) { - var filterItems []string - - for _, metric := range extraMetrics { - if err := validateMetricName(metadata, metric); err != nil { - return nil, err - } - - // If the user specified a metric that's already included no need to add it. - if !metadata.DefaultMetrics[metric] { - filterItems = append(filterItems, metric) - } - } - - for _, group := range extraGroups { - metrics, err := validateGroup(metadata, group) - if err != nil { - return nil, err - } - filterItems = append(filterItems, metrics...) - } - - basicFilter, err := filter.NewBasicStringFilter(filterItems) - if err != nil { - return nil, fmt.Errorf("unable to construct filter with items %s: %s", filterItems, err) - } - - effectiveMetrics := map[string]bool{} - - // Precompute set of metrics that matches the filter. This isn't a complete - // set of metrics that are enabled in the case of metrics that aren't included - // in metadata. But it provides a fast path for known metrics. - for metric := range metadata.Metrics { - if basicFilter.Matches(metric) { - effectiveMetrics[metric] = true - } - } - - return &extraMetricsFilter{metadata, effectiveMetrics, basicFilter}, nil -} - -func (mf *extraMetricsFilter) Matches(dp *datapoint.Datapoint) bool { - if len(mf.metadata.Metrics) == 0 { - // This monitor has no defined metrics so send everything by default. - return true - } - - if !mf.metadata.HasMetric(dp.Metric) && mf.metadata.SendUnknown { - // This metric is unknown to the metadata and the monitor has requested - // to send all unknown metrics. - return true - } - - if mf.metadata.HasDefaultMetric(dp.Metric) { - // It's an included metric so send by default. - return true - } - - if mf.extraMetrics[dp.Metric] { - // User has explicitly chosen to send this metric (or a group that this metric belongs to). - return true - } - - // Lastly check if it matches filter. If it's a known metric from metadata will get matched - // above so this is a last check for unknown metrics. - return mf.stringFilter.Matches(dp.Metric) -} diff --git a/internal/signalfx-agent/pkg/monitors/filtering_test.go b/internal/signalfx-agent/pkg/monitors/filtering_test.go deleted file mode 100644 index 8df09061a9..0000000000 --- a/internal/signalfx-agent/pkg/monitors/filtering_test.go +++ /dev/null @@ -1,182 +0,0 @@ -package monitors - -import ( - "fmt" - "testing" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -func testMetadata(sendUnknown bool) *Metadata { - return &Metadata{ - MonitorType: "test-monitor", - DefaultMetrics: utils.StringSet("cpu.idle", "cpu.min", "cpu.max", "mem.used"), - Metrics: map[string]MetricInfo{ - "cpu.idle": {Type: datapoint.Gauge}, - "cpu.min": {Type: datapoint.Gauge}, - "cpu.max": {Type: datapoint.Gauge}, - "mem.used": {Type: datapoint.Counter}, - "mem.free": {Type: datapoint.Counter}, - "mem.available": {Type: datapoint.Counter}}, - SendUnknown: sendUnknown, - Groups: utils.StringSet("cpu", "mem"), - GroupMetricsMap: map[string][]string{ - // All cpu metrics are included. - "cpu": {"cpu.idle", "cpu.min", "cpu.max"}, - // Only some mem metrics are included. - "mem": {"mem.used", "mem.free", "mem.available"}, - }, - SendAll: false, - } -} - -var exhaustiveMetadata = testMetadata(false) -var nonexhaustiveMetadata = testMetadata(true) - -func TestDefaultMetrics(t *testing.T) { - if filter, err := newMetricsFilter(exhaustiveMetadata, nil, nil); err != nil { - t.Error(err) - } else { - // All included metrics should be sent. - for metric := range exhaustiveMetadata.DefaultMetrics { - localMetric := metric - t.Run(fmt.Sprintf("included metric %s should send", metric), func(t *testing.T) { - dp := &datapoint.Datapoint{ - Metric: localMetric, - MetricType: datapoint.Counter, - } - if !filter.Matches(dp) { - t.Error() - } - }) - } - } -} - -func TestExtraMetrics(t *testing.T) { - t.Run("user specifies already-included metric", func(t *testing.T) { - if filter, err := newMetricsFilter(exhaustiveMetadata, []string{"cpu.idle"}, nil); err != nil { - t.Error(err) - } else if filter.extraMetrics["cpu.idle"] { - t.Error("cpu.idle should not have been in additional metrics because it is already included") - } - }) - - // Exhaustive - if filter, err := newMetricsFilter(exhaustiveMetadata, []string{"mem.used"}, nil); err != nil { - t.Error(err) - } else { - for metric, shouldSend := range map[string]bool{ - "mem.used": true, - "mem.free": false, - "mem.available": false, - } { - dp := &datapoint.Datapoint{Metric: metric, MetricType: datapoint.Counter} - sent := filter.Matches(dp) - if sent && !shouldSend { - t.Errorf("metric %s should not have sent", metric) - } - if !sent && shouldSend { - t.Errorf("metric %s should have been sent", metric) - } - } - } - - // Non-exhaustive - if filter, err := newMetricsFilter(nonexhaustiveMetadata, []string{"dynamic-metric", "some-*"}, nil); err != nil { - t.Error(err) - } else { - for metric, shouldSend := range map[string]bool{ - "dynamic-metric": true, - "some-globbed-metric": true, - "unconfigured-and-unknown-metric": true, - "mem.used": true, - "mem.free": false, - } { - dp := &datapoint.Datapoint{Metric: metric, MetricType: datapoint.Counter} - sent := filter.Matches(dp) - if sent && !shouldSend { - t.Errorf("metric %s should not have sent", metric) - } - if !sent && shouldSend { - t.Errorf("metric %s should have been sent", metric) - } - } - } -} - -func TestGlobbedMetricNames(t *testing.T) { - if filter, err := newMetricsFilter(exhaustiveMetadata, []string{"mem.*"}, nil); err != nil { - t.Error(err) - } else { - // All memory metrics should be sent. - metrics := exhaustiveMetadata.GroupMetricsMap["mem"] - if len(metrics) < 1 { - t.Fatal("should be checking 1 or more metrics") - } - - for _, metric := range metrics { - dp := &datapoint.Datapoint{ - Metric: metric, - MetricType: datapoint.Counter, - } - if !filter.Matches(dp) { - t.Errorf("metric %s should have been sent", metric) - } - } - } -} - -func TestExtraMetricGroups(t *testing.T) { - if filter, err := newMetricsFilter(exhaustiveMetadata, nil, []string{"mem"}); err != nil { - t.Error(err) - } else { - for _, metric := range exhaustiveMetadata.GroupMetricsMap["mem"] { - dp := &datapoint.Datapoint{Metric: metric, MetricType: datapoint.Counter} - - if !filter.Matches(dp) { - t.Errorf("metric %s should have been sent", metric) - } - } - } -} - -func Test_newExtraMetricsFilter(t *testing.T) { - type args struct { - metadata *Metadata - extraMetrics []string - extraGroups []string - } - tests := []struct { - name string - args args - wantErr bool - }{ - // Error cases. - {"metricName is whitespace", args{exhaustiveMetadata, []string{" "}, nil}, true}, - {"groupName is whitespace", args{exhaustiveMetadata, nil, []string{" "}}, true}, - {"metricName is whitespace", args{nonexhaustiveMetadata, []string{" "}, nil}, true}, - {"groupName is whitespace", args{nonexhaustiveMetadata, nil, []string{" "}}, true}, - - // Successful cases. - {"unknown group name", args{exhaustiveMetadata, nil, []string{"unknown-group"}}, false}, - {"no group name or metric name", args{exhaustiveMetadata, nil, nil}, false}, - {"valid group name and unknown metric name", args{exhaustiveMetadata, []string{"unknown-metric"}, - []string{"cpu"}}, false}, - {"unknown metric name", args{exhaustiveMetadata, []string{"unknown-metric"}, nil}, false}, - {"metric glob doesn't match any metric", args{exhaustiveMetadata, []string{"unknown-metric.*"}, nil}, false}, - {"metric does not exist", args{nonexhaustiveMetadata, []string{"unknown-metric"}, nil}, false}, - } - for _, test := range tests { - tt := test - - t.Run(tt.name, func(t *testing.T) { - _, err := newMetricsFilter(tt.args.metadata, tt.args.extraMetrics, tt.args.extraGroups) - if (err != nil) != tt.wantErr { - t.Errorf("newMetricsFilter() error = %v, wantErr %v", err, tt.wantErr) - return - } - }) - } -} diff --git a/internal/signalfx-agent/pkg/monitors/help.go b/internal/signalfx-agent/pkg/monitors/help.go deleted file mode 100644 index 99fa30ad96..0000000000 --- a/internal/signalfx-agent/pkg/monitors/help.go +++ /dev/null @@ -1 +0,0 @@ -package monitors diff --git a/internal/signalfx-agent/pkg/monitors/helpers_test.go b/internal/signalfx-agent/pkg/monitors/helpers_test.go index be44bfbc73..e95d506d34 100644 --- a/internal/signalfx-agent/pkg/monitors/helpers_test.go +++ b/internal/signalfx-agent/pkg/monitors/helpers_test.go @@ -120,13 +120,3 @@ func RegisterFakeMonitors() func() map[types.MonitorID]MockMonitor { return instances } } - -func findMonitorsByType(monitors map[types.MonitorID]MockMonitor, _type string) []MockMonitor { - mons := []MockMonitor{} - for _, m := range monitors { - if m.Type() == _type { - mons = append(mons, m) - } - } - return mons -} diff --git a/internal/signalfx-agent/pkg/monitors/manager.go b/internal/signalfx-agent/pkg/monitors/manager.go deleted file mode 100644 index e3bcef3796..0000000000 --- a/internal/signalfx-agent/pkg/monitors/manager.go +++ /dev/null @@ -1,503 +0,0 @@ -package monitors - -import ( - "fmt" - "sync" - - "github.com/davecgh/go-spew/spew" - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/event" - "github.com/signalfx/golib/v3/trace" - log "github.com/sirupsen/logrus" - - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/meta" - "github.com/signalfx/signalfx-agent/pkg/core/services" - "github.com/signalfx/signalfx-agent/pkg/monitors/collectd" - "github.com/signalfx/signalfx-agent/pkg/monitors/types" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -// MonitorManager coordinates the startup and shutdown of monitors based on the -// configuration provided by the user. Monitors that have discovery rules can -// be injected with multiple services. If a monitor does not have a discovery -// rule (a "static" monitor), it will be started immediately (as soon as -// Configure is called). -type MonitorManager struct { - monitorConfigs map[uint64]config.MonitorCustomConfig - // Keep track of which services go with which monitor - activeMonitors []*ActiveMonitor - badConfigs map[uint64]*config.MonitorConfig - lock sync.Mutex - // Map of service endpoints that have been discovered - discoveredEndpoints map[services.ID]services.Endpoint - - collectdConfig *config.CollectdConfig - collectdConfigured bool - - DPs chan<- []*datapoint.Datapoint - Events chan<- *event.Event - DimensionUpdates chan<- *types.Dimension - TraceSpans chan<- []*trace.Span - - // TODO: AgentMeta is rather hacky so figure out a better way to share agent - // metadata with monitors - agentMeta *meta.AgentMeta - intervalSeconds int - - idGenerator func() string -} - -// NewMonitorManager creates a new instance of the MonitorManager -func NewMonitorManager(agentMeta *meta.AgentMeta) *MonitorManager { - return &MonitorManager{ - monitorConfigs: make(map[uint64]config.MonitorCustomConfig), - activeMonitors: make([]*ActiveMonitor, 0), - badConfigs: make(map[uint64]*config.MonitorConfig), - discoveredEndpoints: make(map[services.ID]services.Endpoint), - idGenerator: utils.NewIDGenerator(), - agentMeta: agentMeta, - } -} - -// Configure receives a list of monitor configurations. It will start up any -// static monitors and watch discovered services to see if any match dynamic -// monitors. -func (mm *MonitorManager) Configure(confs []config.MonitorConfig, collectdConf *config.CollectdConfig, intervalSeconds int) { - mm.lock.Lock() - defer mm.lock.Unlock() - - mm.intervalSeconds = intervalSeconds - for i := range confs { - confs[i].IntervalSeconds = utils.FirstNonZero(confs[i].IntervalSeconds, intervalSeconds) - } - - requireSoloTrue := anyMarkedSolo(confs) - - newConfig, deletedHashes := diffNewConfig(confs, mm.allConfigHashes()) - mm.collectdConfig = collectdConf - - if !collectdConf.DisableCollectd { - // By configuring collectd with the monitor manager, we absolve the monitor - // instances of having to know about collectd config, which makes it easier - // to create monitor config from disparate sources such as from observers. - if err := collectd.ConfigureMainCollectd(collectdConf); err != nil { - log.WithFields(log.Fields{ - "error": err, - "collectdConfig": spew.Sdump(collectdConf), - }).Error("Could not configure collectd") - } - mm.collectdConfigured = true - } - - for _, hash := range deletedHashes { - mm.deleteMonitorsByConfigHash(hash) - - delete(mm.monitorConfigs, hash) - delete(mm.badConfigs, hash) - } - - for i := range newConfig { - conf := newConfig[i] - hash := conf.Hash() - - if requireSoloTrue && !conf.Solo { - log.Infof("Solo mode is active, skipping monitor of type %s", conf.Type) - continue - } - - monConfig, err := mm.handleNewConfig(&conf) - if err != nil { - log.WithFields(log.Fields{ - "monitorType": conf.Type, - "error": err, - }).Error("Could not process configuration for monitor") - conf.ValidationError = err.Error() - mm.badConfigs[hash] = &conf - continue - } - - mm.monitorConfigs[hash] = monConfig - } -} - -func (mm *MonitorManager) allConfigHashes() map[uint64]bool { - hashes := make(map[uint64]bool) - for h := range mm.monitorConfigs { - hashes[h] = true - } - for h := range mm.badConfigs { - hashes[h] = true - } - return hashes -} - -// Returns the any new configs and any removed config hashes -func diffNewConfig(confs []config.MonitorConfig, oldHashes map[uint64]bool) ([]config.MonitorConfig, []uint64) { - newConfigHashes := make(map[uint64]bool) - var newConfig []config.MonitorConfig - for i := range confs { - hash := confs[i].Hash() - if !oldHashes[hash] { - newConfig = append(newConfig, confs[i]) - } - - if newConfigHashes[hash] { - log.WithFields(log.Fields{ - "monitorType": confs[i].Type, - "config": confs[i], - }).Error("Monitor config is duplicated") - continue - } - - newConfigHashes[hash] = true - } - - var deletedHashes []uint64 - for hash := range oldHashes { - // If we didn't see it in the latest config slice then we need to - // delete anything using it. - if !newConfigHashes[hash] { - deletedHashes = append(deletedHashes, hash) - } - } - - return newConfig, deletedHashes -} - -func (mm *MonitorManager) handleNewConfig(conf *config.MonitorConfig) (config.MonitorCustomConfig, error) { - monConfig, err := getCustomConfigForMonitor(conf) - if err != nil { - return nil, err - } - - if configOnlyAllowsSingleInstance(monConfig) { - if len(mm.monitorConfigsForType(conf.Type)) > 0 { - return nil, fmt.Errorf("monitor type %s only allows a single instance at a time", conf.Type) - } - } - - // No discovery rule means that the monitor should run from the start - if conf.DiscoveryRule == "" { - return monConfig, mm.createAndConfigureNewMonitor(monConfig, nil) - } - - mm.makeMonitorsForMatchingEndpoints(monConfig) - // We need to go and see if any discovered endpoints should be - // monitored by this config, if they aren't already. - return monConfig, nil -} - -func (mm *MonitorManager) makeMonitorsForMatchingEndpoints(conf config.MonitorCustomConfig) { - for id, endpoint := range mm.discoveredEndpoints { - // Self configured endpoints are monitored immediately upon being - // created and never need to be matched against discovery rules. - if endpoint.Core().IsSelfConfigured() { - continue - } - - log.WithFields(log.Fields{ - "monitorType": conf.MonitorConfigCore().Type, - "discoveryRule": conf.MonitorConfigCore().DiscoveryRule, - "endpoint": endpoint, - }).Debug("Trying to find config that matches discovered endpoint") - - if mm.isEndpointIDMonitoredByConfig(conf, id) { - log.Debug("The endpoint is already monitored") - continue - } - - if matched, err := mm.monitorEndpointIfRuleMatches(conf, endpoint); matched { - if err != nil { - log.WithFields(log.Fields{ - "error": err, - "endpointID": endpoint.Core().ID, - "monitorType": conf.MonitorConfigCore().Type, - }).Error("Error monitoring endpoint that matched rule") - } else { - log.WithFields(log.Fields{ - "endpointID": endpoint.Core().ID, - "monitorType": conf.MonitorConfigCore().Type, - }).Info("Now monitoring discovered endpoint") - } - } else { - log.Debug("The monitor did not match") - } - } -} - -func (mm *MonitorManager) isEndpointIDMonitoredByConfig(conf config.MonitorCustomConfig, id services.ID) bool { - for _, am := range mm.activeMonitors { - if conf.MonitorConfigCore().Hash() == am.configHash { - if am.endpointID() == id { - return true - } - } - } - return false -} - -// Returns true is the service did match a rule in this monitor config -func (mm *MonitorManager) monitorEndpointIfRuleMatches(config config.MonitorCustomConfig, endpoint services.Endpoint) (bool, error) { - if config.MonitorConfigCore().DiscoveryRule == "" || !services.DoesServiceMatchRule(endpoint, config.MonitorConfigCore().DiscoveryRule, config.MonitorConfigCore().ShouldValidateDiscoveryRule()) { - return false, nil - } - - err := mm.createAndConfigureNewMonitor(config, endpoint) - if err != nil { - return true, err - } - - return true, nil -} - -// EndpointAdded should be called when a new service is discovered -func (mm *MonitorManager) EndpointAdded(endpoint services.Endpoint) { - mm.lock.Lock() - defer mm.lock.Unlock() - - ensureProxyingDisabledForService(endpoint) - mm.discoveredEndpoints[endpoint.Core().ID] = endpoint - - // If the endpoint has a monitor type specified, then it is expected to - // have all of its configuration already set in the endpoint and discovery - // rules will be ignored. - if endpoint.Core().IsSelfConfigured() { - if err := mm.monitorSelfConfiguredEndpoint(endpoint); err != nil { - log.WithFields(log.Fields{ - "error": err, - "monitorType": endpoint.Core().MonitorType, - "endpoint": endpoint, - }).Error("Could not create monitor for self-configured endpoint") - } - return - } - - mm.findConfigForMonitorAndRun(endpoint) -} - -func (mm *MonitorManager) monitorSelfConfiguredEndpoint(endpoint services.Endpoint) error { - monitorType := endpoint.Core().MonitorType - conf := &config.MonitorConfig{ - Type: monitorType, - // This will get overridden by the endpoint configuration if interval - // was specified - IntervalSeconds: mm.intervalSeconds, - } - - monConfig, err := getCustomConfigForMonitor(conf) - if err != nil { - return err - } - - if err = mm.createAndConfigureNewMonitor(monConfig, endpoint); err != nil { - return err - } - return nil -} - -func (mm *MonitorManager) findConfigForMonitorAndRun(endpoint services.Endpoint) { - monitoring := false - - for _, config := range mm.monitorConfigs { - matched, err := mm.monitorEndpointIfRuleMatches(config, endpoint) - monitoring = matched || monitoring - if err != nil { - log.WithFields(log.Fields{ - "error": err, - "config": config, - "endpoint": endpoint, - }).Error("Could not monitor new endpoint") - } - } - - if !monitoring { - log.WithFields(log.Fields{ - "endpoint": endpoint, - }).Debug("Endpoint added that doesn't match any discovery rules") - } -} - -// endpoint may be nil for static monitors -func (mm *MonitorManager) createAndConfigureNewMonitor(config config.MonitorCustomConfig, endpoint services.Endpoint) error { - id := types.MonitorID(mm.idGenerator()) - coreConfig := config.MonitorConfigCore() - monitorType := coreConfig.Type - - // This accounts for the possibility that collectd was marked as disabled - // when the agent was first started but later an self-configured endpoint - // that depends on collectd is discovered. - if coreConfig.IsCollectdBased() && !mm.collectdConfigured { - if err := collectd.ConfigureMainCollectd(mm.collectdConfig); err != nil { - log.WithFields(log.Fields{ - "error": err, - "collectdConfig": spew.Sdump(mm.collectdConfig), - }).Error("Could not configure collectd") - } - mm.collectdConfigured = true - } - - log.WithFields(log.Fields{ - "monitorType": monitorType, - "discoveryRule": coreConfig.DiscoveryRule, - "monitorID": id, - }).Info("Creating new monitor") - - instance := newMonitor(config.MonitorConfigCore().Type) - if instance == nil { - return fmt.Errorf("Could not create new monitor of type %s", monitorType) - } - - // Make metadata nil if we aren't using built in filtering and then none of - // the new filtering logic will apply. - metadata, ok := MonitorMetadatas[monitorType] - if !ok || metadata == nil { - // This indicates a programming error in not specifying metadata, not - // bad user input - panic(fmt.Sprintf("could not find monitor metadata of type %s", monitorType)) - } - - configHash := config.MonitorConfigCore().Hash() - - renderedConf, err := renderConfig(config, endpoint) - if err != nil { - return err - } - - monFiltering, err := newMonitorFiltering(renderedConf, metadata) - if err != nil { - return err - } - - am := &ActiveMonitor{ - id: id, - configHash: configHash, - instance: instance, - endpoint: endpoint, - agentMeta: mm.agentMeta, - } - - metricNameTransformations, err := renderedConf.MonitorConfigCore().MetricNameExprs() - if err != nil { - return err - } - - output := &monitorOutput{ - monitorType: renderedConf.MonitorConfigCore().Type, - monitorID: id, - notHostSpecific: renderedConf.MonitorConfigCore().DisableHostDimensions, - disableEndpointDimensions: renderedConf.MonitorConfigCore().DisableEndpointDimensions, - configHash: configHash, - endpoint: endpoint, - dpChan: mm.DPs, - eventChan: mm.Events, - dimensionChan: mm.DimensionUpdates, - spanChan: mm.TraceSpans, - extraDims: map[string]string{}, - extraSpanTags: map[string]string{}, - defaultSpanTags: map[string]string{}, - dimensionTransformations: renderedConf.MonitorConfigCore().DimensionTransformations, - metricNameTransformations: metricNameTransformations, - monitorFiltering: monFiltering, - } - - am.output = output - - if err := am.configureMonitor(renderedConf); err != nil { - return err - } - mm.activeMonitors = append(mm.activeMonitors, am) - - return nil -} - -func (mm *MonitorManager) monitorsForEndpointID(id services.ID) (out []*ActiveMonitor) { - for i := range mm.activeMonitors { - if mm.activeMonitors[i].endpointID() == id { - out = append(out, mm.activeMonitors[i]) - } - } - return // Named return value -} - -func (mm *MonitorManager) monitorConfigsForType(monitorType string) []*config.MonitorCustomConfig { - var out []*config.MonitorCustomConfig - for i := range mm.monitorConfigs { - conf := mm.monitorConfigs[i] - if conf.MonitorConfigCore().Type == monitorType { - out = append(out, &conf) - } - } - return out -} - -// EndpointRemoved should be called by observers when a service endpoint was -// removed. -func (mm *MonitorManager) EndpointRemoved(endpoint services.Endpoint) { - mm.lock.Lock() - defer mm.lock.Unlock() - - delete(mm.discoveredEndpoints, endpoint.Core().ID) - - monitors := mm.monitorsForEndpointID(endpoint.Core().ID) - for _, am := range monitors { - am.doomed = true - } - mm.deleteDoomedMonitors() - - log.WithFields(log.Fields{ - "endpoint": endpoint, - }).Debug("No longer considering endpoint") -} - -func (mm *MonitorManager) isEndpointMonitored(endpoint services.Endpoint) bool { - monitors := mm.monitorsForEndpointID(endpoint.Core().ID) - return len(monitors) > 0 -} - -func (mm *MonitorManager) deleteMonitorsByConfigHash(hash uint64) { - for i := range mm.activeMonitors { - if mm.activeMonitors[i].configHash == hash { - log.WithFields(log.Fields{ - "config": mm.activeMonitors[i].config, - }).Info("Shutting down monitor due to config hash change") - mm.activeMonitors[i].doomed = true - } - } - mm.deleteDoomedMonitors() -} - -func (mm *MonitorManager) deleteDoomedMonitors() { - newActiveMonitors := []*ActiveMonitor{} - - for i := range mm.activeMonitors { - am := mm.activeMonitors[i] - if am.doomed { - log.WithFields(log.Fields{ - "monitorID": am.id, - "monitorType": am.config.MonitorConfigCore().Type, - "discoveryRule": am.config.MonitorConfigCore().DiscoveryRule, - }).Info("Shutting down monitor") - - am.Shutdown() - } else { - newActiveMonitors = append(newActiveMonitors, am) - } - } - - mm.activeMonitors = newActiveMonitors -} - -// Shutdown will shutdown all managed monitors and deinitialize the manager. -func (mm *MonitorManager) Shutdown() { - mm.lock.Lock() - defer mm.lock.Unlock() - - for i := range mm.activeMonitors { - mm.activeMonitors[i].doomed = true - } - mm.deleteDoomedMonitors() - - mm.activeMonitors = nil - mm.discoveredEndpoints = nil -} diff --git a/internal/signalfx-agent/pkg/monitors/manager_test.go b/internal/signalfx-agent/pkg/monitors/manager_test.go deleted file mode 100644 index c9ebc40591..0000000000 --- a/internal/signalfx-agent/pkg/monitors/manager_test.go +++ /dev/null @@ -1,500 +0,0 @@ -package monitors - -import ( - "strconv" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - log "github.com/sirupsen/logrus" - - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/meta" - "github.com/signalfx/signalfx-agent/pkg/core/services" - "github.com/signalfx/signalfx-agent/pkg/monitors/types" -) - -// Used to make unique service ids -// nolint: gochecknoglobals -var serviceID = 0 - -// nolint: unparam -func newService(imageName string, publicPort int) services.Endpoint { - serviceID++ - - endpoint := services.NewEndpointCore(strconv.Itoa(serviceID), "", "test", nil) - endpoint.Host = "example.com" - endpoint.Port = uint16(publicPort) - - return &services.ContainerEndpoint{ - EndpointCore: *endpoint, - AltPort: 0, - Container: services.Container{Image: imageName}, - Orchestration: services.Orchestration{}, - } -} - -var _ = Describe("Monitor Manager", func() { - var manager *MonitorManager - var getMonitors func() map[types.MonitorID]MockMonitor - - BeforeEach(func() { - DeregisterAll() - - getMonitors = RegisterFakeMonitors() - - manager = NewMonitorManager(&meta.AgentMeta{}) - }) - - It("Starts up static monitors immediately", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - Expect(len(getMonitors())).To(Equal(1)) - for _, mon := range getMonitors() { - Expect(mon.Type()).To(Equal("static1")) - } - }) - - It("Shuts down static monitors when removed from config", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - Expect(len(getMonitors())).To(Equal(1)) - - manager.Configure([]config.MonitorConfig{ - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - Expect(len(getMonitors())).To(Equal(0)) - }) - - It("Starts up dynamic monitors upon service discovery", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - Expect(len(getMonitors())).To(Equal(1)) - - manager.EndpointAdded(newService("my-service", 5000)) - - Expect(len(getMonitors())).To(Equal(2)) - - mons := findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - }) - - It("Shuts down dynamic monitors upon service removed", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - service := newService("my-service", 5000) - manager.EndpointAdded(service) - - mons := findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - - shutdownCallCount := 0 - for i := range mons { - mons[i].AddShutdownHook(func() { - shutdownCallCount++ - }) - } - - manager.EndpointRemoved(service) - - mons = findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(0)) - Expect(shutdownCallCount).To(Equal(1)) - }) - - It("Starts and stops multiple monitors for multiple endpoints of same monitor type", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - service := newService("my-service", 5000) - service2 := newService("my-service", 5001) - manager.EndpointAdded(service) - manager.EndpointAdded(service2) - - mons := findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(2)) - - shutdownCallCount := 0 - for i := range mons { - mons[i].AddShutdownHook(func() { - shutdownCallCount++ - }) - } - - manager.EndpointRemoved(service) - - mons = findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - Expect(shutdownCallCount).To(Equal(1)) - - manager.EndpointRemoved(service2) - - mons = findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(0)) - Expect(shutdownCallCount).To(Equal(2)) - }) - - It("Re-monitors service if monitor is removed temporarily", func() { - log.SetLevel(log.DebugLevel) - goodConfig := []config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - } - manager.Configure(goodConfig, &config.CollectdConfig{}, 10) - - manager.EndpointAdded(newService("my-service", 5000)) - - mons := findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - OtherConfig: map[string]interface{}{"invalid": true}, - }, - }, &config.CollectdConfig{}, 10) - - mons = findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(0)) - - manager.Configure(goodConfig, &config.CollectdConfig{}, 10) - - mons = findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - }) - - It("Starts monitoring previously discovered service if new monitor config matches", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "their-service"`, - }, - }, &config.CollectdConfig{}, 10) - - manager.EndpointAdded(newService("my-service", 5000)) - - mons := findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(0)) - - manager.Configure([]config.MonitorConfig{ - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - mons = findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - }) - - It("Stops monitoring service if new monitor config no longer matches", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - manager.EndpointAdded(newService("my-service", 5000)) - - mons := findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - - manager.Configure([]config.MonitorConfig{ - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "their-service"`, - }, - }, &config.CollectdConfig{}, 10) - - mons = findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(0)) - }) - - It("Monitors the same service on multiple monitors", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - manager.EndpointAdded(newService("my-service", 5000)) - - mons := findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - { - Type: "dynamic2", - DiscoveryRule: `container_image =~ "my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - mons = findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - - mons = findMonitorsByType(getMonitors(), "dynamic2") - Expect(len(mons)).To(Equal(1)) - - // Test restarting and making sure it sticks - manager.Configure([]config.MonitorConfig{ - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - { - Type: "dynamic2", - DiscoveryRule: `container_image =~ "my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - mons = findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - - mons = findMonitorsByType(getMonitors(), "dynamic2") - Expect(len(mons)).To(Equal(1)) - }) - - It("Validates required fields", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic2", - OtherConfig: map[string]interface{}{ - "host": "example.com", - // Port is missing but required - }, - }, - }, &config.CollectdConfig{}, 10) - - mons := findMonitorsByType(getMonitors(), "dynamic2") - Expect(len(mons)).To(Equal(0)) - - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic2", - OtherConfig: map[string]interface{}{ - "host": "example.com", - "port": 80, - }, - }, - }, &config.CollectdConfig{}, 10) - - mons = findMonitorsByType(getMonitors(), "dynamic2") - Expect(len(mons)).To(Equal(1)) - }) - - It("Monitors self-configured endpoints", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - }, &config.CollectdConfig{}, 10) - - endpoint := newService("my-service", 5000) - endpoint.Core().MonitorType = "dynamic1" - endpoint.Core().Configuration = map[string]interface{}{ - "myVar": "testing", - } - - manager.EndpointAdded(endpoint) - - mons := findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - Expect(mons[0].MyVar()).To(Equal("testing")) - }) - - It("Merges self-configured endpoint config with agent config", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "dynamic1", - DiscoveryRule: `port == 5000 && container_image =~ "my-service"`, - OtherConfig: map[string]interface{}{ - "password": "s3cr3t", - }, - }, - }, &config.CollectdConfig{}, 10) - - endpoint := newService("my-service", 5000) - endpoint.Core().Configuration = map[string]interface{}{ - "myVar": "testing", - } - - manager.EndpointAdded(endpoint) - - mons := findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - Expect(mons[0].MyVar()).To(Equal("testing")) - Expect(mons[0].Password()).To(Equal("s3cr3t")) - }) - - It("Does not double monitor self-configured endpoint", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - }, &config.CollectdConfig{}, 10) - - endpoint := newService("my-service", 5000) - endpoint.Core().MonitorType = "dynamic1" - endpoint.Core().Configuration = map[string]interface{}{ - "myVar": "testing", - } - - manager.EndpointAdded(endpoint) - - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic1", - DiscoveryRule: `container_image =~ "my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - mons := findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - Expect(mons[0].MyVar()).To(Equal("testing")) - - manager.EndpointRemoved(endpoint) - - endpoint.Core().MonitorType = "" - manager.EndpointAdded(endpoint) - - mons = findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - }) - - It("Does not stop monitoring self-configured endpoint on reconfig", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - }, &config.CollectdConfig{}, 10) - - endpoint := newService("my-service", 5000) - endpoint.Core().MonitorType = "dynamic1" - endpoint.Core().Configuration = map[string]interface{}{ - "myVar": "testing", - } - - manager.EndpointAdded(endpoint) - - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - { - Type: "dynamic2", - DiscoveryRule: `container_image =~ "not-my-service"`, - }, - }, &config.CollectdConfig{}, 10) - - mons := findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - Expect(mons[0].MyVar()).To(Equal("testing")) - }) - - It("Stops monitoring self-configured endpoint when removed", func() { - manager.Configure([]config.MonitorConfig{ - { - Type: "static1", - }, - }, &config.CollectdConfig{}, 10) - - endpoint := newService("my-service", 5000) - endpoint.Core().MonitorType = "dynamic1" - endpoint.Core().Configuration = map[string]interface{}{ - "myVar": "testing", - } - - manager.EndpointAdded(endpoint) - - staticMons := findMonitorsByType(getMonitors(), "static1") - Expect(len(staticMons)).To(Equal(1)) - mons := findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(1)) - - manager.EndpointRemoved(endpoint) - - staticMons = findMonitorsByType(getMonitors(), "static1") - Expect(len(staticMons)).To(Equal(1)) - - mons = findMonitorsByType(getMonitors(), "dynamic1") - Expect(len(mons)).To(Equal(0)) - }) -}) - -func TestMonitors(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Monitor Suite") -} diff --git a/internal/signalfx-agent/pkg/monitors/monitor.go b/internal/signalfx-agent/pkg/monitors/monitor.go index 7d7f952dbc..cc9a121906 100644 --- a/internal/signalfx-agent/pkg/monitors/monitor.go +++ b/internal/signalfx-agent/pkg/monitors/monitor.go @@ -1,15 +1,9 @@ package monitors import ( - "fmt" - "reflect" - "github.com/signalfx/golib/v3/datapoint" - log "github.com/sirupsen/logrus" - "github.com/signalfx/signalfx-agent/pkg/core/config" "github.com/signalfx/signalfx-agent/pkg/core/services" - "github.com/signalfx/signalfx-agent/pkg/utils" ) // MonitorFactory is a niladic function that creates an unconfigured instance @@ -93,45 +87,6 @@ func Register(metadata *Metadata, factory MonitorFactory, configTemplate config. MonitorMetadatas[metadata.MonitorType] = metadata } -// DeregisterAll unregisters all monitor types. Primarily intended for testing -// purposes. -func DeregisterAll() { - for k := range MonitorFactories { - delete(MonitorFactories, k) - } - - for k := range ConfigTemplates { - delete(ConfigTemplates, k) - } -} - -func newUninitializedMonitor(_type string) interface{} { - if factory, ok := MonitorFactories[_type]; ok { - return factory() - } - - log.WithFields(log.Fields{ - "monitorType": _type, - }).Error("Monitor type not supported") - return nil -} - -// Creates a new, unconfigured instance of a monitor of _type. Returns nil if -// the monitor type is not registered. -func newMonitor(_type string) interface{} { - mon := newUninitializedMonitor(_type) - if initMon, ok := mon.(Initializable); ok { - if err := initMon.Init(); err != nil { - log.WithFields(log.Fields{ - "error": err, - "monitorType": _type, - }).Error("Could not initialize monitor") - return nil - } - } - return mon -} - // Initializable represents a monitor that has a distinct InitMonitor method. // This should be called once after the monitor is created and before any of // its other methods are called. It is useful for things that are not @@ -145,39 +100,3 @@ type Initializable interface { type Shutdownable interface { Shutdown() } - -// Takes a generic MonitorConfig and pulls out monitor-specific config to -// populate a clone of the config template that was registered for the monitor -// type specified in conf. This will also validate the config and return nil -// if validation fails. -func getCustomConfigForMonitor(conf *config.MonitorConfig) (config.MonitorCustomConfig, error) { - confTemplate, ok := ConfigTemplates[conf.Type] - if !ok { - return nil, fmt.Errorf("unknown monitor type %s", conf.Type) - } - monConfig := utils.CloneInterface(confTemplate).(config.MonitorCustomConfig) - - if err := config.FillInConfigTemplate("MonitorConfig", monConfig, conf); err != nil { - return nil, err - } - - return monConfig, nil -} - -func anyMarkedSolo(confs []config.MonitorConfig) bool { - for i := range confs { - if confs[i].Solo { - return true - } - } - return false -} - -func configOnlyAllowsSingleInstance(monConfig config.MonitorCustomConfig) bool { - confVal := reflect.Indirect(reflect.ValueOf(monConfig)) - coreConfField, ok := confVal.Type().FieldByName("MonitorConfig") - if !ok { - return false - } - return coreConfField.Tag.Get("singleInstance") == "true" -} diff --git a/internal/signalfx-agent/pkg/monitors/output.go b/internal/signalfx-agent/pkg/monitors/output.go deleted file mode 100644 index 919144c2a0..0000000000 --- a/internal/signalfx-agent/pkg/monitors/output.go +++ /dev/null @@ -1,212 +0,0 @@ -package monitors - -import ( - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/event" - "github.com/signalfx/golib/v3/trace" - "github.com/signalfx/signalfx-agent/pkg/core/common/dpmeta" - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/services" - "github.com/signalfx/signalfx-agent/pkg/monitors/types" - "github.com/signalfx/signalfx-agent/pkg/utils" -) - -// The default implementation of Output -type monitorOutput struct { - *monitorFiltering - monitorType string - monitorID types.MonitorID - notHostSpecific bool - disableEndpointDimensions bool - configHash uint64 - endpoint services.Endpoint - dpChan chan<- []*datapoint.Datapoint - eventChan chan<- *event.Event - spanChan chan<- []*trace.Span - dimensionChan chan<- *types.Dimension - extraDims map[string]string - extraSpanTags map[string]string - defaultSpanTags map[string]string - dimensionTransformations map[string]string - metricNameTransformations []*config.RegexpWithReplace -} - -var _ types.Output = &monitorOutput{} - -// Copy the output so that you can attach a different set of dimensions to it. -func (mo *monitorOutput) Copy() types.Output { - o := *mo - o.extraDims = utils.CloneStringMap(mo.extraDims) - o.extraSpanTags = utils.CloneStringMap(mo.extraSpanTags) - o.defaultSpanTags = utils.CloneStringMap(mo.defaultSpanTags) - o.dimensionTransformations = utils.CloneStringMap(mo.dimensionTransformations) - o.filterSet = &(*mo.filterSet) - return &o -} - -func (mo *monitorOutput) SendDatapoints(dps ...*datapoint.Datapoint) { - // This is the filtering in place trick from https://github.com/golang/go/wiki/SliceTricks#filter-in-place - n := 0 - for i := range dps { - if mo.preprocessDP(dps[i]) { - dps[n] = dps[i] - n++ - } - } - - if n > 0 { - mo.dpChan <- dps[:n] - } -} - -func (mo *monitorOutput) preprocessDP(dp *datapoint.Datapoint) bool { - if dp.Meta == nil { - dp.Meta = map[interface{}]interface{}{} - } - - dp.Meta[dpmeta.MonitorIDMeta] = mo.monitorID - dp.Meta[dpmeta.MonitorTypeMeta] = mo.monitorType - dp.Meta[dpmeta.ConfigHashMeta] = mo.configHash - if mo.notHostSpecific { - dp.Meta[dpmeta.NotHostSpecificMeta] = true - } - - dp.Meta[dpmeta.EndpointMeta] = mo.endpoint - - var endpointDims map[string]string - if mo.endpoint != nil && !mo.disableEndpointDimensions { - endpointDims = mo.endpoint.Dimensions() - } - - dp.Dimensions = utils.MergeStringMaps(dp.Dimensions, mo.extraDims, endpointDims) - - // Defer filtering until here so we have the full dimension set to match - // on. - if mo.monitorFiltering.filterSet.Matches(dp) { - return false - } - - for i := range mo.metricNameTransformations { - reWithRepl := mo.metricNameTransformations[i] - re := reWithRepl.Regexp - repl := reWithRepl.Replacement - - // An optimization for simple regexps (i.e. ones with no special - // matching syntax) - if prefix, complete := re.LiteralPrefix(); complete && prefix == dp.Metric { - dp.Metric = repl - continue - } - dp.Metric = re.ReplaceAllString(dp.Metric, repl) - } - - for origName, newName := range mo.dimensionTransformations { - if v, ok := dp.Dimensions[origName]; ok { - // If the new name is not an empty string transform the dimension - if len(newName) > 0 { - dp.Dimensions[newName] = v - } - delete(dp.Dimensions, origName) - } - } - - return true -} - -func (mo *monitorOutput) SendEvent(event *event.Event) { - if mo.notHostSpecific { - if event.Properties == nil { - event.Properties = make(map[string]interface{}) - } - // Events don't have a non-serialized meta field, so just use - // properties and make sure to remove this in the writer. - event.Properties[dpmeta.NotHostSpecificMeta] = true - } - mo.eventChan <- event -} - -// Mutates span tags in place to add default span tags. Also -// returns tags in case they were nil to begin with, so the return value should -// be assigned back to the span tags field. -func (mo *monitorOutput) addDefaultSpanTags(tags map[string]string) map[string]string { - if tags == nil { - tags = make(map[string]string) - } - for name, value := range mo.defaultSpanTags { - // If the tags are already set, don't override - if _, ok := tags[name]; !ok { - tags[name] = value - } - } - return tags -} - -func (mo *monitorOutput) preprocessSpan(span *trace.Span) { - // addDefaultSpanTags adds default span tags if they do not - // already exist. This always returns a non-nil map - // saving the results to span.Tags ensures span Tags map - // will never be nil. - span.Tags = mo.addDefaultSpanTags(span.Tags) - - // add extra span tags - span.Tags = utils.MergeStringMaps(span.Tags, mo.extraSpanTags) - - if span.Meta == nil { - span.Meta = map[interface{}]interface{}{} - } - span.Meta[dpmeta.EndpointMeta] = mo.endpoint -} - -func (mo *monitorOutput) SendSpans(spans ...*trace.Span) { - for i := range spans { - mo.preprocessSpan(spans[i]) - } - - mo.spanChan <- spans -} - -func (mo *monitorOutput) SendDimensionUpdate(dimensions *types.Dimension) { - mo.dimensionChan <- dimensions -} - -// AddExtraDimension can be called by monitors *before* datapoints are flowing -// to add an extra dimension value to all datapoints coming out of this output. -// This method is not thread-safe! -func (mo *monitorOutput) AddExtraDimension(key, value string) { - mo.extraDims[key] = value -} - -// RemoveExtraDimension will remove any dimension added to this output, either -// from the original configuration or from the AddExtraDimensions method. -// This method is not thread-safe! -func (mo *monitorOutput) RemoveExtraDimension(key string) { - delete(mo.extraDims, key) -} - -// AddExtraSpanTag can be called by monitors *before* spans are flowing -// to add an extra tag value to all spans coming out of this output. -// This method is not thread-safe! -func (mo *monitorOutput) AddExtraSpanTag(key, value string) { - mo.extraSpanTags[key] = value -} - -// RemoveExtraSpanTag will remove any extra span tag added to this output, either -// from the original configuration or from the AddExtraSpanTag method. -// This method is not thread-safe! -func (mo *monitorOutput) RemoveExtraSpanTag(key string) { - delete(mo.extraSpanTags, key) -} - -// AddDefaultSpanTag can be called by monitors *before* spans are flowing -// to add a default tag to all spans coming out of this output. -// This method is not thread-safe! -func (mo *monitorOutput) AddDefaultSpanTag(key, value string) { - mo.defaultSpanTags[key] = value -} - -// RemoveDefaultSpanTag will remove any default span tag added to this output, either -// from the original configuration or from the AddDefaultSpanTag method. -// This method is not thread-safe! -func (mo *monitorOutput) RemoveDefaultSpanTag(key string) { - delete(mo.defaultSpanTags, key) -} diff --git a/internal/signalfx-agent/pkg/monitors/output_test.go b/internal/signalfx-agent/pkg/monitors/output_test.go deleted file mode 100644 index bcaab9f245..0000000000 --- a/internal/signalfx-agent/pkg/monitors/output_test.go +++ /dev/null @@ -1,245 +0,0 @@ -package monitors - -import ( - "regexp" - "testing" - "time" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/pointer" - "github.com/signalfx/golib/v3/trace" - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/utils" - "github.com/stretchr/testify/assert" -) - -func helperTestMonitorOuput() (*monitorOutput, error) { - config := &config.MonitorConfig{} - var metadata *Metadata - - monFiltering, err := newMonitorFiltering(config, metadata) - if err != nil { - return nil, err - } - - output := &monitorOutput{ - monitorType: "testMonitor", - monitorID: "testMonitor1", - monitorFiltering: monFiltering, - } - return output, nil -} - -func TestSendDatapoint(t *testing.T) { - // Setup our 'fixture' super basic monitorOutput - testMO, err := helperTestMonitorOuput() - assert.Nil(t, err) - - // And our Datapoint channel to receive Datapoints - dpChan := make(chan []*datapoint.Datapoint) - testMO.dpChan = dpChan - - // And our reference timestamp - dpTimestamp := time.Now() - - // Create a test Datapoint - testDp := datapoint.New("test.metric.name", nil, datapoint.NewIntValue(1), datapoint.Gauge, dpTimestamp) - - // Send the datapoint - go func() { testMO.SendDatapoints(testDp) }() - - // Receive the datapoint - resultDps := <-dpChan - - // Make sure it's come through as expected - assert.Equal(t, "test.metric.name", resultDps[0].Metric) - assert.Equal(t, map[string]string{}, resultDps[0].Dimensions) - assert.Equal(t, datapoint.NewIntValue(1), resultDps[0].Value) - assert.Equal(t, datapoint.Gauge, resultDps[0].MetricType) - assert.Equal(t, dpTimestamp, resultDps[0].Timestamp) - - // Let's add some extra dimensions to our monitorOutput - testMO.extraDims = map[string]string{"testDim1": "testValue1"} - - // Resend the datapoint - go func() { testMO.SendDatapoints(testDp) }() - - // Receive the datapoint - resultDps = <-dpChan - - // Make sure it's come through as expected - assert.Equal(t, map[string]string{"testDim1": "testValue1"}, resultDps[0].Dimensions) - - // Add some dimensions in the test Datapoint - go func() { - testDp.Dimensions = map[string]string{"testDim2": "testValue2"} - testMO.SendDatapoints(testDp) - }() - - // Receive the datapoint - resultDps = <-dpChan - - // Make sure it's come through as expected - assert.Equal(t, map[string]string{"testDim1": "testValue1", "testDim2": "testValue2"}, resultDps[0].Dimensions) - - t.Run("dimensionTransformations", func(t *testing.T) { - // Test using the dimension transformation - testMO.dimensionTransformations = map[string]string{"testDim2": "testDim3"} - - // Send the datapoint with a dimension that matches our transform - go func() { - testDp.Dimensions = map[string]string{"testDim2": "testValue2"} - testMO.SendDatapoints(testDp) - }() - - // Receive the datapoint - resultDps = <-dpChan - - // Make sure it's come through as expected - assert.Equal(t, map[string]string{"testDim1": "testValue1", "testDim3": "testValue2"}, resultDps[0].Dimensions) - - testMO.dimensionTransformations = map[string]string{"highCardDim": ""} - - // Send the datapoint with a matching dimension - go func() { - testDp.Dimensions = map[string]string{"highCardDim": "highCardValue"} - testMO.SendDatapoints(testDp) - }() - - // Receive the datapoint - resultDps = <-dpChan - - // Make sure it's come through as expected - assert.Equal(t, map[string]string{"testDim1": "testValue1"}, resultDps[0].Dimensions) - }) - - t.Run("metricNameTransformations", func(t *testing.T) { - testMO.metricNameTransformations = []*config.RegexpWithReplace{ - {Regexp: regexp.MustCompile("^cpu.cores$"), Replacement: "other.cores"}, - {Regexp: regexp.MustCompile(`^cpu\.(.*)$`), Replacement: "mycpu.$1"}, - // This is a more specific match after a less specific one that - // overlaps so it should have no effect. - {Regexp: regexp.MustCompile("^cpu.utilization$"), Replacement: "other.utilization"}, - } - - dp := utils.CloneDatapoint(testDp) - - cases := map[string]string{ - "cpu.utilization": "mycpu.utilization", - "cpu.cores": "other.cores", - "cpu.user": "mycpu.user", - "memory.total": "memory.total", - } - - for old, newName := range cases { - dp.Metric = old - - go testMO.SendDatapoints(dp) - outDP := (<-dpChan)[0] - - assert.Equal(t, newName, outDP.Metric) - } - }) -} - -func TestSendSpan(t *testing.T) { - // Setup our 'fixture' super basic monitorOutput - testMO, err := helperTestMonitorOuput() - assert.Nil(t, err) - - // And our Span channel to receive Spans - spanChan := make(chan []*trace.Span) - testMO.spanChan = spanChan - - // And our reference timestamp - spanTimestamp := time.Now() - - // Create a test Span - testSpan := &trace.Span{ - Name: pointer.String("testSpan"), - TraceID: "testTraceID", - ParentID: pointer.String("testParentID"), - Kind: pointer.String("CLIENT"), - Timestamp: pointer.Int64(spanTimestamp.UnixNano() / 1000), - Duration: pointer.Int64(1 + time.Since(spanTimestamp).Microseconds()), - LocalEndpoint: &trace.Endpoint{ - ServiceName: pointer.String("testService"), - }, - } - - // Send the span - go func() { testMO.SendSpans(testSpan) }() - - // Receive the span - resultSpans := <-spanChan - - // Make sure it's come through as expected - assert.NotEmpty(t, resultSpans) - assert.Equal(t, "testSpan", *resultSpans[0].Name) - assert.Equal(t, "testTraceID", resultSpans[0].TraceID) - assert.Equal(t, "testParentID", *resultSpans[0].ParentID) - assert.Equal(t, "CLIENT", *resultSpans[0].Kind) - assert.Equal(t, spanTimestamp.UnixNano()/1000, *resultSpans[0].Timestamp) - assert.True(t, *resultSpans[0].Duration > 0) - assert.Equal(t, "testService", *resultSpans[0].LocalEndpoint.ServiceName) - - // Let's add some default tags to our monitorOutput - testMO.defaultSpanTags = map[string]string{"defaultSpanTag": "testValue1"} - - // Resend the span - go func() { testMO.SendSpans(testSpan) }() - - // Receive the span - resultSpans = <-spanChan - - // Make sure it's come through as expected - assert.Equal(t, map[string]string{"defaultSpanTag": "testValue1"}, resultSpans[0].Tags) - - // Add some tags to the test Span - go func() { - testSpan.Tags = map[string]string{"testTag2": "testValue2"} - testMO.SendSpans(testSpan) - }() - - // Receive the span - resultSpans = <-spanChan - - // Make sure it's come through as expected - assert.Equal(t, map[string]string{"defaultSpanTag": "testValue1", "testTag2": "testValue2"}, resultSpans[0].Tags) - - // Add a tag that collides with defaultSpanTags - go func() { - testSpan.Tags["defaultSpanTag"] = "testValue3" - testMO.SendSpans(testSpan) - }() - - // Receive the span - resultSpans = <-spanChan - - // Make sure that defaultSpanTags does not overwrite the existing tag - assert.Equal(t, map[string]string{"defaultSpanTag": "testValue3", "testTag2": "testValue2"}, resultSpans[0].Tags) - - // Add extraSpanTags to our monitorOutput - testMO.extraSpanTags = map[string]string{"extraSpanTag": "testValue4"} - - // Resend the span - go func() { testMO.SendSpans(testSpan) }() - - // Receive the span - resultSpans = <-spanChan - - // Make sure the extra span tag was added - assert.Equal(t, map[string]string{"extraSpanTag": "testValue4", "defaultSpanTag": "testValue3", "testTag2": "testValue2"}, resultSpans[0].Tags) - - // Add a span tag that collides with the extraSpanTag - go func() { - testSpan.Tags["extraSpanTag"] = "testValue5" - testMO.SendSpans(testSpan) - }() - - // Receive the span - resultSpans = <-spanChan - - // Make sure that extraSpanTags overwrites the tag that is already present - assert.Equal(t, map[string]string{"extraSpanTag": "testValue4", "defaultSpanTag": "testValue3", "testTag2": "testValue2"}, resultSpans[0].Tags) -} diff --git a/internal/signalfx-agent/pkg/monitors/proxy.go b/internal/signalfx-agent/pkg/monitors/proxy.go deleted file mode 100644 index 0164316703..0000000000 --- a/internal/signalfx-agent/pkg/monitors/proxy.go +++ /dev/null @@ -1,43 +0,0 @@ -package monitors - -import ( - "os" - "strings" - - "github.com/signalfx/signalfx-agent/pkg/core/services" -) - -func setNoProxyEnvvar(value string) { - os.Setenv("no_proxy", value) - os.Setenv("NO_PROXY", value) -} - -func isProxying() bool { - return os.Getenv("http_proxy") != "" || os.Getenv("https_proxy") != "" || - os.Getenv("HTTP_PROXY") != "" || os.Getenv("HTTPS_PROXY") != "" -} - -func getNoProxyEnvvar() string { - noProxy := os.Getenv("NO_PROXY") - if noProxy == "" { - noProxy = os.Getenv("no_proxy") - } - return noProxy -} - -// sets the service IPs/hostnames in the no_proxy environment variable -func ensureProxyingDisabledForService(service services.Endpoint) { - host := service.Core().Host - if isProxying() && len(host) > 0 { - serviceIP := host - noProxy := getNoProxyEnvvar() - - for _, existingIP := range strings.Split(noProxy, ",") { - if existingIP == serviceIP { - return - } - } - - setNoProxyEnvvar(noProxy + "," + serviceIP) - } -} diff --git a/internal/signalfx-agent/pkg/monitors/validation.go b/internal/signalfx-agent/pkg/monitors/validation.go deleted file mode 100644 index 89de9d9bf9..0000000000 --- a/internal/signalfx-agent/pkg/monitors/validation.go +++ /dev/null @@ -1,56 +0,0 @@ -package monitors - -import ( - "errors" - "fmt" - "reflect" - - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/config/validation" - "github.com/signalfx/signalfx-agent/pkg/core/services" -) - -// Used to validate configuration that is common to all monitors up front -func validateConfig(monConfig config.MonitorCustomConfig) error { - conf := monConfig.MonitorConfigCore() - - if _, ok := MonitorFactories[conf.Type]; !ok { - return errors.New("monitor type not recognized") - } - - if conf.IntervalSeconds <= 0 { - return fmt.Errorf("invalid intervalSeconds provided: %d", conf.IntervalSeconds) - } - - takesEndpoints := configAcceptsEndpoints(monConfig) - if !takesEndpoints && conf.DiscoveryRule != "" { - return fmt.Errorf("monitor %s does not support discovery but has a discovery rule", conf.Type) - } - - // Validate discovery rules - if conf.DiscoveryRule != "" { - err := services.ValidateDiscoveryRule(conf.DiscoveryRule) - if err != nil { - return errors.New("discovery rule is invalid: " + err.Error()) - } - } - - if len(conf.ConfigEndpointMappings) > 0 && len(conf.DiscoveryRule) == 0 { - return errors.New("configEndpointMappings is not useful without a discovery rule") - } - - if err := validation.ValidateStruct(monConfig); err != nil { - return err - } - - return validation.ValidateCustomConfig(monConfig) -} - -func configAcceptsEndpoints(monConfig config.MonitorCustomConfig) bool { - confVal := reflect.Indirect(reflect.ValueOf(monConfig)) - coreConfField, ok := confVal.Type().FieldByName("MonitorConfig") - if !ok { - return false - } - return coreConfField.Tag.Get("acceptsEndpoints") == "true" -} diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index c7dbbd0dba..92f86a9b77 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -199,7 +199,6 @@ require ( github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/hashstructure v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index 52b6370ec1..bdad1f02fa 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -835,8 +835,6 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= -github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0= github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= From 088b03792e960d7e06bedc8225f85ad742af038f Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Mon, 25 Sep 2023 14:36:03 -0700 Subject: [PATCH 35/55] Remove most of selfdescribe package (#3688) --- .../pkg/selfdescribe/metadata.go | 3 +- .../pkg/selfdescribe/monitors.go | 145 ------------ .../signalfx-agent/pkg/selfdescribe/notes.go | 64 ------ .../pkg/selfdescribe/observers.go | 210 ------------------ .../pkg/selfdescribe/reflect.go | 94 -------- .../pkg/selfdescribe/selfdescribe.go | 39 ---- .../pkg/selfdescribe/sourcedocs.go | 132 ----------- .../pkg/selfdescribe/structs.go | 82 ------- .../signalfx-agent/pkg/selfdescribe/types.go | 20 -- 9 files changed, 1 insertion(+), 788 deletions(-) delete mode 100644 internal/signalfx-agent/pkg/selfdescribe/monitors.go delete mode 100644 internal/signalfx-agent/pkg/selfdescribe/notes.go delete mode 100644 internal/signalfx-agent/pkg/selfdescribe/observers.go delete mode 100644 internal/signalfx-agent/pkg/selfdescribe/reflect.go delete mode 100644 internal/signalfx-agent/pkg/selfdescribe/selfdescribe.go delete mode 100644 internal/signalfx-agent/pkg/selfdescribe/sourcedocs.go delete mode 100644 internal/signalfx-agent/pkg/selfdescribe/structs.go delete mode 100644 internal/signalfx-agent/pkg/selfdescribe/types.go diff --git a/internal/signalfx-agent/pkg/selfdescribe/metadata.go b/internal/signalfx-agent/pkg/selfdescribe/metadata.go index 65159a3968..cae793a223 100644 --- a/internal/signalfx-agent/pkg/selfdescribe/metadata.go +++ b/internal/signalfx-agent/pkg/selfdescribe/metadata.go @@ -2,7 +2,6 @@ package selfdescribe import ( "fmt" - "io/ioutil" "os" "path/filepath" @@ -79,7 +78,7 @@ func CollectMetadata(root string) ([]PackageMetadata, error) { var pkg PackageMetadata - if bytes, err := ioutil.ReadFile(path); err != nil { + if bytes, err := os.ReadFile(path); err != nil { return fmt.Errorf("unable to read metadata file %s: %w", path, err) } else if err := yaml.UnmarshalStrict(bytes, &pkg); err != nil { return fmt.Errorf("unable to unmarshal file %s: %w", path, err) diff --git a/internal/signalfx-agent/pkg/selfdescribe/monitors.go b/internal/signalfx-agent/pkg/selfdescribe/monitors.go deleted file mode 100644 index fc0162b1a6..0000000000 --- a/internal/signalfx-agent/pkg/selfdescribe/monitors.go +++ /dev/null @@ -1,145 +0,0 @@ -package selfdescribe - -import ( - "go/doc" - "reflect" - "sort" - "strconv" - - log "github.com/sirupsen/logrus" - - "github.com/signalfx/signalfx-agent/pkg/monitors" -) - -type monitorDoc struct { - MonitorMetadata - Config structMetadata `json:"config"` - AcceptsEndpoints bool `json:"acceptsEndpoints"` - SingleInstance bool `json:"singleInstance"` -} - -func monitorsStructMetadata() []monitorDoc { - sms := []monitorDoc{} - // Set to track undocumented monitors - monTypesSeen := map[string]bool{} - - if packages, err := CollectMetadata("pkg/monitors"); err != nil { - log.Fatal(err) - } else { - for _, pkg := range packages { - for _, monitor := range pkg.Monitors { - monType := monitor.MonitorType - - if _, ok := monitors.ConfigTemplates[monType]; !ok { - log.Errorf("Found metadata for %s monitor in %s but it doesn't appear to be registered", - monType, pkg.Path) - continue - } - t := reflect.TypeOf(monitors.ConfigTemplates[monType]).Elem() - monTypesSeen[monType] = true - - checkSendAllLogic(monType, monitor.Metrics, monitor.SendAll) - checkDuplicateMetrics(pkg.Path, monitor.Metrics) - checkMetricTypes(pkg.Path, monitor.Metrics) - - if monitor.Groups == nil { - monitor.Groups = make(map[string]*GroupMetadata) - } - - for name, metric := range monitor.Metrics { - group := "" - if metric.Group != nil { - group = *metric.Group - } - - if monitor.Groups[group] == nil { - monitor.Groups[group] = &GroupMetadata{} - } - - groupMeta := monitor.Groups[group] - groupMeta.Metrics = append(groupMeta.Metrics, name) - sort.Strings(groupMeta.Metrics) - } - - mc, _ := t.FieldByName("MonitorConfig") - mmd := monitorDoc{ - Config: getStructMetadata(t), - MonitorMetadata: MonitorMetadata{ - SendAll: monitor.SendAll, - SendUnknown: monitor.SendUnknown, - NoneIncluded: monitor.NoneIncluded, - MonitorType: monType, - Dimensions: monitor.Dimensions, - Groups: monitor.Groups, - Metrics: monitor.Metrics, - Properties: monitor.Properties, - Doc: monitor.Doc, - }, - AcceptsEndpoints: mc.Tag.Get("acceptsEndpoints") == strconv.FormatBool(true), - SingleInstance: mc.Tag.Get("singleInstance") == strconv.FormatBool(true), - } - mmd.Config.Package = pkg.PackagePath - - sms = append(sms, mmd) - } - } - } - - sort.Slice(sms, func(i, j int) bool { - return sms[i].MonitorType < sms[j].MonitorType - }) - - for k := range monitors.ConfigTemplates { - if !monTypesSeen[k] { - log.Warnf("Monitor Type %s is registered but does not appear to have documentation", k) - } - } - - return sms -} - -func dimensionsFromNotes(allDocs []*doc.Package) map[string]DimMetadata { - dm := map[string]DimMetadata{} - for _, note := range notesFromDocs(allDocs, "DIMENSION") { - dm[note.UID] = DimMetadata{ - Description: commentTextToParagraphs(note.Body), - } - } - return dm -} - -func checkDuplicateMetrics(path string, metrics map[string]MetricMetadata) { - seen := map[string]bool{} - - for metric := range metrics { - if seen[metric] { - log.Errorf("duplicate metric '%s' found in %s", metric, path) - } - seen[metric] = true - } -} - -func checkMetricTypes(path string, metrics map[string]MetricMetadata) { - for metric, info := range metrics { - t := info.Type - if t != "gauge" && t != "counter" && t != "cumulative" { - log.Errorf("Bad metric type '%s' for metric %s in %s", t, metric, path) - } - } -} - -func checkSendAllLogic(monType string, metrics map[string]MetricMetadata, sendAll bool) { - if len(metrics) == 0 { - return - } - - hasDefault := false - for _, metricInfo := range metrics { - hasDefault = hasDefault || metricInfo.Default - } - if hasDefault && sendAll { - log.Warnf("sendAll was specified on monitor type '%s' but some metrics were also marked as 'default'", monType) - } else if !hasDefault && !sendAll { - log.Warnf("sendAll was not specified on monitor type '%s' and no metrics are marked as 'default'", monType) - } -} diff --git a/internal/signalfx-agent/pkg/selfdescribe/notes.go b/internal/signalfx-agent/pkg/selfdescribe/notes.go deleted file mode 100644 index 3e8232db85..0000000000 --- a/internal/signalfx-agent/pkg/selfdescribe/notes.go +++ /dev/null @@ -1,64 +0,0 @@ -package selfdescribe - -import ( - "go/ast" - "go/doc" - "regexp" -) - -// Go's go/doc package has a note parser that collapses all whitespace to a -// single space instead of just letting the output renderer decide whether to -// keep the output or not. Therefore, we have to copy/paste the note parsing -// code here and remove the whitespace normalization so that it is more useful. - -var ( - noteMarker = `([A-Z][A-Z_-]+)\(([^)]+)\):?` // MARKER(uid), MARKER at least 2 chars, uid at least 1 char - noteMarkerRx = regexp.MustCompile(`^[ \t]*` + noteMarker) // MARKER(uid) at text start - noteCommentRx = regexp.MustCompile(`^/[/*][ \t]*` + noteMarker) // MARKER(uid) at comment start -) - -// readNote collects a single note from a sequence of comments. -func readNote(list []*ast.Comment, notes map[string][]*doc.Note) { - text := (&ast.CommentGroup{List: list}).Text() - if m := noteMarkerRx.FindStringSubmatchIndex(text); m != nil { - // The note body starts after the marker. - // We remove any formatting so that we don't - // get spurious line breaks/indentation when - // showing the TODO body. - body := text[m[1]:] - if body != "" { - marker := text[m[2]:m[3]] - notes[marker] = append(notes[marker], &doc.Note{ - Pos: list[0].Pos(), - End: list[len(list)-1].End(), - UID: text[m[4]:m[5]], - Body: body, - }) - } - } -} - -// readNotes extracts notes from comments. -// A note must start at the beginning of a comment with "MARKER(uid):" -// and is followed by the note body (e.g., "// BUG(gri): fix this"). -// The note ends at the end of the comment group or at the start of -// another note in the same comment group, whichever comes first. -func readNotes(comments []*ast.CommentGroup) map[string][]*doc.Note { - notes := make(map[string][]*doc.Note) - for _, group := range comments { - i := -1 // comment index of most recent note start, valid if >= 0 - list := group.List - for j, c := range list { - if noteCommentRx.MatchString(c.Text) { - if i >= 0 { - readNote(list[i:j], notes) - } - i = j - } - } - if i >= 0 { - readNote(list[i:], notes) - } - } - return notes -} diff --git a/internal/signalfx-agent/pkg/selfdescribe/observers.go b/internal/signalfx-agent/pkg/selfdescribe/observers.go deleted file mode 100644 index 5370526248..0000000000 --- a/internal/signalfx-agent/pkg/selfdescribe/observers.go +++ /dev/null @@ -1,210 +0,0 @@ -package selfdescribe - -import ( - "go/doc" - "os" - "path/filepath" - "reflect" - "sort" - "strings" - - log "github.com/sirupsen/logrus" - - "github.com/signalfx/signalfx-agent/pkg/core/services" - "github.com/signalfx/signalfx-agent/pkg/observers" -) - -type observerMetadata struct { - structMetadata - ObserverType string `json:"observerType"` - Dimensions map[string]DimMetadata `json:"dimensions"` - EndpointVariables []endpointVar `json:"endpointVariables"` -} - -type endpointVar struct { - Name string `json:"name"` - Type string `json:"type"` - ElementKind string `json:"elementKind"` - Description string `json:"description"` -} - -func observersStructMetadata() ([]observerMetadata, error) { - sms := []observerMetadata{} - // Set to track undocumented observers - obsTypesSeen := make(map[string]bool) - - err := filepath.Walk("pkg/observers", func(path string, info os.FileInfo, err error) error { - if !info.IsDir() || err != nil { - return err - } - pkgDoc := packageDoc(path) - if pkgDoc == nil { - return nil - } - for obsType, obsDoc := range observerDocsInPackage(pkgDoc) { - if _, ok := observers.ConfigTemplates[obsType]; !ok { - log.Errorf("Found OBSERVER doc for observer type %s but it doesn't appear to be registered", obsType) - continue - } - t := reflect.TypeOf(observers.ConfigTemplates[obsType]).Elem() - obsTypesSeen[obsType] = true - - allDocs, err := nestedPackageDocs(path) - if err != nil { - return err - } - - dims, err := dimensionsFromNotesAndServicesPackage(allDocs) - if err != nil { - return err - } - - endpointVars, err := endpointVariables(allDocs) - if err != nil { - return err - } - - mmd := observerMetadata{ - structMetadata: getStructMetadata(t), - ObserverType: obsType, - Dimensions: dims, - EndpointVariables: endpointVars, - } - mmd.Doc = obsDoc - mmd.Package = path - - sms = append(sms, mmd) - } - return nil - }) - if err != nil { - return nil, err - } - - sort.Slice(sms, func(i, j int) bool { - return sms[i].ObserverType < sms[j].ObserverType - }) - - for k := range observers.ConfigTemplates { - if !obsTypesSeen[k] { - log.Warnf("Observer Type %s is registered but does not appear to have documentation", k) - } - } - - return sms, nil -} - -func observerDocsInPackage(pkgDoc *doc.Package) map[string]string { - out := make(map[string]string) - for _, note := range pkgDoc.Notes["OBSERVER"] { - out[note.UID] = note.Body - } - return out -} - -func dimensionsFromNotesAndServicesPackage(allDocs []*doc.Package) (map[string]DimMetadata, error) { - containerDims := map[string]DimMetadata{} - - if isContainerObserver(allDocs) { - servicesDocs, err := nestedPackageDocs("pkg/core/services") - if err != nil { - return nil, err - } - - for _, note := range notesFromDocs(servicesDocs, "CONTAINER_DIMENSION") { - containerDims[note.UID] = DimMetadata{ - Description: commentTextToParagraphs(note.Body), - } - } - } - - for k, v := range dimensionsFromNotes(allDocs) { - containerDims[k] = v - } - - return containerDims, nil -} - -func isContainerObserver(obsDocs []*doc.Package) bool { - obsEndpointTypes := notesFromDocs(obsDocs, "ENDPOINT_TYPE") - - if len(obsEndpointTypes) > 0 && obsEndpointTypes[0].UID == "ContainerEndpoint" { - return true - } - return false -} - -func endpointVariables(obsDocs []*doc.Package) ([]endpointVar, error) { - servicesDocs, err := nestedPackageDocs("pkg/core/services") - if err != nil { - return nil, err - } - - var eType reflect.Type - isForContainers := isContainerObserver(obsDocs) - if isForContainers { - eType = reflect.TypeOf(services.ContainerEndpoint{}) - } else { - eType = reflect.TypeOf(services.EndpointCore{}) - } - sm := getStructMetadata(eType) - - return append( - endpointVariablesFromNotes(append(obsDocs, servicesDocs...), isForContainers), - endpointVarsFromStructMetadataFields(sm.Fields)...), nil -} - -func endpointVarsFromStructMetadataFields(fields []fieldMetadata) []endpointVar { - var endpointVars []endpointVar - for _, fm := range fields { - if fm.ElementStruct != nil { - endpointVars = append(endpointVars, endpointVarsFromStructMetadataFields(fm.ElementStruct.Fields)...) - continue - } - - endpointVars = append(endpointVars, endpointVar{ - Name: fm.YAMLName, - Type: fm.Type, - ElementKind: fm.ElementKind, - Description: fm.Doc, - }) - } - sort.Slice(endpointVars, func(i, j int) bool { - return endpointVars[i].Name < endpointVars[j].Name - }) - return endpointVars -} - -func endpointVariablesFromNotes(allDocs []*doc.Package, includeContainerVars bool) []endpointVar { - var endpointVars []endpointVar - for _, note := range notesFromDocs(allDocs, "ENDPOINT_VAR") { - uidSplit := strings.Split(note.UID, "|") - typ := "string" - if len(uidSplit) > 1 { - typ = uidSplit[1] - } - - endpointVars = append(endpointVars, endpointVar{ - Name: uidSplit[0], - Type: typ, - Description: commentTextToParagraphs(note.Body), - }) - } - - // This is pretty hacky but is about the cleanest way to distinguish - // container derived variables from non-container vars so that docs aren't - // misleading. - if includeContainerVars { - for _, note := range notesFromDocs(allDocs, "CONTAINER_ENDPOINT_VAR") { - endpointVars = append(endpointVars, endpointVar{ - Name: note.UID, - Type: "string", - Description: commentTextToParagraphs(note.Body), - }) - } - } - sort.Slice(endpointVars, func(i, j int) bool { - return endpointVars[i].Name < endpointVars[j].Name - }) - return endpointVars -} diff --git a/internal/signalfx-agent/pkg/selfdescribe/reflect.go b/internal/signalfx-agent/pkg/selfdescribe/reflect.go deleted file mode 100644 index c65070fa43..0000000000 --- a/internal/signalfx-agent/pkg/selfdescribe/reflect.go +++ /dev/null @@ -1,94 +0,0 @@ -package selfdescribe - -import ( - "encoding/json" - "reflect" - "strconv" - "strings" - - log "github.com/sirupsen/logrus" - yaml "gopkg.in/yaml.v2" -) - -// Only works if there is an explicit "yaml" struct tag -func getYAMLName(f reflect.StructField) string { - yamlTag := f.Tag.Get("yaml") - return strings.SplitN(yamlTag, ",", 2)[0] -} - -func isInlinedYAML(f reflect.StructField) bool { - return strings.Contains(f.Tag.Get("yaml"), ",inline") -} - -// Assumes monitors are using the defaults package -func getDefault(f reflect.StructField) interface{} { - if getRequired(f) { - return nil - } - if f.Tag.Get("noDefault") == strconv.FormatBool(true) { - return nil - } - - defTag := f.Tag.Get("default") - if defTag != "" { - // These are essentially just noop defaults so don't return them - if defTag == "{}" || defTag == "[]" { - return "" - } - if strings.HasPrefix(defTag, "{") || strings.HasPrefix(defTag, "[") || defTag == strconv.FormatBool(true) || defTag == strconv.FormatBool(false) { - var out interface{} - err := json.Unmarshal([]byte(defTag), &out) - if err != nil { - log.WithError(err).Warnf("Could not unmarshal default value `%s` for field %s", defTag, f.Name) - return defTag - } - return out - } - if asInt, err := strconv.Atoi(defTag); err == nil { - return asInt - } - return defTag - } - if f.Type.Kind() == reflect.Ptr { - if f.Type.Elem().Kind() == reflect.Bool { - return "false" - } - return nil - } - if f.Type.Kind() != reflect.Struct { - return reflect.Zero(f.Type).Interface() - } - return nil -} - -// Assumes that monitors are using the validate package to do validation -func getRequired(f reflect.StructField) bool { - validate := f.Tag.Get("validate") - for _, v := range strings.Split(validate, ",") { - if v == "required" { - return true - } - } - return false -} - -// The kind with any pointer removed -func indirectKind(t reflect.Type) reflect.Kind { - if t == reflect.TypeOf(yaml.MapSlice(nil)) { - return reflect.Map - } - - kind := t.Kind() - if kind == reflect.Ptr { - return t.Elem().Kind() - } - return kind -} - -// The type with any pointers removed -func indirectType(t reflect.Type) reflect.Type { - if t.Kind() == reflect.Ptr { - return t.Elem() - } - return t -} diff --git a/internal/signalfx-agent/pkg/selfdescribe/selfdescribe.go b/internal/signalfx-agent/pkg/selfdescribe/selfdescribe.go deleted file mode 100644 index 7f2bd513cb..0000000000 --- a/internal/signalfx-agent/pkg/selfdescribe/selfdescribe.go +++ /dev/null @@ -1,39 +0,0 @@ -// Package selfdescribe contains code that knows how to pull metadata from -// various agent component out into a well structured format that can be fed -// into other workflows to generate documentation or other resources such as -// chef recipies. The main interface is the JSON() function, that returns -// everything encoded as JSON. -package selfdescribe - -import ( - "encoding/json" - "io" - "reflect" - - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/config/sources" -) - -// JSON returns a json encoded string of all of the documentation for the -// various components in the agent. It is meant to be used as an intermediate -// form which serves as a data source for automatically generating docs about -// the agent. -func JSON(writer io.Writer) { - osm, err := observersStructMetadata() - if err != nil { - panic(err) - } - - out, err := json.MarshalIndent(map[string]interface{}{ - "TopConfig": getStructMetadata(reflect.TypeOf(config.Config{})), - "GenericMonitorConfig": getStructMetadata(reflect.TypeOf(config.MonitorConfig{})), - "GenericObserverConfig": getStructMetadata(reflect.TypeOf(config.ObserverConfig{})), - "Monitors": monitorsStructMetadata(), - "Observers": osm, - "SourceConfig": getStructMetadata(reflect.TypeOf(sources.SourceConfig{})), - }, "", " ") - if err != nil { - panic(err) - } - _, _ = writer.Write(out) -} diff --git a/internal/signalfx-agent/pkg/selfdescribe/sourcedocs.go b/internal/signalfx-agent/pkg/selfdescribe/sourcedocs.go deleted file mode 100644 index d20f0e8e53..0000000000 --- a/internal/signalfx-agent/pkg/selfdescribe/sourcedocs.go +++ /dev/null @@ -1,132 +0,0 @@ -package selfdescribe - -import ( - "fmt" - "go/ast" - "go/doc" - "go/parser" - "go/token" - "os" - "path/filepath" - "regexp" - "strings" -) - -type astCacheEntry struct { - fset *token.FileSet - pkgs map[string]*ast.Package -} - -// nolint: gochecknoglobals -// Used to cache the asts parsed from package files -var astCache = map[string]astCacheEntry{} - -// Returns the ast node of the struct itself and the comment group on the -// struct type. -func structNodes(packageDir, structName string) (*ast.TypeSpec, *ast.CommentGroup) { - var fset *token.FileSet - var pkgs map[string]*ast.Package - - cached, ok := astCache[packageDir] - if ok { - fset = cached.fset - pkgs = cached.pkgs - } else { - fset = token.NewFileSet() - var err error - pkgs, err = parser.ParseDir(fset, packageDir, nil, parser.ParseComments) - if err != nil { - panic(err) - } - astCache[packageDir] = astCacheEntry{fset: fset, pkgs: pkgs} - } - - for _, p := range pkgs { - for _, f := range p.Files { - // Find the struct specified by structName by looking at all nodes - // with comments. This means that the config struct has to have a - // comment on it or else it won't be found. - cmap := ast.NewCommentMap(fset, f, f.Comments) - for node := range cmap { - if t, ok := node.(*ast.GenDecl); ok { - if t.Tok != token.TYPE { - continue - } - - if t.Specs[0].(*ast.TypeSpec).Name.Name == structName { - return t.Specs[0].(*ast.TypeSpec), t.Doc - } - } - } - } - } - panic(fmt.Sprintf("Could not find %s in %s", structName, packageDir)) -} - -func structDoc(packageDir, structName string) string { - _, commentGroup := structNodes(packageDir, structName) - return commentTextToParagraphs(commentGroup.Text()) -} - -func packageDoc(packageDir string) *doc.Package { - fset := token.NewFileSet() - pkgs, err := parser.ParseDir(fset, packageDir, nil, parser.ParseComments) - if err != nil { - panic(err) - } - if len(pkgs) > 1 { - panic("Can't handle multiple packages") - } - if len(pkgs) == 0 { - return nil - } - p := pkgs[filepath.Base(packageDir)] - // go/doc is pretty inflexible in how it parses notes so do it ourselves. - notes := readNotes(ast.MergePackageFiles(p, 0).Comments) - pkgDoc := doc.New(p, packageDir, doc.AllDecls|doc.AllMethods) - pkgDoc.Notes = notes - return pkgDoc -} - -func nestedPackageDocs(packageDir string) ([]*doc.Package, error) { - var out []*doc.Package - err := filepath.Walk(packageDir, func(path string, info os.FileInfo, err error) error { - if !info.IsDir() || err != nil { - return err - } - - pkgDoc := packageDoc(path) - if pkgDoc != nil { - out = append(out, pkgDoc) - } - return nil - }) - return out, err -} - -func notesFromDocs(docs []*doc.Package, noteType string) []*doc.Note { - var notes []*doc.Note - for _, pkgDoc := range docs { - notes = append(notes, pkgDoc.Notes[noteType]...) - } - return notes -} - -func structFieldDocs(packageDir, structName string) map[string]string { - configStruct, _ := structNodes(packageDir, structName) - fieldDocs := map[string]string{} - for _, field := range configStruct.Type.(*ast.StructType).Fields.List { - if field.Names != nil { - fieldDocs[field.Names[0].Name] = commentTextToParagraphs(field.Doc.Text()) - } - } - - return fieldDocs -} - -// nolint: gochecknoglobals -var textRE = regexp.MustCompile(`([^\n])\n([^\s])`) - -func commentTextToParagraphs(t string) string { - return strings.TrimSpace(textRE.ReplaceAllString(t, "$1 $2")) -} diff --git a/internal/signalfx-agent/pkg/selfdescribe/structs.go b/internal/signalfx-agent/pkg/selfdescribe/structs.go deleted file mode 100644 index 262c3c3196..0000000000 --- a/internal/signalfx-agent/pkg/selfdescribe/structs.go +++ /dev/null @@ -1,82 +0,0 @@ -package selfdescribe - -import ( - "reflect" - "strings" - - "gopkg.in/yaml.v2" -) - -// Embedded structs to always ignore since they already provided in other -// places in the output. -var excludedFields = map[string]bool{ - "MonitorConfig": true, - "ObserverConfig": true, - "OtherConfig": true, -} - -// This will have to change if we start pulling in monitors from other repos -func packageDirOfType(t reflect.Type) string { - return strings.TrimPrefix(t.PkgPath(), "github.com/signalfx/signalfx-agent/") -} - -func getStructMetadata(typ reflect.Type) structMetadata { - packageDir := packageDirOfType(typ) - structName := typ.Name() - if packageDir == "" || structName == "" { - return structMetadata{} - } - - fieldMD := []fieldMetadata{} - for i := 0; i < typ.NumField(); i++ { - f := typ.Field(i) - - if excludedFields[f.Name] { - continue - } - - if f.Anonymous && indirectKind(f.Type) == reflect.Struct { - nestedSM := getStructMetadata(f.Type) - fieldMD = append(fieldMD, nestedSM.Fields...) - continue - // Embedded struct name and doc is irrelevant. - } - - yamlName := getYAMLName(f) - if (yamlName == "" || yamlName == "-" || strings.HasPrefix(yamlName, "_")) && (!isInlinedYAML(f) || indirectKind(f.Type) != reflect.Struct) { - continue - } - - fm := fieldMetadata{ - YAMLName: yamlName, - Doc: structFieldDocs(packageDir, structName)[f.Name], - Default: getDefault(f), - Required: getRequired(f), - Type: indirectKind(f.Type).String(), - } - - if indirectKind(f.Type) == reflect.Struct { - smd := getStructMetadata(indirectType(f.Type)) - fm.ElementStruct = &smd - } else if f.Type.Kind() == reflect.Map || f.Type.Kind() == reflect.Slice { - if f.Type != reflect.TypeOf(yaml.MapSlice(nil)) { - ikind := indirectKind(f.Type.Elem()) - fm.ElementKind = ikind.String() - - if ikind == reflect.Struct { - smd := getStructMetadata(indirectType(f.Type.Elem())) - fm.ElementStruct = &smd - } - } - } - - fieldMD = append(fieldMD, fm) - } - - return structMetadata{ - Name: structName, - Doc: structDoc(packageDir, structName), - Package: packageDir, - Fields: fieldMD, - } -} diff --git a/internal/signalfx-agent/pkg/selfdescribe/types.go b/internal/signalfx-agent/pkg/selfdescribe/types.go deleted file mode 100644 index f906bb3f1d..0000000000 --- a/internal/signalfx-agent/pkg/selfdescribe/types.go +++ /dev/null @@ -1,20 +0,0 @@ -package selfdescribe - -type structMetadata struct { - Name string `json:"name"` - Doc string `json:"doc"` - Package string `json:"package"` - Fields []fieldMetadata `json:"fields"` -} - -type fieldMetadata struct { - YAMLName string `json:"yamlName"` - Doc string `json:"doc"` - Default interface{} `json:"default"` - Required bool `json:"required"` - Type string `json:"type"` - ElementKind string `json:"elementKind"` - // Element is the metadata for the element type of a slice or the value - // type of a map if they are structs. - ElementStruct *structMetadata `json:"elementStruct,omitempty"` -} From 4a15c8fe8aeaf0b026d2a5566d1eb50d0c5c3375 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:42:49 -0700 Subject: [PATCH 36/55] Bump boto3 in /internal/buildscripts/packaging/release (#3690) Bumps [boto3](https://github.com/boto/boto3) from 1.28.49 to 1.28.53. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.28.49...1.28.53) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- internal/buildscripts/packaging/release/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/buildscripts/packaging/release/requirements.txt b/internal/buildscripts/packaging/release/requirements.txt index 34cc4f68ce..79b6967a0a 100644 --- a/internal/buildscripts/packaging/release/requirements.txt +++ b/internal/buildscripts/packaging/release/requirements.txt @@ -1,4 +1,4 @@ PyGithub==1.59.1 -boto3==1.28.49 +boto3==1.28.53 docker==6.1.3 requests==2.31.0 \ No newline at end of file From 2cbed432ede0aaa22ec707a63632583d156f3d3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:43:38 -0700 Subject: [PATCH 37/55] Bump github.com/antonmedv/expr from 1.15.2 to 1.15.3 (#3693) Bumps [github.com/antonmedv/expr](https://github.com/antonmedv/expr) from 1.15.2 to 1.15.3. - [Release notes](https://github.com/antonmedv/expr/releases) - [Commits](https://github.com/antonmedv/expr/compare/v1.15.2...v1.15.3) --- updated-dependencies: - dependency-name: github.com/antonmedv/expr dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3b7bbefb5b..8325c6e2f7 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/alecthomas/participle/v2 v2.1.0 - github.com/antonmedv/expr v1.15.2 + github.com/antonmedv/expr v1.15.3 github.com/apache/pulsar-client-go v0.11.0 github.com/cenkalti/backoff/v4 v4.2.1 github.com/fsnotify/fsnotify v1.6.0 diff --git a/go.sum b/go.sum index 652d0724ba..b8752b5933 100644 --- a/go.sum +++ b/go.sum @@ -175,8 +175,8 @@ github.com/aliyun/alibaba-cloud-sdk-go v1.62.301 h1:8mgvCpqsv3mQAcqZ/baAaMGUBj5J github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antonmedv/expr v1.15.2 h1:afFXpDWIC2n3bF+kTZE1JvFo+c34uaM3sTqh8z0xfdU= -github.com/antonmedv/expr v1.15.2/go.mod h1:0E/6TxnOlRNp81GMzX9QfDPAmHo2Phg00y4JUv1ihsE= +github.com/antonmedv/expr v1.15.3 h1:q3hOJZNvLvhqE8OHBs1cFRdbXFNKuA+bHmRaI+AmRmI= +github.com/antonmedv/expr v1.15.3/go.mod h1:0E/6TxnOlRNp81GMzX9QfDPAmHo2Phg00y4JUv1ihsE= github.com/apache/arrow/go/v12 v12.0.1 h1:JsR2+hzYYjgSUkBSaahpqCetqZMr76djX80fF/DiJbg= github.com/apache/arrow/go/v12 v12.0.1/go.mod h1:weuTY7JvTG/HDPtMQxEUp7pU73vkLWMLpY67QwZ/WWw= github.com/apache/pulsar-client-go v0.11.0 h1:fniyVbewAOcMSMLwxzhdrCFmFTorCW40jfnmQVcsrJw= From e883923b818428015f2d88f9344522d59dd49b38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:46:19 -0700 Subject: [PATCH 38/55] Bump github.com/prometheus/procfs from 0.11.1 to 0.12.0 in /internal/signalfx-agent (#3695) * Bump github.com/prometheus/procfs in /internal/signalfx-agent Bumps [github.com/prometheus/procfs](https://github.com/prometheus/procfs) from 0.11.1 to 0.12.0. - [Release notes](https://github.com/prometheus/procfs/releases) - [Commits](https://github.com/prometheus/procfs/compare/v0.11.1...v0.12.0) --- updated-dependencies: - dependency-name: github.com/prometheus/procfs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- go.mod | 2 +- go.sum | 4 ++-- internal/signalfx-agent/go.mod | 2 +- internal/signalfx-agent/go.sum | 4 ++-- pkg/extension/smartagentextension/go.sum | 2 +- pkg/receiver/smartagentreceiver/go.mod | 2 +- pkg/receiver/smartagentreceiver/go.sum | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 8325c6e2f7..5507c3d3f9 100644 --- a/go.mod +++ b/go.mod @@ -169,7 +169,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.16.0 // indirect github.com/prometheus/common/sigv4 v0.1.0 // indirect - github.com/prometheus/procfs v0.11.1 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/prometheus/statsd_exporter v0.22.7 // indirect github.com/relvacode/iso8601 v1.3.0 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect diff --git a/go.sum b/go.sum index b8752b5933..7c5dc40d4a 100644 --- a/go.sum +++ b/go.sum @@ -1391,8 +1391,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/prometheus v0.47.0 h1:tIJJKZGlmrMVsvIt6rMfB8he7CRHEc8ZxS5ubcZtbkM= github.com/prometheus/prometheus v0.47.0/go.mod h1:J/bmOSjgH7lFxz2gZhrWEZs2i64vMS+HIuZfmYNhJ/M= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index d6522e1d32..c1a595c797 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -70,7 +70,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_model v0.4.0 github.com/prometheus/common v0.44.0 - github.com/prometheus/procfs v0.11.1 + github.com/prometheus/procfs v0.12.0 github.com/samuel/go-zookeeper v0.0.0-20200724154423-2164a8ac840e github.com/shirou/gopsutil/v3 v3.23.8 github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index 534485a8fe..3872f6422d 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -981,8 +981,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rboyer/safeio v0.2.1 h1:05xhhdRNAdS3apYm7JRjOqngf4xruaW959jmRxGDuSU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/renier/xmlrpc v0.0.0-20170708154548-ce4a1a486c03 h1:Wdi9nwnhFNAlseAOekn6B5G/+GMtks9UKbvRU/CMM/o= diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index 438060ec11..1147f59e22 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -566,7 +566,7 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= github.com/rboyer/safeio v0.2.1 h1:05xhhdRNAdS3apYm7JRjOqngf4xruaW959jmRxGDuSU= github.com/renier/xmlrpc v0.0.0-20170708154548-ce4a1a486c03 h1:Wdi9nwnhFNAlseAOekn6B5G/+GMtks9UKbvRU/CMM/o= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index 92f86a9b77..07ed65f102 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -232,7 +232,7 @@ require ( github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.11.1 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/rs/cors v1.10.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/samuel/go-zookeeper v0.0.0-20200724154423-2164a8ac840e // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index bdad1f02fa..c07b393808 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -998,8 +998,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= github.com/rboyer/safeio v0.2.1 h1:05xhhdRNAdS3apYm7JRjOqngf4xruaW959jmRxGDuSU= github.com/renier/xmlrpc v0.0.0-20170708154548-ce4a1a486c03 h1:Wdi9nwnhFNAlseAOekn6B5G/+GMtks9UKbvRU/CMM/o= From ff2b24421d1120804fbb81efdc0926176bd8cd14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:46:57 -0700 Subject: [PATCH 39/55] Bump github.com/go-errors/errors from 1.5.0 to 1.5.1 in /internal/signalfx-agent (#3696) * Bump github.com/go-errors/errors in /internal/signalfx-agent Bumps [github.com/go-errors/errors](https://github.com/go-errors/errors) from 1.5.0 to 1.5.1. - [Release notes](https://github.com/go-errors/errors/releases) - [Commits](https://github.com/go-errors/errors/compare/v1.5.0...v1.5.1) --- updated-dependencies: - dependency-name: github.com/go-errors/errors dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- go.sum | 2 +- internal/signalfx-agent/go.mod | 2 +- internal/signalfx-agent/go.sum | 4 ++-- pkg/receiver/smartagentreceiver/go.sum | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.sum b/go.sum index 7c5dc40d4a..d81fe0cb32 100644 --- a/go.sum +++ b/go.sum @@ -435,7 +435,7 @@ github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbS github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-errors/errors v1.5.0 h1:/EuijeGOu7ckFxzhkj4CXJ8JaenxK7bKUxpPYqeLHqQ= +github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index c1a595c797..73b7cf44f5 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -113,7 +113,7 @@ require ( require ( github.com/StackExchange/wmi v1.2.1 - github.com/go-errors/errors v1.5.0 + github.com/go-errors/errors v1.5.1 github.com/hashicorp/golang-lru v1.0.2 github.com/kr/pretty v0.3.1 github.com/signalfx/signalfx-agent/pkg/apm v0.0.0-00010101000000-000000000000 diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index 3872f6422d..42cf5dac25 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -337,8 +337,8 @@ github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbS github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-errors/errors v1.5.0 h1:/EuijeGOu7ckFxzhkj4CXJ8JaenxK7bKUxpPYqeLHqQ= -github.com/go-errors/errors v1.5.0/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= +github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index c07b393808..a11dd8e87e 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -338,7 +338,7 @@ github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbS github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-errors/errors v1.5.0 h1:/EuijeGOu7ckFxzhkj4CXJ8JaenxK7bKUxpPYqeLHqQ= +github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= From 32311afb660e48e6beafc7af7535532edf4da70a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:47:29 -0700 Subject: [PATCH 40/55] Bump github.com/hashicorp/consul/api from 1.24.0 to 1.25.1 in /internal/signalfx-agent (#3697) * Bump github.com/hashicorp/consul/api in /internal/signalfx-agent Bumps [github.com/hashicorp/consul/api](https://github.com/hashicorp/consul) from 1.24.0 to 1.25.1. - [Release notes](https://github.com/hashicorp/consul/releases) - [Changelog](https://github.com/hashicorp/consul/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/consul/compare/api/v1.24.0...api/v1.25.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/consul/api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- go.mod | 2 +- go.sum | 4 ++-- internal/signalfx-agent/go.mod | 2 +- internal/signalfx-agent/go.sum | 4 ++-- pkg/extension/smartagentextension/go.mod | 2 +- pkg/extension/smartagentextension/go.sum | 4 ++-- pkg/receiver/smartagentreceiver/go.mod | 2 +- pkg/receiver/smartagentreceiver/go.sum | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 5507c3d3f9..50ac847435 100644 --- a/go.mod +++ b/go.mod @@ -317,7 +317,7 @@ require ( github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.17.1 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/hashicorp/consul/api v1.24.0 // indirect + github.com/hashicorp/consul/api v1.25.1 // indirect github.com/hashicorp/cronexpr v1.1.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect diff --git a/go.sum b/go.sum index d81fe0cb32..981948f544 100644 --- a/go.sum +++ b/go.sum @@ -660,8 +660,8 @@ github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NM github.com/guregu/null v4.0.0+incompatible h1:4zw0ckM7ECd6FNNddc3Fu4aty9nTlpkkzH7dPn4/4Gw= github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= -github.com/hashicorp/consul/api v1.24.0 h1:u2XyStA2j0jnCiVUU7Qyrt8idjRn4ORhK6DlvZ3bWhA= -github.com/hashicorp/consul/api v1.24.0/go.mod h1:NZJGRFYruc/80wYowkPFCp1LbGmJC9L8izrwfyVx/Wg= +github.com/hashicorp/consul/api v1.25.1 h1:CqrdhYzc8XZuPnhIYZWH45toM0LB9ZeYr/gvpLVI3PE= +github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= github.com/hashicorp/consul/sdk v0.14.0 h1:Hly+BMNMssVzoWddbBnBFi3W+Fzytvm0haSkihhj3GU= github.com/hashicorp/consul/sdk v0.14.0/go.mod h1:gHYeuDa0+0qRAD6Wwr6yznMBvBwHKoxSBoW5l73+saE= github.com/hashicorp/cronexpr v1.1.2 h1:wG/ZYIKT+RT3QkOdgYc+xsKWVRgnxJ1OJtjjy84fJ9A= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index 73b7cf44f5..f87dd255ce 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -46,7 +46,7 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/google/cadvisor v0.47.3 github.com/gorilla/mux v1.8.0 - github.com/hashicorp/consul/api v1.24.0 + github.com/hashicorp/consul/api v1.25.1 github.com/hashicorp/vault v1.14.3 // required for newer google.golang.org/api compatibility github.com/hashicorp/vault-plugin-auth-gcp v0.16.1 github.com/hashicorp/vault/api v1.10.0 diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index 42cf5dac25..1aa6855952 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -534,8 +534,8 @@ github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NM github.com/guregu/null v4.0.0+incompatible h1:4zw0ckM7ECd6FNNddc3Fu4aty9nTlpkkzH7dPn4/4Gw= github.com/guregu/null v4.0.0+incompatible/go.mod h1:ePGpQaN9cw0tj45IR5E5ehMvsFlLlQZAkkOXZurJ3NM= github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/api v1.24.0 h1:u2XyStA2j0jnCiVUU7Qyrt8idjRn4ORhK6DlvZ3bWhA= -github.com/hashicorp/consul/api v1.24.0/go.mod h1:NZJGRFYruc/80wYowkPFCp1LbGmJC9L8izrwfyVx/Wg= +github.com/hashicorp/consul/api v1.25.1 h1:CqrdhYzc8XZuPnhIYZWH45toM0LB9ZeYr/gvpLVI3PE= +github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/consul/sdk v0.14.1 h1:ZiwE2bKb+zro68sWzZ1SgHF3kRMBZ94TwOCFRF4ylPs= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= diff --git a/pkg/extension/smartagentextension/go.mod b/pkg/extension/smartagentextension/go.mod index b89ace0747..a6d06f0a1c 100644 --- a/pkg/extension/smartagentextension/go.mod +++ b/pkg/extension/smartagentextension/go.mod @@ -51,7 +51,7 @@ require ( github.com/google/uuid v1.3.1 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect - github.com/hashicorp/consul/api v1.24.0 // indirect + github.com/hashicorp/consul/api v1.25.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-gcp-common v0.8.0 // indirect diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index 1147f59e22..c02fb66d00 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -260,8 +260,8 @@ github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25d github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= -github.com/hashicorp/consul/api v1.24.0 h1:u2XyStA2j0jnCiVUU7Qyrt8idjRn4ORhK6DlvZ3bWhA= -github.com/hashicorp/consul/api v1.24.0/go.mod h1:NZJGRFYruc/80wYowkPFCp1LbGmJC9L8izrwfyVx/Wg= +github.com/hashicorp/consul/api v1.25.1 h1:CqrdhYzc8XZuPnhIYZWH45toM0LB9ZeYr/gvpLVI3PE= +github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= github.com/hashicorp/consul/sdk v0.14.0 h1:Hly+BMNMssVzoWddbBnBFi3W+Fzytvm0haSkihhj3GU= github.com/hashicorp/consul/sdk v0.14.0/go.mod h1:gHYeuDa0+0qRAD6Wwr6yznMBvBwHKoxSBoW5l73+saE= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index 07ed65f102..c36b41aa8a 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -130,7 +130,7 @@ require ( github.com/gophercloud/gophercloud v0.25.0 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/hashicorp/consul/api v1.24.0 // indirect + github.com/hashicorp/consul/api v1.25.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-gcp-common v0.8.0 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index a11dd8e87e..de12ab2aa2 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -533,8 +533,8 @@ github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8 github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/guregu/null v4.0.0+incompatible h1:4zw0ckM7ECd6FNNddc3Fu4aty9nTlpkkzH7dPn4/4Gw= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= -github.com/hashicorp/consul/api v1.24.0 h1:u2XyStA2j0jnCiVUU7Qyrt8idjRn4ORhK6DlvZ3bWhA= -github.com/hashicorp/consul/api v1.24.0/go.mod h1:NZJGRFYruc/80wYowkPFCp1LbGmJC9L8izrwfyVx/Wg= +github.com/hashicorp/consul/api v1.25.1 h1:CqrdhYzc8XZuPnhIYZWH45toM0LB9ZeYr/gvpLVI3PE= +github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= github.com/hashicorp/consul/sdk v0.14.0 h1:Hly+BMNMssVzoWddbBnBFi3W+Fzytvm0haSkihhj3GU= github.com/hashicorp/consul/sdk v0.14.0/go.mod h1:gHYeuDa0+0qRAD6Wwr6yznMBvBwHKoxSBoW5l73+saE= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= From 72c66f01fc7092ebf551709e46af27d80ae4596e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:48:52 -0700 Subject: [PATCH 41/55] Bump go.uber.org/zap from 1.25.0 to 1.26.0 in /tests (#3691) * Bump go.uber.org/zap from 1.25.0 to 1.26.0 in /tests Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.25.0 to 1.26.0. - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/zap/compare/v1.25.0...v1.26.0) --- updated-dependencies: - dependency-name: go.uber.org/zap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- pkg/extension/smartagentextension/go.mod | 2 +- pkg/extension/smartagentextension/go.sum | 5 ++--- tests/go.mod | 2 +- tests/go.sum | 5 ++--- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/extension/smartagentextension/go.mod b/pkg/extension/smartagentextension/go.mod index a6d06f0a1c..7e151b7084 100644 --- a/pkg/extension/smartagentextension/go.mod +++ b/pkg/extension/smartagentextension/go.mod @@ -162,7 +162,7 @@ require ( go.opentelemetry.io/otel/trace v1.17.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.25.0 // indirect + go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.13.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.11.0 // indirect diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index c02fb66d00..1b5da98f0e 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -68,7 +68,6 @@ github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+ github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/axiomhq/hyperloglog v0.0.0-20220105174342-98591331716a h1:eqjiAL3qooftPm8b9C1GsSSRcmlw7iOva8vdBTmV2PY= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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= @@ -740,8 +739,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= diff --git a/tests/go.mod b/tests/go.mod index 671b88db96..086889fc3c 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -30,7 +30,7 @@ require ( go.opentelemetry.io/otel/trace v1.17.0 go.uber.org/atomic v1.11.0 go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.25.0 + go.uber.org/zap v1.26.0 golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/tests/go.sum b/tests/go.sum index 359ac87bf3..f975ac504d 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -596,7 +596,6 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72H github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 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= @@ -1229,8 +1228,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= From 4945af0b89003be39097b466afa65a04660f3db5 Mon Sep 17 00:00:00 2001 From: Samiur Arif Date: Mon, 25 Sep 2023 16:10:48 -0700 Subject: [PATCH 42/55] removed more dead code. (#3703) --- internal/signalfx-agent/pkg/utils/http.go | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 internal/signalfx-agent/pkg/utils/http.go diff --git a/internal/signalfx-agent/pkg/utils/http.go b/internal/signalfx-agent/pkg/utils/http.go deleted file mode 100644 index 62cefb8f66..0000000000 --- a/internal/signalfx-agent/pkg/utils/http.go +++ /dev/null @@ -1,13 +0,0 @@ -package utils - -import ( - "errors" - "regexp" -) - -var accessTokenSanitizer = regexp.MustCompile(`(?i)x-sf-token:\[[^\s]+\]`) - -// SanitizeHTTPError will remove any sensitive data from HTTP client errors. -func SanitizeHTTPError(err error) error { - return errors.New(accessTokenSanitizer.ReplaceAllString(err.Error(), "")) -} From 26f9ea757e816c1cd62b34890369642a49136631 Mon Sep 17 00:00:00 2001 From: Jeff Cheng <83052155+jeffreyc-splunk@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:36:27 -0400 Subject: [PATCH 43/55] Update SA extension links (#3705) --- pkg/extension/smartagentextension/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/extension/smartagentextension/README.md b/pkg/extension/smartagentextension/README.md index 6e8b5c1d82..3ba6dc8069 100644 --- a/pkg/extension/smartagentextension/README.md +++ b/pkg/extension/smartagentextension/README.md @@ -6,7 +6,7 @@ The `smartagent` extension provides a mechanism to specify config options that are not just specific to a single instance of the [Smart Agent Receiver](../../receiver/smartagentreceiver/README.md) but are applicable to all instances. This component provides a means of migrating your existing -[Smart Agent configuration](https://docs.signalfx.com/en/latest/integrations/agent/config-schema.html#config-schema) +[Smart Agent configuration](https://docs.splunk.com/observability/en/gdi/smart-agent/smart-agent-resources.html#configure-the-smart-agent) to the Splunk Distribution of OpenTelemetry Collector. As the Smart Agent Receiver doesn't provide 1:1 functional parity with the SignalFx Smart Agent in itself, @@ -15,7 +15,7 @@ only a subset of existing configuration fields are supported by the Smart Agent 1. The `bundleDir` field refers to the path of a supported Smart Agent release bundle. The x86_64/amd64 Splunk Distribution of OpenTelemetry Collector packages include the agent bundle, and their installers source its value via the `SPLUNK_BUNDLE_DIR` environment variable by default. -1. The [`collectd`](https://docs.signalfx.com/en/latest/integrations/agent/config-schema.html#collectd) +1. The [`collectd`](https://docs.splunk.com/observability/en/gdi/opentelemetry/smart-agent-migration-monitors.html#smart-agent-extension) field refers to performance and debugging configurables for the collectd subprocess and associated mechanisms. If the Smart Agent Extension or this field are not configured, the Agent defaults will be inherited. This configuration object's `configDir` refers to the location for internal configuration files and is set to the value From bcbc209048cfd27a417c4b2e4562cc4873ed57fd Mon Sep 17 00:00:00 2001 From: Samiur Arif Date: Tue, 26 Sep 2023 14:06:42 -0700 Subject: [PATCH 44/55] removed more dead code. (#3706) --- internal/signalfx-agent/pkg/utils/ids.go | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 internal/signalfx-agent/pkg/utils/ids.go diff --git a/internal/signalfx-agent/pkg/utils/ids.go b/internal/signalfx-agent/pkg/utils/ids.go deleted file mode 100644 index 776895ad4d..0000000000 --- a/internal/signalfx-agent/pkg/utils/ids.go +++ /dev/null @@ -1,21 +0,0 @@ -package utils - -import ( - "strconv" - "sync" -) - -// NewIDGenerator returns a function that will produce, for any given generator -// instance, a unique, non-empty, string value each time it is called. -func NewIDGenerator() func() string { - lock := sync.Mutex{} - nextID := 0 - - return func() string { - lock.Lock() - defer lock.Unlock() - - nextID++ - return strconv.Itoa(nextID) - } -} From 6bc03b237b2be4261da4be9a1c6603cba0d89529 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Tue, 26 Sep 2023 14:06:51 -0700 Subject: [PATCH 45/55] Remove observer manager and utils (#3702) --- go.mod | 2 - go.sum | 5 - internal/signalfx-agent/go.mod | 3 - internal/signalfx-agent/go.sum | 6 - .../pkg/core/common/dpmeta/dps.go | 7 - .../signalfx-agent/pkg/core/config/text.go | 101 -------- .../pkg/observers/diagnostics.go | 26 --- .../signalfx-agent/pkg/observers/manager.go | 147 ------------ .../signalfx-agent/pkg/observers/observer.go | 23 -- .../pkg/observers/servicediffer_test.go | 1 - .../signalfx-agent/pkg/utils/datapoints.go | 64 ----- internal/signalfx-agent/pkg/utils/maps.go | 58 ----- internal/signalfx-agent/pkg/utils/math.go | 8 - .../signalfx-agent/pkg/utils/reflection.go | 50 ---- internal/signalfx-agent/pkg/utils/regexp.go | 38 --- internal/signalfx-agent/pkg/utils/spans.go | 86 ------- .../signalfx-agent/pkg/utils/spans_test.go | 88 ------- internal/signalfx-agent/pkg/utils/strings.go | 28 --- .../pkg/utils/structtags/copy_to.go | 82 ------- .../pkg/utils/structtags/copy_to_test.go | 221 ------------------ internal/signalfx-agent/pkg/utils/yaml.go | 14 -- pkg/extension/smartagentextension/go.mod | 2 - pkg/extension/smartagentextension/go.sum | 5 - pkg/receiver/smartagentreceiver/go.mod | 2 - pkg/receiver/smartagentreceiver/go.sum | 5 - 25 files changed, 1072 deletions(-) delete mode 100644 internal/signalfx-agent/pkg/core/config/text.go delete mode 100644 internal/signalfx-agent/pkg/observers/diagnostics.go delete mode 100644 internal/signalfx-agent/pkg/observers/manager.go delete mode 100644 internal/signalfx-agent/pkg/observers/servicediffer_test.go delete mode 100644 internal/signalfx-agent/pkg/utils/spans.go delete mode 100644 internal/signalfx-agent/pkg/utils/spans_test.go delete mode 100644 internal/signalfx-agent/pkg/utils/structtags/copy_to.go delete mode 100644 internal/signalfx-agent/pkg/utils/structtags/copy_to_test.go diff --git a/go.mod b/go.mod index 50ac847435..92a2984fc7 100644 --- a/go.mod +++ b/go.mod @@ -384,7 +384,6 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mattn/go-xmlrpc v0.0.3 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/miekg/dns v1.1.55 // indirect @@ -407,7 +406,6 @@ require ( github.com/mwielbut/pointy v1.1.0 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/oklog/run v1.1.0 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.85.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.85.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.85.0 // indirect diff --git a/go.sum b/go.sum index 981948f544..f44541b7d8 100644 --- a/go.sum +++ b/go.sum @@ -987,8 +987,6 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-xmlrpc v0.0.3 h1:Y6WEMLEsqs3RviBrAa1/7qmbGB7DVD3brZIbqMbQdGY= github.com/mattn/go-xmlrpc v0.0.3/go.mod h1:mqc2dz7tP5x5BKlCahN/n+hs7OSZKJkS9JsHNBRlrxA= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -1089,8 +1087,6 @@ github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/okta/okta-sdk-golang/v2 v2.12.1 h1:U+smE7trkHSZO8Mval3Ow85dbxawO+pMAr692VZq9gM= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -2227,7 +2223,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index f87dd255ce..7bee5b4db2 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -60,7 +60,6 @@ require ( github.com/mattn/go-xmlrpc v0.0.3 github.com/mitchellh/hashstructure v1.1.0 github.com/mongodb/go-client-mongodb-atlas v0.2.0 - github.com/olekukonko/tablewriter v0.0.5 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.27.10 github.com/openshift/api v0.0.0-20230417092139-1b2161d23365 @@ -118,7 +117,6 @@ require ( github.com/kr/pretty v0.3.1 github.com/signalfx/signalfx-agent/pkg/apm v0.0.0-00010101000000-000000000000 github.com/smartystreets/goconvey v1.8.1 - gotest.tools v2.2.0+incompatible ) require ( @@ -241,7 +239,6 @@ require ( github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/miekg/dns v1.1.43 // indirect github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index 1aa6855952..6f43015dbc 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -798,8 +798,6 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-xmlrpc v0.0.3 h1:Y6WEMLEsqs3RviBrAa1/7qmbGB7DVD3brZIbqMbQdGY= github.com/mattn/go-xmlrpc v0.0.3/go.mod h1:mqc2dz7tP5x5BKlCahN/n+hs7OSZKJkS9JsHNBRlrxA= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -881,8 +879,6 @@ github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/okta/okta-sdk-golang/v2 v2.12.1 h1:U+smE7trkHSZO8Mval3Ow85dbxawO+pMAr692VZq9gM= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1753,8 +1749,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/signalfx-agent/pkg/core/common/dpmeta/dps.go b/internal/signalfx-agent/pkg/core/common/dpmeta/dps.go index 391190113e..38b725f5f7 100644 --- a/internal/signalfx-agent/pkg/core/common/dpmeta/dps.go +++ b/internal/signalfx-agent/pkg/core/common/dpmeta/dps.go @@ -2,15 +2,8 @@ package dpmeta // constants for standard datapoint Meta fields that the agent uses const ( - // The monitor instance id - MonitorIDMeta = "signalfx-monitor-id" // The monitor type that generated the datapoint MonitorTypeMeta = "signalfx-monitor-type" - // The endpoint itself - EndpointMeta = "signalfx-endpoint" - // A hash of the configuration struct instance for the monitor instance - // that generated the datapoint. - ConfigHashMeta = "sfx-config-hash" // Should be set to true if the datapoint is not specific to the particular // host that collectd is running on (e.g. cluster wide metrics in a k8s // cluster). diff --git a/internal/signalfx-agent/pkg/core/config/text.go b/internal/signalfx-agent/pkg/core/config/text.go deleted file mode 100644 index a189e64eec..0000000000 --- a/internal/signalfx-agent/pkg/core/config/text.go +++ /dev/null @@ -1,101 +0,0 @@ -package config - -import ( - "fmt" - "reflect" - "strings" - - "github.com/signalfx/signalfx-agent/pkg/utils" - log "github.com/sirupsen/logrus" - yaml "gopkg.in/yaml.v2" -) - -// ToString converts a config struct to a pseudo-yaml text outut. If a struct -// field has the 'neverLog' tag, its value will be replaced by asterisks, or -// completely omitted if the tag value is 'omit'. -func ToString(conf interface{}) string { - if conf == nil { - return "" - } - - var out string - confValue := reflect.Indirect(reflect.ValueOf(conf)) - if !confValue.IsValid() { - return "" - } - - isSlice := confValue.Type().Kind() == reflect.Slice - if isSlice { - out := "" - for j := 0; j < confValue.Len(); j++ { - s := utils.IndentLines(ToString(confValue.Index(j).Interface()), 2) - if len(s) > 0 { - out += strings.Trim("-"+s[1:], "\n") + "\n" - } - } - return strings.Trim(out, "\n") - } - - if !utils.IsStructOrPointerToStruct(confValue.Type()) { - yamlBytes, err := yaml.Marshal(conf) - if err != nil { - log.WithError(err).Error("Could not marshal yaml for diagnostic text conversion") - return "" - } - asYaml := string(yamlBytes) - // Output empty maps as blank instead of a pair of braces - if confValue.Type().Kind() == reflect.Map && strings.HasPrefix(asYaml, "{}") { - return "" - } - - return strings.TrimSuffix(asYaml, "\n") - } - - confStruct := confValue.Type() - - for i := 0; i < confStruct.NumField(); i++ { - field := confStruct.Field(i) - - // PkgPath is empty only for exported fields, so it it's non-empty the - // field is private - if field.PkgPath != "" { - continue - } - - fieldName := utils.YAMLNameOfField(field) - - if fieldName == "" && !field.Anonymous { - continue - } - - neverLogVal, neverLogPresent := field.Tag.Lookup("neverLog") - var val string - if neverLogPresent { - if neverLogVal == "omit" { - continue - } - if v, ok := confValue.Field(i).Interface().(string); ok && v == "" { - val = "" - } else { - val = "***************" - } - } else { - val = ToString(confValue.Field(i).Interface()) - } - - // Flatten embedded struct's representation - if field.Anonymous { - out += val - continue - } - - separator := " " - if len(val) > 0 && (strings.Contains(val, "\n") || field.Type.Kind() == reflect.Map) { - separator = "\n" - val = utils.IndentLines(val, 2) - } - - out += fmt.Sprintf("%s:%s%s\n", fieldName, separator, strings.TrimSuffix(val, "\n")) - } - return out -} diff --git a/internal/signalfx-agent/pkg/observers/diagnostics.go b/internal/signalfx-agent/pkg/observers/diagnostics.go deleted file mode 100644 index 43602ba626..0000000000 --- a/internal/signalfx-agent/pkg/observers/diagnostics.go +++ /dev/null @@ -1,26 +0,0 @@ -package observers - -import ( - "fmt" - "strings" - - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/golib/v3/sfxclient" -) - -// DiagnosticText outputs human-readable text about the active observers. -func (om *ObserverManager) DiagnosticText() string { - observerTypes := make([]string, len(om.observers)) - for i := range om.observers { - observerTypes[i] = om.observers[i]._type - } - return fmt.Sprintf("Observers active: %s", strings.Join(observerTypes, ", ")) -} - -// InternalMetrics returns a list of datapoints relevant to the internal status -// of Observers -func (om *ObserverManager) InternalMetrics() []*datapoint.Datapoint { - return []*datapoint.Datapoint{ - sfxclient.Gauge("sfxagent.active_observers", nil, int64(len(om.observers))), - } -} diff --git a/internal/signalfx-agent/pkg/observers/manager.go b/internal/signalfx-agent/pkg/observers/manager.go deleted file mode 100644 index 36483d5f32..0000000000 --- a/internal/signalfx-agent/pkg/observers/manager.go +++ /dev/null @@ -1,147 +0,0 @@ -package observers - -import ( - "reflect" - "sync" - - log "github.com/sirupsen/logrus" - - "github.com/signalfx/signalfx-agent/pkg/core/config" -) - -// ObserverWrapper represents an active observer -type ObserverWrapper struct { - instance interface{} - _type string - // May be blank - lastConfig *config.ObserverConfig - // Marked to be shutdown or not - doomed bool -} - -// Shutdown calls Shutdown on the underlying observer instance if it implements -// it. -func (ow *ObserverWrapper) Shutdown() { - if sh, ok := ow.instance.(Shutdownable); ok { - sh.Shutdown() - } -} - -// ObserverManager instantiates and manages the configured observers -type ObserverManager struct { - observers []*ObserverWrapper - lock sync.Mutex - // Where to send observer notifications to - CallbackTargets *ServiceCallbacks -} - -func (om *ObserverManager) makeWrappedObserver(config *config.ObserverConfig) *ObserverWrapper { - factory, ok := observerFactories[config.Type] - if !ok { - log.WithFields(log.Fields{ - "observerType": config.Type, - }).Error("Observer type not recognized") - return nil - } - - if om.CallbackTargets == nil || - om.CallbackTargets.Added == nil || - om.CallbackTargets.Removed == nil { - log.Fatal("om.CallbackTargets is not configured correctly, no point in observing") - } - - return &ObserverWrapper{ - instance: factory(om.CallbackTargets), - lastConfig: config, - _type: config.Type, - doomed: false, - } -} - -// Configure will do everything it can and returns any errors it encounters -// with certain observers. It is possible that some plugins might be -// configured and others not. -func (om *ObserverManager) Configure(obsConfig []config.ObserverConfig) { - om.lock.Lock() - defer om.lock.Unlock() - - if om.observers == nil { - om.observers = make([]*ObserverWrapper, 0, len(obsConfig)) - } - - om.markAllAsDoomed() - -OUTER: - for i := range obsConfig { - cfg := &obsConfig[i] - - // Find an existing observer of that same type that is marked for - // shutdown and reuse it - for _, obs := range om.observers { - if obs._type == cfg.Type && obs.doomed { - configEqual := reflect.DeepEqual(*obs.lastConfig, *cfg) - - if !configEqual { - err := configureObserver(obs.instance, cfg) - if err != nil { - log.WithFields(log.Fields{ - "error": err, - "observerType": cfg.Type, - "config": cfg, - }).Error("Could not configure observer") - - // Remains doomed if it misconfigures and isn't retried - // successfully by another config of the same type - continue OUTER - } - } - obs.doomed = false - continue OUTER - } - } - - // Couldn't reuse an existing observer so make a new one - observer := om.makeWrappedObserver(cfg) - if observer == nil { - continue - } - - if err := configureObserver(observer.instance, cfg); err != nil { - log.WithFields(log.Fields{ - "error": err, - "observerType": cfg.Type, - "config": cfg, - }).Error("Could not configure observer") - } - - om.observers = append(om.observers, observer) - } - - om.deleteDoomed() -} - -func (om *ObserverManager) markAllAsDoomed() { - for _, obs := range om.observers { - obs.doomed = true - } -} - -func (om *ObserverManager) deleteDoomed() { - // those saved from being doomed - savedObservers := []*ObserverWrapper{} - for _, ow := range om.observers { - if ow.doomed { - ow.Shutdown() - } else { - savedObservers = append(savedObservers, ow) - } - } - om.observers = savedObservers -} - -// Shutdown all of the managed observers -func (om *ObserverManager) Shutdown() { - for i := range om.observers { - om.observers[i].Shutdown() - } -} diff --git a/internal/signalfx-agent/pkg/observers/observer.go b/internal/signalfx-agent/pkg/observers/observer.go index bebc7b5e70..6e7aa20953 100644 --- a/internal/signalfx-agent/pkg/observers/observer.go +++ b/internal/signalfx-agent/pkg/observers/observer.go @@ -10,14 +10,9 @@ package observers import ( - "fmt" - log "github.com/sirupsen/logrus" - "github.com/signalfx/signalfx-agent/pkg/core/config" - "github.com/signalfx/signalfx-agent/pkg/core/config/validation" "github.com/signalfx/signalfx-agent/pkg/core/services" - "github.com/signalfx/signalfx-agent/pkg/utils" ) // Shutdownable describes an observer that has a shutdown routine. Observers @@ -56,21 +51,3 @@ type ServiceCallbacks struct { Added func(services.Endpoint) Removed func(services.Endpoint) } - -func configureObserver(observer interface{}, conf *config.ObserverConfig) error { - log.WithFields(log.Fields{ - "config": *conf, - }).Debug("Configuring observer") - - finalConfig := utils.CloneInterface(ConfigTemplates[conf.Type]) - - if err := config.FillInConfigTemplate("ObserverConfig", finalConfig, conf); err != nil { - return err - } - - if err := validation.ValidateCustomConfig(finalConfig); err != nil { - return fmt.Errorf("observer config is invalid: %w", err) - } - - return config.CallConfigure(observer, finalConfig) -} diff --git a/internal/signalfx-agent/pkg/observers/servicediffer_test.go b/internal/signalfx-agent/pkg/observers/servicediffer_test.go deleted file mode 100644 index 043aeb37b1..0000000000 --- a/internal/signalfx-agent/pkg/observers/servicediffer_test.go +++ /dev/null @@ -1 +0,0 @@ -package observers diff --git a/internal/signalfx-agent/pkg/utils/datapoints.go b/internal/signalfx-agent/pkg/utils/datapoints.go index a6e9164e2f..e07b90b6ea 100644 --- a/internal/signalfx-agent/pkg/utils/datapoints.go +++ b/internal/signalfx-agent/pkg/utils/datapoints.go @@ -1,61 +1,9 @@ package utils import ( - "fmt" - "sort" - "strings" - - "github.com/olekukonko/tablewriter" "github.com/signalfx/golib/v3/datapoint" ) -func sortedDimensionString(dims map[string]string) string { - var keys []string - for k := range dims { - keys = append(keys, k) - } - sort.Strings(keys) - - tableString := &strings.Builder{} - table := tablewriter.NewWriter(tableString) - - table.SetHeader(keys) - var vals []string - for _, k := range keys { - vals = append(vals, dims[k]) - } - table.Append(vals) - table.SetAutoFormatHeaders(false) - - table.Render() - return tableString.String() -} - -func dpTypeToString(t datapoint.MetricType) string { - switch t { - case datapoint.Gauge: - return "gauge" - case datapoint.Count: - return "counter" - case datapoint.Counter: - return "cumulative counter" - default: - return fmt.Sprintf("unsupported type %d", t) - } -} - -// DatapointToString pretty prints a datapoint in a consistent manner for -// logging purposes. The most important thing here is to sort the dimension -// dict so it is consistent so that it is easier to visually scan a large list -// of datapoints. -func DatapointToString(dp *datapoint.Datapoint) string { - var tsStr string - if !dp.Timestamp.IsZero() { - tsStr = dp.Timestamp.String() - } - return fmt.Sprintf("%s: %s (%s) %s\n%s\n", dp.Metric, dp.Value, strings.ToUpper(dpTypeToString(dp.MetricType)), tsStr, sortedDimensionString(dp.Dimensions)) -} - // BoolToInt returns 1 if b is true and 0 otherwise. It is useful for // datapoints which track a binary value since we don't support boolean // datapoint directly. @@ -92,15 +40,3 @@ func SetDatapointMeta(dp *datapoint.Datapoint, name interface{}, val interface{} } dp.Meta[name] = val } - -func CloneDatapoint(dp *datapoint.Datapoint) *datapoint.Datapoint { - return datapoint.NewWithMeta(dp.Metric, CloneStringMap(dp.Dimensions), CloneFullInterfaceMap(dp.Meta), dp.Value, dp.MetricType, dp.Timestamp) -} - -func CloneDatapointSlice(dps []*datapoint.Datapoint) []*datapoint.Datapoint { - out := make([]*datapoint.Datapoint, len(dps)) - for i := range dps { - out[i] = CloneDatapoint(dps[i]) - } - return out -} diff --git a/internal/signalfx-agent/pkg/utils/maps.go b/internal/signalfx-agent/pkg/utils/maps.go index 4b13eda854..67715e9d38 100644 --- a/internal/signalfx-agent/pkg/utils/maps.go +++ b/internal/signalfx-agent/pkg/utils/maps.go @@ -3,7 +3,6 @@ package utils import ( "fmt" - "sort" "github.com/iancoleman/strcase" ) @@ -96,32 +95,6 @@ func CloneFullInterfaceMap(m map[interface{}]interface{}) map[interface{}]interf return m2 } -// CloneAndFilterStringMapWithFunc clones a string map and only includes -// key/value pairs for which the filter function returns true -func CloneAndFilterStringMapWithFunc(in map[string]string, filter func(string, string) bool) (out map[string]string) { - out = make(map[string]string, len(in)) - for k, v := range in { - if filter(k, v) { - out[k] = v - } - } - return out -} - -// CloneAndExcludeStringMapByKey clones a string map excluding the specified keys -func CloneAndExcludeStringMapByKey(in map[string]string, exclude map[string]bool) map[string]string { - if len(exclude) == 0 { - return CloneStringMap(in) - } - var out = make(map[string]string, len(in)) - for k, v := range in { - if exclude[k] { - out[k] = v - } - } - return out -} - // InterfaceMapToStringMap converts a map[interface{}]interface{} to a // map[string]string. Keys and values will be converted with fmt.Sprintf so // the original key/values don't have to be strings. @@ -133,21 +106,6 @@ func InterfaceMapToStringMap(m map[interface{}]interface{}) map[string]string { return out } -// SortMapKeys returns a slice of all of the keys of a map sorted -// alphabetically ascending. -func SortMapKeys(m map[string]interface{}) []string { - if len(m) == 0 { - return nil - } - - keys := make([]string, 0, len(m)) - for k := range m { - keys = append(keys, k) - } - sort.Strings(keys) - return keys -} - // StringInterfaceMapToAllInterfaceMap converts a map[string]interface{} to a // map[interface{}]interface{} func StringInterfaceMapToAllInterfaceMap(in map[string]interface{}) map[interface{}]interface{} { @@ -158,22 +116,6 @@ func StringInterfaceMapToAllInterfaceMap(in map[string]interface{}) map[interfac return out } -// FormatStringMapCompact formats a string map as a string in a compact form -func FormatStringMapCompact(in map[string]string) string { - out := "{" - - for k, v := range in { - out += k + ": " + v + ", " - } - - if len(in) > 0 { - // Strip last comma - out = out[:len(out)-2] - } - - return out + "}" -} - func StringInterfaceMapToStringMap(in map[string]interface{}) map[string]string { out := make(map[string]string, len(in)) for k, v := range in { diff --git a/internal/signalfx-agent/pkg/utils/math.go b/internal/signalfx-agent/pkg/utils/math.go index 853d5caf6a..918ad7d77b 100644 --- a/internal/signalfx-agent/pkg/utils/math.go +++ b/internal/signalfx-agent/pkg/utils/math.go @@ -7,11 +7,3 @@ func MaxInt(x, y int) int { } return y } - -// MinInt returns the lesser of x and y -func MinInt(x, y int) int { - if x < y { - return x - } - return y -} diff --git a/internal/signalfx-agent/pkg/utils/reflection.go b/internal/signalfx-agent/pkg/utils/reflection.go index 467fe22376..b3201ab936 100644 --- a/internal/signalfx-agent/pkg/utils/reflection.go +++ b/internal/signalfx-agent/pkg/utils/reflection.go @@ -2,22 +2,6 @@ package utils import "reflect" -// CloneInterface takes an object and returns a copy of it regardless of -// whether it is really a pointer underneath or not. It is roughly equivalent -// to the following: -// b = *a (if 'a' is a pointer) -// b = a (if 'a' is not a pointer) -func CloneInterface(a interface{}) interface{} { - va := reflect.ValueOf(a) - indirect := reflect.Indirect(va) - new := reflect.New(indirect.Type()) - new.Elem().Set(reflect.ValueOf(indirect.Interface())) - if va.Kind() == reflect.Ptr { - return new.Interface() - } - return new.Elem().Interface() -} - // GetStructFieldNames returns a slice with the names of all of the fields in // the struct `s`. This will panic if `s` is not a struct. func GetStructFieldNames(s interface{}) []string { @@ -31,32 +15,6 @@ func GetStructFieldNames(s interface{}) []string { return out } -// FindFieldWithEmbeddedStructs will look for a field with the given name, -// recursing down into embedded structs if there are any. -func FindFieldWithEmbeddedStructs(st interface{}, name string, typ reflect.Type) reflect.Value { - instanceValue := reflect.Indirect(reflect.ValueOf(st)) - fieldValue := instanceValue.FieldByName(name) - - if !fieldValue.IsValid() || fieldValue.Type() != typ { - embeddedValues := make([]reflect.Value, 0) - - for i := 0; i < instanceValue.Type().NumField(); i++ { - field := instanceValue.Type().Field(i) - if field.Type.Kind() == reflect.Struct && field.Anonymous && instanceValue.Field(i).CanSet() { - embeddedValues = append(embeddedValues, - FindFieldWithEmbeddedStructs(instanceValue.Field(i).Interface(), name, typ)) - } - } - for _, v := range embeddedValues { - if v.IsValid() { - return v - } - } - return reflect.ValueOf(nil) - } - return fieldValue -} - func FindFirstFieldOfType(st interface{}, typ reflect.Type) reflect.Value { val := reflect.Indirect(reflect.ValueOf(st)) for i := 0; i < val.NumField(); i++ { @@ -66,11 +24,3 @@ func FindFirstFieldOfType(st interface{}, typ reflect.Type) reflect.Value { } return reflect.ValueOf(nil) } - -// IsStructOrPointerToStruct returns true if the given reflect.Type is a -// struct or pointer to a struct -func IsStructOrPointerToStruct(typ reflect.Type) bool { - isStruct := typ.Kind() == reflect.Struct - isPtrToStruct := typ.Kind() == reflect.Ptr && typ.Elem().Kind() == reflect.Struct - return isStruct || isPtrToStruct -} diff --git a/internal/signalfx-agent/pkg/utils/regexp.go b/internal/signalfx-agent/pkg/utils/regexp.go index ca6e47d153..78d22ff91f 100644 --- a/internal/signalfx-agent/pkg/utils/regexp.go +++ b/internal/signalfx-agent/pkg/utils/regexp.go @@ -1,9 +1,7 @@ package utils import ( - "fmt" "regexp" - "strings" ) // RegexpGroupMap matches text against the given regexp and returns a map of @@ -19,39 +17,3 @@ func RegexpGroupMap(re *regexp.Regexp, text string) map[string]string { } return nil } - -// FindMatchString compares a string to an array of regular expressions and returns -// whether the string matches any of the expressions -func FindMatchString(in string, regexps []*regexp.Regexp) bool { - for _, r := range regexps { - if r.MatchString(in) { - return true - } - } - return false -} - -// RegexpStringsToRegexp - Converts an array of strings formatted with "/.../" to an array of *regexp.Regexp -// or and returns any plain strings as a map[string]struct{} -func RegexpStringsToRegexp(regexpStrings []string) ([]*regexp.Regexp, map[string]struct{}, []error) { - regexes := make([]*regexp.Regexp, 0, len(regexpStrings)) - strs := make(map[string]struct{}, len(regexpStrings)) - errors := []error{} - // compile mountpoint regexes - for _, r := range regexpStrings { - var regexString string - if strings.HasPrefix(r, "/") && strings.HasSuffix(r, "/") { - regexString = strings.TrimPrefix(strings.TrimSuffix(r, "/"), "/") - exp, err := regexp.Compile(regexString) - if err != nil { - errors = append(errors, fmt.Errorf("failed to compile regexp '%s'", r)) - continue - } - regexes = append(regexes, exp) - } else { - strs[r] = struct{}{} - } - - } - return regexes, strs, errors -} diff --git a/internal/signalfx-agent/pkg/utils/spans.go b/internal/signalfx-agent/pkg/utils/spans.go deleted file mode 100644 index a19e305bce..0000000000 --- a/internal/signalfx-agent/pkg/utils/spans.go +++ /dev/null @@ -1,86 +0,0 @@ -package utils - -import ( - "github.com/signalfx/golib/v3/pointer" - "github.com/signalfx/golib/v3/trace" -) - -// CloneSpanSlice creates a clone of an array of trace spans. -func CloneSpanSlice(spans []*trace.Span) []*trace.Span { - out := make([]*trace.Span, len(spans)) - for i := range spans { - out[i] = CloneSpan(spans[i]) - } - return out -} - -// CloneSpan creates a copy of a span. -func CloneSpan(span *trace.Span) *trace.Span { - newAnnotations := make([]*trace.Annotation, len(span.Annotations)) - for i, annotation := range span.Annotations { - newAnnotations[i] = &(*annotation) - } - var parentID *string - if span.ParentID == nil { - parentID = nil - } else { - parentID = pointer.String(*span.ParentID) - } - var debug *bool - if span.Debug != nil { - debug = pointer.Bool(*span.Debug) - } else { - debug = nil - } - var shared *bool - if span.Shared != nil { - shared = pointer.Bool(*span.Shared) - } else { - shared = nil - } - - return &trace.Span{ - TraceID: span.TraceID, - Name: pointer.String(*span.Name), - ParentID: parentID, - ID: span.ID, - Timestamp: pointer.Int64(*span.Timestamp), - Duration: pointer.Int64(*span.Duration), - Debug: debug, - Shared: shared, - LocalEndpoint: cloneEndpoint(span.LocalEndpoint), - RemoteEndpoint: cloneEndpoint(span.RemoteEndpoint), - Annotations: newAnnotations, - Tags: CloneStringMap(span.Tags), - Meta: CloneFullInterfaceMap(span.Meta), - } -} - -func cloneEndpoint(endpoint *trace.Endpoint) *trace.Endpoint { - if endpoint == nil { - return nil - } - - var serviceName *string - if endpoint.ServiceName != nil { - serviceName = pointer.String(*endpoint.ServiceName) - } - var ipv4 *string - if endpoint.Ipv4 != nil { - ipv4 = pointer.String(*endpoint.Ipv4) - } - var ipv6 *string - if endpoint.Ipv6 != nil { - ipv6 = pointer.String(*endpoint.Ipv6) - } - var port *int32 - if endpoint.Port != nil { - port = pointer.Int32(*endpoint.Port) - } - return &trace.Endpoint{ - ServiceName: serviceName, - Ipv4: ipv4, - Ipv6: ipv6, - Port: port, - } -} diff --git a/internal/signalfx-agent/pkg/utils/spans_test.go b/internal/signalfx-agent/pkg/utils/spans_test.go deleted file mode 100644 index ef718c4f01..0000000000 --- a/internal/signalfx-agent/pkg/utils/spans_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package utils - -import ( - "testing" - - "github.com/signalfx/golib/v3/trace" - "gotest.tools/assert" -) - -func TestSpanClone(t *testing.T) { - name := "foo" - localhost := "127.0.0.1" - parentID := "parentID" - kind := "server" - ts := int64(300000) - duration := int64(40) - boolfalse := false - annotations := []*trace.Annotation{{ - Timestamp: &duration, - Value: &name, - }} - span := trace.Span{ - TraceID: "12345", - Name: &name, - ParentID: &parentID, - ID: "myID", - Kind: &kind, - Timestamp: &ts, - Duration: &duration, - Debug: &boolfalse, - Shared: &boolfalse, - LocalEndpoint: &trace.Endpoint{ - ServiceName: &name, - Ipv4: &localhost, - }, - RemoteEndpoint: nil, - Annotations: annotations, - Tags: map[string]string{"foo": "bar"}, - Meta: map[interface{}]interface{}{"foo": "bar"}, - } - clone := CloneSpan(&span) - assert.Equal(t, span.TraceID, clone.TraceID) - assert.Equal(t, *span.ParentID, *clone.ParentID) - assert.Equal(t, *span.LocalEndpoint.ServiceName, *clone.LocalEndpoint.ServiceName) - assert.Equal(t, *span.LocalEndpoint.Ipv4, *clone.LocalEndpoint.Ipv4) - assert.DeepEqual(t, span.Tags, clone.Tags) - assert.Equal(t, *span.Shared, *clone.Shared) -} - -func TestSpanIncompleteClone(t *testing.T) { - name := "foo" - localhost := "127.0.0.1" - parentID := "parentID" - kind := "server" - ts := int64(300000) - duration := int64(40) - boolfalse := false - annotations := []*trace.Annotation{{ - Timestamp: &duration, - Value: &name, - }} - span := trace.Span{ - TraceID: "12345", - Name: &name, - ParentID: &parentID, - ID: "myID", - Kind: &kind, - Timestamp: &ts, - Duration: &duration, - Debug: nil, - Shared: &boolfalse, - LocalEndpoint: &trace.Endpoint{ - ServiceName: &name, - Ipv4: &localhost, - }, - RemoteEndpoint: nil, - Annotations: annotations, - Tags: map[string]string{"foo": "bar"}, - Meta: map[interface{}]interface{}{"foo": "bar"}, - } - clone := CloneSpan(&span) - assert.Equal(t, span.TraceID, clone.TraceID) - assert.Equal(t, *span.ParentID, *clone.ParentID) - assert.Equal(t, *span.LocalEndpoint.ServiceName, *clone.LocalEndpoint.ServiceName) - assert.Equal(t, *span.LocalEndpoint.Ipv4, *clone.LocalEndpoint.Ipv4) - assert.DeepEqual(t, span.Tags, clone.Tags) - assert.Equal(t, *span.Shared, *clone.Shared) -} diff --git a/internal/signalfx-agent/pkg/utils/strings.go b/internal/signalfx-agent/pkg/utils/strings.go index 2852ccf63a..88c4656669 100644 --- a/internal/signalfx-agent/pkg/utils/strings.go +++ b/internal/signalfx-agent/pkg/utils/strings.go @@ -5,7 +5,6 @@ import ( "bytes" "errors" "io" - "regexp" "strings" "unicode" ) @@ -55,33 +54,6 @@ func LowercaseFirstChar(s string) string { return "" } -// StripIndent looks at the first line in s and strips off whatever whitespace -// indentation it has from every line in s. If subsequent lines do not start -// with the same indentation as the first line, results are undefined. -// If the first line is blank, it will be removed before processing. -func StripIndent(s string) string { - lines := strings.Split(strings.TrimLeft(s, "\n"), "\n") - re := regexp.MustCompile(`^(\s+)`) - matches := re.FindStringSubmatch(lines[0]) - if len(matches) > 0 { - indent := matches[1] - for i := range lines { - lines[i] = strings.Replace(lines[i], indent, "", 1) - } - } - - return strings.TrimSpace(strings.Join(lines, "\n")) -} - -// EnsurePrefix ensures that string s starts with the given prefix. If it -// already starts with that prefix, the original string is returned unaltered. -func EnsurePrefix(s, prefix string) string { - if strings.HasPrefix(s, prefix) { - return s - } - return prefix + s -} - // ChunkScanner looks for a line and all subsequent indented lines and // returns a scanner that will output that chunk as a single token. This // assumes that the entire chunk comes in a single read call, which will not diff --git a/internal/signalfx-agent/pkg/utils/structtags/copy_to.go b/internal/signalfx-agent/pkg/utils/structtags/copy_to.go deleted file mode 100644 index 5cf1acf2c1..0000000000 --- a/internal/signalfx-agent/pkg/utils/structtags/copy_to.go +++ /dev/null @@ -1,82 +0,0 @@ -package structtags - -import ( - "fmt" - "reflect" - "runtime" - "strings" -) - -const ( - copyToTag = "copyTo" -) - -// CopyTo - -func CopyTo(ptr interface{}) error { - - v := reflect.ValueOf(ptr).Elem() - t := v.Type() - - for i := 0; i < t.NumField(); i++ { - if val := t.Field(i).Tag.Get(copyToTag); val != "-" && val != "" { - var targets []string - - // initialize with tag value - var groups = []string{val} - - // break apart targets and os commands - if strings.Contains(val, ",GOOS=") { - groups = strings.Split(val, ",GOOS=") - } - - // break apart the targets - targets = strings.Split(groups[0], ",") - - // check os eligibility - eligibleOS := true - if len(groups) == 2 { - eligibleOS = isOSEligible(groups[1]) - } - - // if eligible copy the value to the targets - if eligibleOS { - for _, target := range targets { - sourceField := v.Field(i) - targetField := v.FieldByName(target) - if targetField.CanSet() && sourceField.Kind() == targetField.Kind() { - targetField.Set(v.Field(i)) - } else { - return fmt.Errorf("unable to copy struct %v to target %s", sourceField, target) - } - } - } - } - } - return nil -} - -// isOSEligible - determines if the os is eligible from the array of strings -func isOSEligible(osString string) bool { - // if the os string is empty - if osString == "" { - return true - } - // check if the current os is explicitly excluded Ex. "!windows" - if strings.Contains(osString, fmt.Sprintf("!%s", runtime.GOOS)) { - return false - } - // check if the os is explicitly included Ex. "windows" - if strings.Contains(osString, runtime.GOOS) { - return true - } - // check for explicitly defined operating systems Ex. windows != "linux" - operatingSystems := strings.Split(osString, ",") - for _, f := range operatingSystems { - if !strings.Contains(f, "!") { - return false - } - } - // any explicitly listed oses were exclusionary - // and the runtime operating system doesn't match any of them - return true -} diff --git a/internal/signalfx-agent/pkg/utils/structtags/copy_to_test.go b/internal/signalfx-agent/pkg/utils/structtags/copy_to_test.go deleted file mode 100644 index 5cf47e2376..0000000000 --- a/internal/signalfx-agent/pkg/utils/structtags/copy_to_test.go +++ /dev/null @@ -1,221 +0,0 @@ -package structtags - -import ( - "fmt" - "runtime" - "testing" -) - -type testCopyAllPlatforms struct { - DiagnosticsServerPath string `yaml:"diagnosticsServerPath" copyTo:"-"` - DiagnosticsServerNamedPipePath string `yaml:"-" copyTo:"DiagnosticsServerPath,GOOS=android,darwin,dragonfly,freebsd,!notARealOS,linux,nacl,netbsd,openbsd,plan9,solaris,windows"` - DiagnosticsSocketPath string `yaml:"-" copyTo:"DiagnosticsServerPath,GOOS=!android,!darwin,!dragonfly,!freebsd,notARealOS,!linux,!nacl,!netbsd,!openbsd,!plan9,!solaris,!windows"` -} - -func (c testCopyAllPlatforms) getResult() string { - return c.DiagnosticsServerPath -} -func (c testCopyAllPlatforms) getDesired() string { - return c.DiagnosticsServerNamedPipePath -} - -type testCopyNoPlatforms struct { - DiagnosticsServerPath string `copyTo:"-"` - DiagnosticsServerNamedPipePath string `copyTo:"DiagnosticsServerPath,GOOS="` - DiagnosticsSocketPath string `copyTo:"DiagnosticsServerPath,GOOS=!android,!darwin,!dragonfly,!freebsd,notARealOS,!linux,!nacl,!netbsd,!openbsd,!plan9,!solaris,!windows"` -} - -func (c testCopyNoPlatforms) getResult() string { - return c.DiagnosticsServerPath -} -func (c testCopyNoPlatforms) getDesired() string { - return c.DiagnosticsServerNamedPipePath -} - -type testCopyMultipleTargets struct { - DiagnosticsServerPath string `copyTo:"-"` - DiagnosticsServerPath2 string `copyTo:"-"` - DiagnosticsServerNamedPipePath string `copyTo:"DiagnosticsServerPath,DiagnosticsServerPath2,GOOS="` - DiagnosticsSocketPath string `copyTo:"DiagnosticsServerPath,GOOS=!android,!darwin,!dragonfly,!freebsd,notARealOS,!linux,!nacl,!netbsd,!openbsd,!plan9,!solaris,!windows"` -} - -func (c testCopyMultipleTargets) getResult() string { - return fmt.Sprintf("%s:%s", c.DiagnosticsServerPath, c.DiagnosticsServerPath2) -} -func (c testCopyMultipleTargets) getDesired() string { - return fmt.Sprintf("%s:%s", c.DiagnosticsServerNamedPipePath, c.DiagnosticsServerNamedPipePath) -} - -type testIncompatibleTypes struct { - DiagnosticsServerPath int `copyTo:"-"` - DiagnosticsServerPath2 string `copyTo:"-"` - DiagnosticsServerNamedPipePath string `copyTo:"DiagnosticsServerPath,DiagnosticsServerPath2,GOOS="` - DiagnosticsSocketPath string `copyTo:"DiagnosticsServerPath,GOOS=!android,!darwin,!dragonfly,!freebsd,notARealOS,!linux,!nacl,!netbsd,!openbsd,!plan9,!solaris,!windows"` -} - -func (c testIncompatibleTypes) getResult() string { - return fmt.Sprintf("%v", c.DiagnosticsServerPath) -} -func (c testIncompatibleTypes) getDesired() string { - return fmt.Sprintf("2") -} - -type nonExistentTarget struct { - DiagnosticsServerPath string `copyTo:"-"` - DiagnosticsServerNamedPipePath string `copyTo:"DiagnosticsServerPath,DiagnosticsServerPath2,GOOS="` - DiagnosticsSocketPath string `copyTo:"DiagnosticsServerPath,GOOS=!android,!darwin,!dragonfly,!freebsd,notARealOS,!linux,!nacl,!netbsd,!openbsd,!plan9,!solaris,!windows"` -} - -func (c nonExistentTarget) getResult() string { - return c.DiagnosticsServerPath -} -func (c nonExistentTarget) getDesired() string { - return c.DiagnosticsServerNamedPipePath -} - -type testInput interface { - getResult() string - getDesired() string -} - -func TestCopyTo(t *testing.T) { - type args struct { - s testInput - } - tests := []struct { - name string - args args - wantEr bool - }{ - { - name: "test copy all platforms", - args: args{ - s: &testCopyAllPlatforms{ - DiagnosticsServerNamedPipePath: "all platforms except the fake one", - DiagnosticsSocketPath: "no platforms except the fake one", - }, - }, - wantEr: false, - }, - { - name: "test copy no platforms specified", - args: args{ - s: &testCopyNoPlatforms{ - DiagnosticsServerNamedPipePath: "all platforms", - DiagnosticsSocketPath: "no platforms except the fake one", - }, - }, - wantEr: false, - }, - { - name: "test copy to multiple targets", - args: args{ - s: &testCopyMultipleTargets{ - DiagnosticsServerNamedPipePath: "all platforms", - DiagnosticsSocketPath: "no platforms except the fake one", - }, - }, - wantEr: false, - }, - { - name: "test incompatible target type", - args: args{ - s: &testIncompatibleTypes{ - DiagnosticsServerPath: 2, - DiagnosticsServerNamedPipePath: "all platforms", - DiagnosticsSocketPath: "no platforms except the fake one", - }, - }, - wantEr: true, - }, - { - name: "test nonexistent target", - args: args{ - s: &nonExistentTarget{ - DiagnosticsServerNamedPipePath: "all platforms", - DiagnosticsSocketPath: "no platforms except the fake one", - }, - }, - wantEr: true, - }, - } - for _, tt := range tests { - args := tt.args - wantErr := tt.wantEr - t.Run(tt.name, func(t *testing.T) { - if err := CopyTo(args.s); (err != nil) != wantErr { - t.Errorf("CopyTo() error = %v wanted = %v", err, wantErr) - } else { - result := args.s.(testInput).getResult() - desired := args.s.(testInput).getDesired() - t.Logf("result: %v desired: %v", result, desired) - if result != desired { - t.Errorf(fmt.Sprintf("CopyTo() DiagnosticsServerPath != %s", desired)) - } - } - }) - } -} - -func Test_isOSEligible(t *testing.T) { - type args struct { - OSString string - } - tests := []struct { - name string - args args - want bool - }{ - { - name: "IsEligible", - args: args{ - OSString: runtime.GOOS, - }, - want: true, - }, - { - name: "IsEligibleBlank", - args: args{ - OSString: "", - }, - want: true, - }, - { - name: "IsElligibleOtherOSExcluded", - args: args{ - OSString: "!notARealOS", - }, - want: true, - }, - { - name: "IsElligibleOtherOSExcludedExplicitlyIncluded", - args: args{ - OSString: fmt.Sprintf("!notARealOS,%s", runtime.GOOS), - }, - want: true, - }, - { - name: "NotEligible", - args: args{ - OSString: fmt.Sprintf("!%s", runtime.GOOS), - }, - want: false, - }, - { - name: "NotElligibleExplicitOSDeclaration", - args: args{ - OSString: "notARealOS", - }, - want: false, - }, - } - for _, tt := range tests { - args := tt.args - want := tt.want - t.Run(tt.name, func(t *testing.T) { - if got := isOSEligible(args.OSString); got != want { - t.Errorf("isOSEligible() = %v, want %v", got, want) - } - }) - } -} diff --git a/internal/signalfx-agent/pkg/utils/yaml.go b/internal/signalfx-agent/pkg/utils/yaml.go index 23a6f9fdce..410b5ba636 100644 --- a/internal/signalfx-agent/pkg/utils/yaml.go +++ b/internal/signalfx-agent/pkg/utils/yaml.go @@ -46,20 +46,6 @@ func YAMLNameOfField(field reflect.StructField) string { return parts[0] } -// YAMLNameOfFieldInStruct returns the YAML key that is used for the given -// struct field, looking up fieldName in the given st struct. If the field has -// no key (e.g. if the `yaml:"-"` tag is set, this will return an empty string. -// It uses YAMLNameOfField under the covers. If st is not a struct, this will -// panic. -func YAMLNameOfFieldInStruct(fieldName string, st interface{}) string { - stType := reflect.Indirect(reflect.ValueOf(st)).Type() - field, ok := stType.FieldByName(fieldName) - if !ok { - return "" - } - return YAMLNameOfField(field) -} - var yamlLineNumberRE = regexp.MustCompile(`line (\d+): `) // ParseLineNumberFromYAMLError takes an error message nested in yaml.TypeError diff --git a/pkg/extension/smartagentextension/go.mod b/pkg/extension/smartagentextension/go.mod index 7e151b7084..4afc3b5946 100644 --- a/pkg/extension/smartagentextension/go.mod +++ b/pkg/extension/smartagentextension/go.mod @@ -92,7 +92,6 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -107,7 +106,6 @@ require ( github.com/morikuni/aec v1.0.0 // indirect github.com/mostynb/go-grpc-compression v1.2.0 // indirect github.com/oklog/run v1.1.0 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect github.com/opencontainers/runc v1.1.6 // indirect diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index 1b5da98f0e..0f545826ce 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -449,8 +449,6 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -507,8 +505,6 @@ github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/okta/okta-sdk-golang/v2 v2.12.1 h1:U+smE7trkHSZO8Mval3Ow85dbxawO+pMAr692VZq9gM= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8= @@ -927,7 +923,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index c36b41aa8a..e362b45a8b 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -190,7 +190,6 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mattn/go-xmlrpc v0.0.3 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/miekg/dns v1.1.50 // indirect @@ -214,7 +213,6 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwielbut/pointy v1.1.0 // indirect github.com/oklog/run v1.1.0 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.85.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.85.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index de12ab2aa2..b99e3d2dda 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -805,8 +805,6 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-xmlrpc v0.0.3 h1:Y6WEMLEsqs3RviBrAa1/7qmbGB7DVD3brZIbqMbQdGY= github.com/mattn/go-xmlrpc v0.0.3/go.mod h1:mqc2dz7tP5x5BKlCahN/n+hs7OSZKJkS9JsHNBRlrxA= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -891,8 +889,6 @@ github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/okta/okta-sdk-golang/v2 v2.12.1 h1:U+smE7trkHSZO8Mval3Ow85dbxawO+pMAr692VZq9gM= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -1704,7 +1700,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 0291d53251abfb6248f43eeb53929de342b6c70f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 12:45:48 -0400 Subject: [PATCH 46/55] Bump google.golang.org/grpc from 1.58.1 to 1.58.2 in /internal/signalfx-agent (#3694) * Bump google.golang.org/grpc in /internal/signalfx-agent Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.58.1 to 1.58.2. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.58.1...v1.58.2) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- go.mod | 2 +- go.sum | 4 ++-- internal/signalfx-agent/go.mod | 2 +- internal/signalfx-agent/go.sum | 4 ++-- pkg/extension/smartagentextension/go.mod | 2 +- pkg/extension/smartagentextension/go.sum | 4 ++-- pkg/receiver/smartagentreceiver/go.mod | 2 +- pkg/receiver/smartagentreceiver/go.sum | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 92a2984fc7..7b005e0724 100644 --- a/go.mod +++ b/go.mod @@ -502,7 +502,7 @@ require ( google.golang.org/api v0.139.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect - google.golang.org/grpc v1.58.1 // indirect + google.golang.org/grpc v1.58.2 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/fsnotify.v1 v1.4.7 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect diff --git a/go.sum b/go.sum index f44541b7d8..a46ec4f1b3 100644 --- a/go.sum +++ b/go.sum @@ -2159,8 +2159,8 @@ google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= -google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= +google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index 7bee5b4db2..9b87e35ef7 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -87,7 +87,7 @@ require ( golang.org/x/sync v0.3.0 golang.org/x/sys v0.12.0 golang.org/x/tools v0.9.3 // indirect - google.golang.org/grpc v1.58.1 + google.golang.org/grpc v1.58.2 gopkg.in/go-playground/validator.v9 v9.31.0 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.28.2 diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index 6f43015dbc..fddfe89b40 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -1690,8 +1690,8 @@ google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= -google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= +google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/pkg/extension/smartagentextension/go.mod b/pkg/extension/smartagentextension/go.mod index 4afc3b5946..997156c8fc 100644 --- a/pkg/extension/smartagentextension/go.mod +++ b/pkg/extension/smartagentextension/go.mod @@ -173,7 +173,7 @@ require ( google.golang.org/api v0.138.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect - google.golang.org/grpc v1.58.1 // indirect + google.golang.org/grpc v1.58.2 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index 0f545826ce..4327fb3d8a 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -878,8 +878,8 @@ 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.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= -google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= +google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index e362b45a8b..d413332751 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -300,7 +300,7 @@ require ( google.golang.org/api v0.138.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect - google.golang.org/grpc v1.58.1 // indirect + google.golang.org/grpc v1.58.2 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/fsnotify.v1 v1.4.7 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index b99e3d2dda..4fe023e5e2 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -1644,8 +1644,8 @@ google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= -google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= +google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From d6d2183e51658c468d7bbd4761e99d2fae866be2 Mon Sep 17 00:00:00 2001 From: Jeff Cheng <83052155+jeffreyc-splunk@users.noreply.github.com> Date: Wed, 27 Sep 2023 17:25:04 -0400 Subject: [PATCH 47/55] ansible: Include splunk.zc.method attribute for auto instrumentation (#3680) --- .github/workflows/ansible.yml | 2 +- deployments/ansible/CHANGELOG.md | 10 +++++++ deployments/ansible/galaxy.yml | 2 +- .../molecule/custom_vars/windows-converge.yml | 1 + .../molecule/custom_vars/windows-verify.yml | 1 + .../molecule/with_instrumentation/verify.yml | 2 +- .../with_instrumentation/windows-verify.yml | 15 ++++++++++ deployments/ansible/roles/collector/README.md | 7 +++++ .../ansible/roles/collector/defaults/main.yml | 1 + .../roles/collector/tasks/linux_install.yml | 10 +++++++ .../ansible/roles/collector/tasks/vars.yml | 1 + ...in_install_dotnet_auto_instrumentation.yml | 28 +++++++++++++++++++ .../splunk-otel-auto-instrumentation.conf.j2 | 4 ++- 13 files changed, 80 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ansible.yml b/.github/workflows/ansible.yml index 0d2022504d..f33b61551f 100644 --- a/.github/workflows/ansible.yml +++ b/.github/workflows/ansible.yml @@ -125,7 +125,7 @@ jobs: # https://docs.ansible.com/ansible/latest/os_guide/windows_faq.html#windows-faq-ansible # https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md runs-on: macos-12 - timeout-minutes: 60 + timeout-minutes: 75 strategy: fail-fast: false matrix: diff --git a/deployments/ansible/CHANGELOG.md b/deployments/ansible/CHANGELOG.md index af8213f145..6a793cacf1 100644 --- a/deployments/ansible/CHANGELOG.md +++ b/deployments/ansible/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## ansible-v0.21.0 + +### 💡 Enhancements 💡 + +- Add support for the `splunk_listen_interface` and `signalfx_dotnet_auto_instrumentation_global_tags` options + +### 🧰 Bug fixes 🧰 + +- Update default base url for downloading `td-agent` on Windows to `https://s3.amazonaws.com/packages.treasuredata.com` + ## ansible-v0.20.0 ### 🛑 Breaking changes 🛑 diff --git a/deployments/ansible/galaxy.yml b/deployments/ansible/galaxy.yml index 4537dc30e1..86525b6bd6 100644 --- a/deployments/ansible/galaxy.yml +++ b/deployments/ansible/galaxy.yml @@ -2,7 +2,7 @@ namespace: signalfx name: splunk_otel_collector description: Ansible collection for Splunk OpenTelemetry Collector -version: 0.20.0 +version: 0.21.0 readme: README.md authors: - Splunk Inc. diff --git a/deployments/ansible/molecule/custom_vars/windows-converge.yml b/deployments/ansible/molecule/custom_vars/windows-converge.yml index ea938064af..1b23158d45 100644 --- a/deployments/ansible/molecule/custom_vars/windows-converge.yml +++ b/deployments/ansible/molecule/custom_vars/windows-converge.yml @@ -27,6 +27,7 @@ signalfx_dotnet_auto_instrumentation_service_name: test-service-name signalfx_dotnet_auto_instrumentation_enable_profiler: true signalfx_dotnet_auto_instrumentation_enable_profiler_memory: true + signalfx_dotnet_auto_instrumentation_global_tags: dotnet-tag:dotnet-tag-value signalfx_dotnet_auto_instrumentation_additional_options: SIGNALFX_DOTNET_VAR1: dotnet-value1 SIGNALFX_DOTNET_VAR2: dotnet-value2 diff --git a/deployments/ansible/molecule/custom_vars/windows-verify.yml b/deployments/ansible/molecule/custom_vars/windows-verify.yml index b4a235fd65..beb52bdfe0 100644 --- a/deployments/ansible/molecule/custom_vars/windows-verify.yml +++ b/deployments/ansible/molecule/custom_vars/windows-verify.yml @@ -25,6 +25,7 @@ SIGNALFX_SERVICE_NAME: test-service-name SIGNALFX_PROFILER_ENABLED: "true" SIGNALFX_PROFILER_MEMORY_ENABLED: "true" + SIGNALFX_GLOBAL_TAGS: splunk.zc.method:signalfx-dotnet-tracing-1.0.0,dotnet-tag:dotnet-tag-value SIGNALFX_DOTNET_VAR1: dotnet-value1 SIGNALFX_DOTNET_VAR2: dotnet-value2 tasks: diff --git a/deployments/ansible/molecule/with_instrumentation/verify.yml b/deployments/ansible/molecule/with_instrumentation/verify.yml index 08464be781..55d62d9245 100644 --- a/deployments/ansible/molecule/with_instrumentation/verify.yml +++ b/deployments/ansible/molecule/with_instrumentation/verify.yml @@ -33,7 +33,7 @@ - name: Assert instrumentation config contains resource attribute ansible.builtin.lineinfile: - line: resource_attributes=deployment.environment=test + line: resource_attributes=splunk.zc.method=splunk-otel-auto-instrumentation-0.50.0,deployment.environment=test dest: /usr/lib/splunk-instrumentation/instrumentation.conf state: present check_mode: yes diff --git a/deployments/ansible/molecule/with_instrumentation/windows-verify.yml b/deployments/ansible/molecule/with_instrumentation/windows-verify.yml index 7ff3e6f845..70e1c36253 100644 --- a/deployments/ansible/molecule/with_instrumentation/windows-verify.yml +++ b/deployments/ansible/molecule/with_instrumentation/windows-verify.yml @@ -35,6 +35,21 @@ assert: that: not service_status.changed + - name: Get installed signalfx-dotnet-tracing MSI version + ansible.windows.win_shell: | + $msi_version = "" + $msi_name = "SignalFx .NET Tracing 64-bit" + $regkey = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall" + $msi_version = (Get-ItemProperty ${regkey}\* | Where { $_.DisplayName -eq "$msi_name" }).DisplayVersion + echo $msi_version + register: msi_version + + - name: Add SIGNALFX_GLOBAL_TAGS to dotnet_reg_values + set_fact: + dotnet_reg_values: |- + {%- set tags = "splunk.zc.method:signalfx-dotnet-tracing-" + (msi_version.stdout | trim) -%} + {{ dotnet_reg_values | combine({"SIGNALFX_GLOBAL_TAGS": tags}) }} + - name: Verify collector env vars include_tasks: ../shared/verify_registry_key.yml vars: diff --git a/deployments/ansible/roles/collector/README.md b/deployments/ansible/roles/collector/README.md index 26eeaff8fd..d3ccab0bd0 100644 --- a/deployments/ansible/roles/collector/README.md +++ b/deployments/ansible/roles/collector/README.md @@ -326,6 +326,7 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. CORECLR_ENABLE_PROFILING: true # Required CORECLR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" # Required SIGNALFX_ENV: "{{ signalfx_dotnet_auto_instrumentation_environment }}" + SIGNALFX_GLOBAL_TAGS: "{{ signalfx_dotnet_auto_instrumentation_global_tags }}" SIGNALFX_PROFILER_ENABLED: "{{ signalfx_dotnet_auto_instrumentation_enable_profiler }}" SIGNALFX_PROFILER_MEMORY_ENABLED: "{{ signalfx_dotnet_auto_instrumentation_enable_profiler_memory }}" SIGNALFX_SERVICE_NAME: "{{ signalfx_dotnet_auto_instrumentation_service_name }}" @@ -361,6 +362,12 @@ For proxy options, see the [Windows Proxy](#windows-proxy) section. be assigned to the `SIGNALFX_PROFILER_MEMORY_ENABLED` environment variable in the Windows registry. (**default:** `false`) +- `signalfx_dotnet_auto_instrumentation_global_tags` (Windows only): + Comma-separated list of `key:value` pairs that specify global tags added to + all telemetry signals, for example `key1:val1,key2:val2`. The value will be + assigned to the `SIGNALFX_GLOBAL_TAGS` environment variable in the Windows + registry. (**default**: ``) + - `signalfx_dotnet_auto_instrumentation_additional_options` (Windows only): Dictionary of environment variables to be added to the Windows registry ***in addition*** to the options above. (**default:** `{}`) diff --git a/deployments/ansible/roles/collector/defaults/main.yml b/deployments/ansible/roles/collector/defaults/main.yml index 5b9c8e4fba..63a76e3e0b 100644 --- a/deployments/ansible/roles/collector/defaults/main.yml +++ b/deployments/ansible/roles/collector/defaults/main.yml @@ -86,5 +86,6 @@ signalfx_dotnet_auto_instrumentation_environment: "" signalfx_dotnet_auto_instrumentation_service_name: "" signalfx_dotnet_auto_instrumentation_enable_profiler: false signalfx_dotnet_auto_instrumentation_enable_profiler_memory: false +signalfx_dotnet_auto_instrumentation_global_tags: "" signalfx_dotnet_auto_instrumentation_iisreset: true signalfx_dotnet_auto_instrumentation_additional_options: {} diff --git a/deployments/ansible/roles/collector/tasks/linux_install.yml b/deployments/ansible/roles/collector/tasks/linux_install.yml index 0950c979e6..49ac3fb7e2 100644 --- a/deployments/ansible/roles/collector/tasks/linux_install.yml +++ b/deployments/ansible/roles/collector/tasks/linux_install.yml @@ -80,6 +80,16 @@ dest: /etc/ld.so.preload when: install_splunk_otel_auto_instrumentation +- name: Get installed package facts + package_facts: + manager: auto + when: install_splunk_otel_auto_instrumentation + +- name: Get splunk-otel-auto-instrumentation version + set_fact: + auto_instrumentation_version: "{{ ansible_facts.packages['splunk-otel-auto-instrumentation'][0].version }}" + when: install_splunk_otel_auto_instrumentation + - name: Set up the Splunk OpenTelemetry Auto Instrumentation config file ansible.builtin.template: src: splunk-otel-auto-instrumentation.conf.j2 diff --git a/deployments/ansible/roles/collector/tasks/vars.yml b/deployments/ansible/roles/collector/tasks/vars.yml index aa0332d202..88ad5d7352 100644 --- a/deployments/ansible/roles/collector/tasks/vars.yml +++ b/deployments/ansible/roles/collector/tasks/vars.yml @@ -78,6 +78,7 @@ CORECLR_PROFILER: "{B4C89B0F-9908-4F73-9F59-0D77C5A06874}" SIGNALFX_ENV: "{{ signalfx_dotnet_auto_instrumentation_environment }}" SIGNALFX_SERVICE_NAME: "{{ signalfx_dotnet_auto_instrumentation_service_name }}" + SIGNALFX_GLOBAL_TAGS: "{{ signalfx_dotnet_auto_instrumentation_global_tags }}" SIGNALFX_PROFILER_ENABLED: "{{ signalfx_dotnet_auto_instrumentation_enable_profiler }}" SIGNALFX_PROFILER_MEMORY_ENABLED: "{{ signalfx_dotnet_auto_instrumentation_enable_profiler_memory }}" iis_registry_key: HKLM:\SYSTEM\CurrentControlSet\Services\W3SVC diff --git a/deployments/ansible/roles/collector/tasks/win_install_dotnet_auto_instrumentation.yml b/deployments/ansible/roles/collector/tasks/win_install_dotnet_auto_instrumentation.yml index cbd1ac2d0b..af5d5ae1cd 100644 --- a/deployments/ansible/roles/collector/tasks/win_install_dotnet_auto_instrumentation.yml +++ b/deployments/ansible/roles/collector/tasks/win_install_dotnet_auto_instrumentation.yml @@ -46,6 +46,20 @@ state: present notify: "reset iis" +- name: Get installed signalfx-dotnet-tracing MSI version + ansible.windows.win_shell: | + $msi_version = "" + $msi_name = "SignalFx .NET Tracing 64-bit" + $regkey = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall" + try { + $msi_version = (Get-ItemProperty ${regkey}\* | Where { $_.DisplayName -eq "$msi_name" }).DisplayVersion + } catch { + continue + } + echo $msi_version + changed_when: dotnet_msi.changed + register: msi_version + - name: Create registry path ansible.windows.win_regedit: path: "{{ iis_registry_key }}" @@ -58,6 +72,13 @@ {%- if (item.value | type_debug) == "bool" -%} {%- set value = item.value | string | lower -%} {%- endif -%} + {%- if item.key == "SIGNALFX_GLOBAL_TAGS" -%} + {%- set method = "" -%} + {%- if msi_version.stdout != "" -%} + {%- set method = "splunk.zc.method:signalfx-dotnet-tracing-" + (msi_version.stdout | trim) -%} + {%- endif -%} + {%- set value = (method + "," + signalfx_dotnet_auto_instrumentation_global_tags) | trim(",") -%} + {%- endif -%} {{ (options_list | default([])) + [item.key + '=' + (value | string)] }} loop: "{{ dotnet_options | combine(signalfx_dotnet_auto_instrumentation_additional_options) | dict2items }}" @@ -86,6 +107,13 @@ {%- if (item.value | type_debug) == "bool" -%} {%- set value = item.value | string | lower -%} {%- endif -%} + {%- if item.key == "SIGNALFX_GLOBAL_TAGS" -%} + {%- set method = "" -%} + {%- if msi_version.stdout != "" -%} + {%- set method = "splunk.zc.method:signalfx-dotnet-tracing-" + (msi_version.stdout | trim) -%} + {%- endif -%} + {%- set value = (method + "," + signalfx_dotnet_auto_instrumentation_global_tags) | trim(",") -%} + {%- endif -%} {{ value | string }} type: string loop: "{{ dotnet_options | combine(signalfx_dotnet_auto_instrumentation_additional_options) | dict2items }}" diff --git a/deployments/ansible/roles/collector/templates/splunk-otel-auto-instrumentation.conf.j2 b/deployments/ansible/roles/collector/templates/splunk-otel-auto-instrumentation.conf.j2 index 6fbe6cdeba..53dc2b8c23 100644 --- a/deployments/ansible/roles/collector/templates/splunk-otel-auto-instrumentation.conf.j2 +++ b/deployments/ansible/roles/collector/templates/splunk-otel-auto-instrumentation.conf.j2 @@ -1,6 +1,8 @@ java_agent_jar={{ splunk_otel_auto_instrumentation_java_agent_jar }} {% if splunk_otel_auto_instrumentation_resource_attributes is defined and splunk_otel_auto_instrumentation_resource_attributes %} -resource_attributes={{ splunk_otel_auto_instrumentation_resource_attributes }} +resource_attributes=splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }},{{ splunk_otel_auto_instrumentation_resource_attributes }} +{% else %} +resource_attributes=splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }} {% endif %} {% if splunk_otel_auto_instrumentation_service_name is defined and splunk_otel_auto_instrumentation_service_name %} service_name={{ splunk_otel_auto_instrumentation_service_name }} From 32bdea5effff77cabd3cda7d9fce2b367a6420e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:38:24 -0400 Subject: [PATCH 48/55] Bump pygithub in /internal/buildscripts/packaging/release (#3710) Bumps [pygithub](https://github.com/pygithub/pygithub) from 1.59.1 to 2.1.1. - [Release notes](https://github.com/pygithub/pygithub/releases) - [Changelog](https://github.com/PyGithub/PyGithub/blob/main/doc/changes.rst) - [Commits](https://github.com/pygithub/pygithub/compare/v1.59.1...v2.1.1) --- updated-dependencies: - dependency-name: pygithub dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- internal/buildscripts/packaging/release/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/buildscripts/packaging/release/requirements.txt b/internal/buildscripts/packaging/release/requirements.txt index 79b6967a0a..92c156fb74 100644 --- a/internal/buildscripts/packaging/release/requirements.txt +++ b/internal/buildscripts/packaging/release/requirements.txt @@ -1,4 +1,4 @@ -PyGithub==1.59.1 +PyGithub==2.1.1 boto3==1.28.53 docker==6.1.3 requests==2.31.0 \ No newline at end of file From 42888b5ae2c9a9347aeb069319e5558e6f558b95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:40:46 -0400 Subject: [PATCH 49/55] Bump github.com/shirou/gopsutil/v3 from 3.23.8 to 3.23.9 in /tests (#3713) * Bump github.com/shirou/gopsutil/v3 from 3.23.8 to 3.23.9 in /tests Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.23.8 to 3.23.9. - [Release notes](https://github.com/shirou/gopsutil/releases) - [Commits](https://github.com/shirou/gopsutil/compare/v3.23.8...v3.23.9) --- updated-dependencies: - dependency-name: github.com/shirou/gopsutil/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- go.mod | 2 +- go.sum | 4 ++-- pkg/extension/smartagentextension/go.mod | 2 +- pkg/extension/smartagentextension/go.sum | 4 ++-- pkg/receiver/smartagentreceiver/go.mod | 2 +- pkg/receiver/smartagentreceiver/go.sum | 4 ++-- tests/go.mod | 2 +- tests/go.sum | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 7b005e0724..bd3a80fedb 100644 --- a/go.mod +++ b/go.mod @@ -440,7 +440,7 @@ require ( github.com/ryanuber/go-glob v1.0.0 // indirect github.com/samuel/go-zookeeper v0.0.0-20200724154423-2164a8ac840e // indirect github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20 // indirect - github.com/shirou/gopsutil/v3 v3.23.8 // indirect + github.com/shirou/gopsutil/v3 v3.23.9 // indirect github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 // indirect github.com/signalfx/defaults v1.2.2-0.20180531161417-70562fe60657 // indirect github.com/signalfx/gohistogram v0.0.0-20160107210732-1ccfd2ff5083 // indirect diff --git a/go.sum b/go.sum index a46ec4f1b3..4cfbe8492d 100644 --- a/go.sum +++ b/go.sum @@ -1430,8 +1430,8 @@ github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod github.com/sethvargo/go-limiter v0.7.1 h1:wWNhTj0pxjyJ7wuJHpRJpYwJn+bUnjYfw2a85eu5w9U= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/gopsutil/v3 v3.23.8 h1:xnATPiybo6GgdRoC4YoGnxXZFRc3dqQTGi73oLvvBrE= -github.com/shirou/gopsutil/v3 v3.23.8/go.mod h1:7hmCaBn+2ZwaZOr6jmPBZDfawwMGuo1id3C6aM8EDqQ= +github.com/shirou/gopsutil/v3 v3.23.9 h1:ZI5bWVeu2ep4/DIxB4U9okeYJ7zp/QLTO4auRb/ty/E= +github.com/shirou/gopsutil/v3 v3.23.9/go.mod h1:x/NWSb71eMcjFIO0vhyGW5nZ7oSIgVjrCnADckb85GA= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= diff --git a/pkg/extension/smartagentextension/go.mod b/pkg/extension/smartagentextension/go.mod index 997156c8fc..546f417845 100644 --- a/pkg/extension/smartagentextension/go.mod +++ b/pkg/extension/smartagentextension/go.mod @@ -117,7 +117,7 @@ require ( github.com/rs/cors v1.10.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/samuel/go-zookeeper v0.0.0-20200724154423-2164a8ac840e // indirect - github.com/shirou/gopsutil/v3 v3.23.8 // indirect + github.com/shirou/gopsutil/v3 v3.23.9 // indirect github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 // indirect github.com/signalfx/gohistogram v0.0.0-20160107210732-1ccfd2ff5083 // indirect github.com/signalfx/golib/v3 v3.3.53 // indirect diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index 4327fb3d8a..545b3f1b1e 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -582,8 +582,8 @@ github.com/sasha-s/go-deadlock v0.2.0 h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sethvargo/go-limiter v0.7.1 h1:wWNhTj0pxjyJ7wuJHpRJpYwJn+bUnjYfw2a85eu5w9U= -github.com/shirou/gopsutil/v3 v3.23.8 h1:xnATPiybo6GgdRoC4YoGnxXZFRc3dqQTGi73oLvvBrE= -github.com/shirou/gopsutil/v3 v3.23.8/go.mod h1:7hmCaBn+2ZwaZOr6jmPBZDfawwMGuo1id3C6aM8EDqQ= +github.com/shirou/gopsutil/v3 v3.23.9 h1:ZI5bWVeu2ep4/DIxB4U9okeYJ7zp/QLTO4auRb/ty/E= +github.com/shirou/gopsutil/v3 v3.23.9/go.mod h1:x/NWSb71eMcjFIO0vhyGW5nZ7oSIgVjrCnADckb85GA= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index d413332751..35ef8038f4 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -7,7 +7,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.85.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.85.0 github.com/openzipkin/zipkin-go v0.4.2 - github.com/shirou/gopsutil/v3 v3.23.8 + github.com/shirou/gopsutil/v3 v3.23.9 github.com/signalfx/defaults v1.2.2-0.20180531161417-70562fe60657 github.com/signalfx/golib/v3 v3.3.53 github.com/signalfx/signalfx-agent v1.0.1-0.20230104182534-9eee411fe305 diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index 4fe023e5e2..c79f4c41d3 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -1026,8 +1026,8 @@ github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod github.com/sethvargo/go-limiter v0.7.1 h1:wWNhTj0pxjyJ7wuJHpRJpYwJn+bUnjYfw2a85eu5w9U= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/gopsutil/v3 v3.23.8 h1:xnATPiybo6GgdRoC4YoGnxXZFRc3dqQTGi73oLvvBrE= -github.com/shirou/gopsutil/v3 v3.23.8/go.mod h1:7hmCaBn+2ZwaZOr6jmPBZDfawwMGuo1id3C6aM8EDqQ= +github.com/shirou/gopsutil/v3 v3.23.9 h1:ZI5bWVeu2ep4/DIxB4U9okeYJ7zp/QLTO4auRb/ty/E= +github.com/shirou/gopsutil/v3 v3.23.9/go.mod h1:x/NWSb71eMcjFIO0vhyGW5nZ7oSIgVjrCnADckb85GA= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= diff --git a/tests/go.mod b/tests/go.mod index 086889fc3c..1510ed5a1c 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -9,7 +9,7 @@ require ( github.com/go-sql-driver/mysql v1.7.1 github.com/google/uuid v1.3.1 github.com/knadh/koanf v1.5.0 - github.com/shirou/gopsutil/v3 v3.23.8 + github.com/shirou/gopsutil/v3 v3.23.9 github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 github.com/signalfx/signalfx-go v1.33.0 github.com/signalfx/signalfx-go/signalflow/v2 v2.1.0 diff --git a/tests/go.sum b/tests/go.sum index f975ac504d..44a86bfc25 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -1082,8 +1082,8 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= -github.com/shirou/gopsutil/v3 v3.23.8 h1:xnATPiybo6GgdRoC4YoGnxXZFRc3dqQTGi73oLvvBrE= -github.com/shirou/gopsutil/v3 v3.23.8/go.mod h1:7hmCaBn+2ZwaZOr6jmPBZDfawwMGuo1id3C6aM8EDqQ= +github.com/shirou/gopsutil/v3 v3.23.9 h1:ZI5bWVeu2ep4/DIxB4U9okeYJ7zp/QLTO4auRb/ty/E= +github.com/shirou/gopsutil/v3 v3.23.9/go.mod h1:x/NWSb71eMcjFIO0vhyGW5nZ7oSIgVjrCnADckb85GA= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= From 77f3bd16f97bd880942fdc5161e3edd6964b681a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:41:39 -0400 Subject: [PATCH 50/55] Bump boto3 in /internal/buildscripts/packaging/release (#3711) Bumps [boto3](https://github.com/boto/boto3) from 1.28.53 to 1.28.57. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.28.53...1.28.57) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- internal/buildscripts/packaging/release/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/buildscripts/packaging/release/requirements.txt b/internal/buildscripts/packaging/release/requirements.txt index 92c156fb74..a61fb3ccae 100644 --- a/internal/buildscripts/packaging/release/requirements.txt +++ b/internal/buildscripts/packaging/release/requirements.txt @@ -1,4 +1,4 @@ PyGithub==2.1.1 -boto3==1.28.53 +boto3==1.28.57 docker==6.1.3 requests==2.31.0 \ No newline at end of file From 71f24ba059d319ef8cb547d75d8f0e0890fa77a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:42:52 -0400 Subject: [PATCH 51/55] Bump github.com/snowflakedb/gosnowflake from 1.6.24 to 1.6.25 in /internal/signalfx-agent (#3714) * Bump github.com/snowflakedb/gosnowflake in /internal/signalfx-agent Bumps [github.com/snowflakedb/gosnowflake](https://github.com/snowflakedb/gosnowflake) from 1.6.24 to 1.6.25. - [Release notes](https://github.com/snowflakedb/gosnowflake/releases) - [Changelog](https://github.com/snowflakedb/gosnowflake/blob/master/release.go) - [Commits](https://github.com/snowflakedb/gosnowflake/compare/v1.6.24...v1.6.25) --- updated-dependencies: - dependency-name: github.com/snowflakedb/gosnowflake dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- go.mod | 2 +- go.sum | 4 ++-- internal/signalfx-agent/go.mod | 2 +- internal/signalfx-agent/go.sum | 4 ++-- pkg/receiver/smartagentreceiver/go.mod | 2 +- pkg/receiver/smartagentreceiver/go.sum | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index bd3a80fedb..2ad8a06841 100644 --- a/go.mod +++ b/go.mod @@ -449,7 +449,7 @@ require ( github.com/signalfx/signalfx-agent/pkg/apm v0.0.0-20230222185249-54e5d1064c5b // indirect github.com/sijms/go-ora/v2 v2.7.17 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/snowflakedb/gosnowflake v1.6.24 // indirect + github.com/snowflakedb/gosnowflake v1.6.25 // indirect github.com/soniah/gosnmp v0.0.0-20190220004421-68e8beac0db9 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/cobra v1.7.0 // indirect diff --git a/go.sum b/go.sum index 4cfbe8492d..81d10bdab4 100644 --- a/go.sum +++ b/go.sum @@ -1471,8 +1471,8 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/assertions v1.13.1 h1:Ef7KhSmjZcK6AVf9YbJdvPYG9avaF0ZxudX+ThRdWfU= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sSznIX1xY= -github.com/snowflakedb/gosnowflake v1.6.24 h1:NiBh1WSstNtr12qywmdFMS1XHaYdF5iWWGnjIQb1cEY= -github.com/snowflakedb/gosnowflake v1.6.24/go.mod h1:KfO4F7bk+aXPUIvBqYxvPhxLlu2/w4TtSC8Rw/yr5Mg= +github.com/snowflakedb/gosnowflake v1.6.25 h1:o5zUmxTOo0Eo9AdkEj8blCeiMuILrQJ+rjUMAeZhcRE= +github.com/snowflakedb/gosnowflake v1.6.25/go.mod h1:KfO4F7bk+aXPUIvBqYxvPhxLlu2/w4TtSC8Rw/yr5Mg= github.com/softlayer/softlayer-go v0.0.0-20180806151055-260589d94c7d h1:bVQRCxQvfjNUeRqaY/uT0tFuvuFY0ulgnczuR684Xic= github.com/soniah/gosnmp v0.0.0-20190220004421-68e8beac0db9 h1:O4jq14rgUwG9Ssn0wZiRPl8Ya6q3a1h3xJzTAsBaRgo= github.com/soniah/gosnmp v0.0.0-20190220004421-68e8beac0db9/go.mod h1:DuEpAS0az51+DyVBQwITDsoq4++e3LTNckp2GoasF2I= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index 9b87e35ef7..864519c752 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -77,7 +77,7 @@ require ( github.com/signalfx/golib/v3 v3.3.53 github.com/signalfx/ingest-protocols v0.2.0 github.com/sirupsen/logrus v1.9.3 - github.com/snowflakedb/gosnowflake v1.6.24 + github.com/snowflakedb/gosnowflake v1.6.25 github.com/stretchr/testify v1.8.4 github.com/ulule/deepcopier v0.0.0-20171107155558-ca99b135e50f github.com/vmware/govmomi v0.30.7 diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index fddfe89b40..d56a3ef0c0 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -1049,8 +1049,8 @@ github.com/smartystreets/assertions v1.13.1/go.mod h1:cXr/IwVfSo/RbCSPhoAPv73p3h github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sSznIX1xY= github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60= -github.com/snowflakedb/gosnowflake v1.6.24 h1:NiBh1WSstNtr12qywmdFMS1XHaYdF5iWWGnjIQb1cEY= -github.com/snowflakedb/gosnowflake v1.6.24/go.mod h1:KfO4F7bk+aXPUIvBqYxvPhxLlu2/w4TtSC8Rw/yr5Mg= +github.com/snowflakedb/gosnowflake v1.6.25 h1:o5zUmxTOo0Eo9AdkEj8blCeiMuILrQJ+rjUMAeZhcRE= +github.com/snowflakedb/gosnowflake v1.6.25/go.mod h1:KfO4F7bk+aXPUIvBqYxvPhxLlu2/w4TtSC8Rw/yr5Mg= github.com/softlayer/softlayer-go v0.0.0-20180806151055-260589d94c7d h1:bVQRCxQvfjNUeRqaY/uT0tFuvuFY0ulgnczuR684Xic= github.com/soniah/gosnmp v0.0.0-20190220004421-68e8beac0db9 h1:O4jq14rgUwG9Ssn0wZiRPl8Ya6q3a1h3xJzTAsBaRgo= github.com/soniah/gosnmp v0.0.0-20190220004421-68e8beac0db9/go.mod h1:DuEpAS0az51+DyVBQwITDsoq4++e3LTNckp2GoasF2I= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index 35ef8038f4..78a4b89a1c 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -241,7 +241,7 @@ require ( github.com/signalfx/ingest-protocols v0.2.0 // indirect github.com/signalfx/sapm-proto v0.12.0 // indirect github.com/signalfx/signalfx-agent/pkg/apm v0.0.0-20230104182534-9eee411fe305 // indirect - github.com/snowflakedb/gosnowflake v1.6.24 // indirect + github.com/snowflakedb/gosnowflake v1.6.25 // indirect github.com/soniah/gosnmp v0.0.0-20190220004421-68e8beac0db9 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index c79f4c41d3..43bd6d6ed3 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -1063,8 +1063,8 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs github.com/smarty/assertions v1.15.0 h1:cR//PqUBUiQRakZWqBiFFQ9wb8emQGDb0HeGdqGByCY= github.com/smartystreets/assertions v1.13.1 h1:Ef7KhSmjZcK6AVf9YbJdvPYG9avaF0ZxudX+ThRdWfU= github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sSznIX1xY= -github.com/snowflakedb/gosnowflake v1.6.24 h1:NiBh1WSstNtr12qywmdFMS1XHaYdF5iWWGnjIQb1cEY= -github.com/snowflakedb/gosnowflake v1.6.24/go.mod h1:KfO4F7bk+aXPUIvBqYxvPhxLlu2/w4TtSC8Rw/yr5Mg= +github.com/snowflakedb/gosnowflake v1.6.25 h1:o5zUmxTOo0Eo9AdkEj8blCeiMuILrQJ+rjUMAeZhcRE= +github.com/snowflakedb/gosnowflake v1.6.25/go.mod h1:KfO4F7bk+aXPUIvBqYxvPhxLlu2/w4TtSC8Rw/yr5Mg= github.com/softlayer/softlayer-go v0.0.0-20180806151055-260589d94c7d h1:bVQRCxQvfjNUeRqaY/uT0tFuvuFY0ulgnczuR684Xic= github.com/soniah/gosnmp v0.0.0-20190220004421-68e8beac0db9 h1:O4jq14rgUwG9Ssn0wZiRPl8Ya6q3a1h3xJzTAsBaRgo= github.com/soniah/gosnmp v0.0.0-20190220004421-68e8beac0db9/go.mod h1:DuEpAS0az51+DyVBQwITDsoq4++e3LTNckp2GoasF2I= From 9d4faacd571bb91eaa51b70e787e8e4677b4955e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 11:16:56 -0400 Subject: [PATCH 52/55] Bump github.com/shirou/gopsutil/v3 in /internal/signalfx-agent (#3715) Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.23.8 to 3.23.9. - [Release notes](https://github.com/shirou/gopsutil/releases) - [Commits](https://github.com/shirou/gopsutil/compare/v3.23.8...v3.23.9) --- updated-dependencies: - dependency-name: github.com/shirou/gopsutil/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- internal/signalfx-agent/go.mod | 2 +- internal/signalfx-agent/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index 864519c752..569d029d52 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -71,7 +71,7 @@ require ( github.com/prometheus/common v0.44.0 github.com/prometheus/procfs v0.12.0 github.com/samuel/go-zookeeper v0.0.0-20200724154423-2164a8ac840e - github.com/shirou/gopsutil/v3 v3.23.8 + github.com/shirou/gopsutil/v3 v3.23.9 github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 github.com/signalfx/defaults v1.2.2-0.20180531161417-70562fe60657 github.com/signalfx/golib/v3 v3.3.53 diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index d56a3ef0c0..3d81550822 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -1007,8 +1007,8 @@ github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod github.com/sethvargo/go-limiter v0.7.1 h1:wWNhTj0pxjyJ7wuJHpRJpYwJn+bUnjYfw2a85eu5w9U= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/gopsutil/v3 v3.23.8 h1:xnATPiybo6GgdRoC4YoGnxXZFRc3dqQTGi73oLvvBrE= -github.com/shirou/gopsutil/v3 v3.23.8/go.mod h1:7hmCaBn+2ZwaZOr6jmPBZDfawwMGuo1id3C6aM8EDqQ= +github.com/shirou/gopsutil/v3 v3.23.9 h1:ZI5bWVeu2ep4/DIxB4U9okeYJ7zp/QLTO4auRb/ty/E= +github.com/shirou/gopsutil/v3 v3.23.9/go.mod h1:x/NWSb71eMcjFIO0vhyGW5nZ7oSIgVjrCnADckb85GA= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= From 1a5d426e4a81aaaf6e4f3d4e96e4b90d83fb57b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 12:08:17 -0400 Subject: [PATCH 53/55] Bump github.com/vmware/govmomi from 0.30.7 to 0.32.0 in /internal/signalfx-agent (#3716) * Bump github.com/vmware/govmomi in /internal/signalfx-agent Bumps [github.com/vmware/govmomi](https://github.com/vmware/govmomi) from 0.30.7 to 0.32.0. - [Release notes](https://github.com/vmware/govmomi/releases) - [Changelog](https://github.com/vmware/govmomi/blob/main/CHANGELOG.md) - [Commits](https://github.com/vmware/govmomi/compare/v0.30.7...v0.32.0) --- updated-dependencies: - dependency-name: github.com/vmware/govmomi dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- go.mod | 2 +- go.sum | 4 ++-- internal/signalfx-agent/go.mod | 4 ++-- internal/signalfx-agent/go.sum | 8 ++++---- pkg/extension/smartagentextension/go.sum | 2 +- pkg/receiver/smartagentreceiver/go.mod | 2 +- pkg/receiver/smartagentreceiver/go.sum | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 2ad8a06841..2f096264f7 100644 --- a/go.mod +++ b/go.mod @@ -465,7 +465,7 @@ require ( github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/ulule/deepcopier v0.0.0-20171107155558-ca99b135e50f // indirect github.com/vjeantet/grok v1.0.0 // indirect - github.com/vmware/govmomi v0.30.7 // indirect + github.com/vmware/govmomi v0.32.0 // indirect github.com/vultr/govultr/v2 v2.17.2 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect diff --git a/go.sum b/go.sum index 81d10bdab4..7ff5ffdf13 100644 --- a/go.sum +++ b/go.sum @@ -1554,8 +1554,8 @@ github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYp github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vjeantet/grok v1.0.0 h1:uxMqatJP6MOFXsj6C1tZBnqqAThQEeqnizUZ48gSJQQ= github.com/vjeantet/grok v1.0.0/go.mod h1:/FWYEVYekkm+2VjcFmO9PufDU5FgXHUz9oy2EGqmQBo= -github.com/vmware/govmomi v0.30.7 h1:YO8CcDpLJzmq6PK5/CBQbXyV21iCMh8SbdXt+xNkXp8= -github.com/vmware/govmomi v0.30.7/go.mod h1:epgoslm97rLECMV4D+08ORzUBEU7boFSepKjt7AYVGg= +github.com/vmware/govmomi v0.32.0 h1:Rsdi/HAX5Ebf9Byp/FvBir4sfM7yP5DBUeRlbC6vLBo= +github.com/vmware/govmomi v0.32.0/go.mod h1:JA63Pg0SgQcSjk+LuPzjh3rJdcWBo/ZNCIwbb1qf2/0= github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index 569d029d52..1bcb672aab 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -80,7 +80,7 @@ require ( github.com/snowflakedb/gosnowflake v1.6.25 github.com/stretchr/testify v1.8.4 github.com/ulule/deepcopier v0.0.0-20171107155558-ca99b135e50f - github.com/vmware/govmomi v0.30.7 + github.com/vmware/govmomi v0.32.0 github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 go.etcd.io/etcd/client/v2 v2.305.9 golang.org/x/net v0.15.0 @@ -190,7 +190,7 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/s2a-go v0.1.5 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gophercloud/gophercloud v0.16.0 // indirect diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index 3d81550822..4090e63cca 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -509,8 +509,8 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/s2a-go v0.1.5 h1:8IYp3w9nysqv3JH+NJgXJzGbDHzLOTj43BmSkp+O7qg= github.com/google/s2a-go v0.1.5/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -1111,8 +1111,8 @@ github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYp github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vjeantet/grok v1.0.0 h1:uxMqatJP6MOFXsj6C1tZBnqqAThQEeqnizUZ48gSJQQ= github.com/vjeantet/grok v1.0.0/go.mod h1:/FWYEVYekkm+2VjcFmO9PufDU5FgXHUz9oy2EGqmQBo= -github.com/vmware/govmomi v0.30.7 h1:YO8CcDpLJzmq6PK5/CBQbXyV21iCMh8SbdXt+xNkXp8= -github.com/vmware/govmomi v0.30.7/go.mod h1:epgoslm97rLECMV4D+08ORzUBEU7boFSepKjt7AYVGg= +github.com/vmware/govmomi v0.32.0 h1:Rsdi/HAX5Ebf9Byp/FvBir4sfM7yP5DBUeRlbC6vLBo= +github.com/vmware/govmomi v0.32.0/go.mod h1:JA63Pg0SgQcSjk+LuPzjh3rJdcWBo/ZNCIwbb1qf2/0= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index 545b3f1b1e..f48bbb9f9c 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -645,7 +645,7 @@ github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaO github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/vmware/govmomi v0.30.7 h1:YO8CcDpLJzmq6PK5/CBQbXyV21iCMh8SbdXt+xNkXp8= +github.com/vmware/govmomi v0.32.0 h1:Rsdi/HAX5Ebf9Byp/FvBir4sfM7yP5DBUeRlbC6vLBo= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index 78a4b89a1c..ccbbe62664 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -256,7 +256,7 @@ require ( github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/ulule/deepcopier v0.0.0-20171107155558-ca99b135e50f // indirect github.com/vjeantet/grok v1.0.0 // indirect - github.com/vmware/govmomi v0.30.7 // indirect + github.com/vmware/govmomi v0.32.0 // indirect github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index 43bd6d6ed3..ef4fae45ce 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -1124,8 +1124,8 @@ github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYp github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vjeantet/grok v1.0.0 h1:uxMqatJP6MOFXsj6C1tZBnqqAThQEeqnizUZ48gSJQQ= github.com/vjeantet/grok v1.0.0/go.mod h1:/FWYEVYekkm+2VjcFmO9PufDU5FgXHUz9oy2EGqmQBo= -github.com/vmware/govmomi v0.30.7 h1:YO8CcDpLJzmq6PK5/CBQbXyV21iCMh8SbdXt+xNkXp8= -github.com/vmware/govmomi v0.30.7/go.mod h1:epgoslm97rLECMV4D+08ORzUBEU7boFSepKjt7AYVGg= +github.com/vmware/govmomi v0.32.0 h1:Rsdi/HAX5Ebf9Byp/FvBir4sfM7yP5DBUeRlbC6vLBo= +github.com/vmware/govmomi v0.32.0/go.mod h1:JA63Pg0SgQcSjk+LuPzjh3rJdcWBo/ZNCIwbb1qf2/0= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 3b6a5d31bff22864584242392a8085edaf336e6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 12:43:15 -0400 Subject: [PATCH 54/55] Bump github.com/onsi/gomega from 1.27.10 to 1.28.0 in /internal/signalfx-agent (#3717) * Bump github.com/onsi/gomega in /internal/signalfx-agent Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.10 to 1.28.0. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.27.10...v1.28.0) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * make tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: release-bot --- go.sum | 2 +- internal/signalfx-agent/go.mod | 6 +++--- internal/signalfx-agent/go.sum | 14 +++++++------- pkg/extension/smartagentextension/go.mod | 4 ++-- pkg/extension/smartagentextension/go.sum | 8 ++++---- pkg/receiver/smartagentreceiver/go.mod | 4 ++-- pkg/receiver/smartagentreceiver/go.sum | 10 +++++----- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/go.sum b/go.sum index 7ff5ffdf13..dd7fedeccc 100644 --- a/go.sum +++ b/go.sum @@ -1102,7 +1102,7 @@ github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector v0.85.0 h1:B5G/e61IyxGe9+2GhVvwLX7i6o3O9d545ViGnYQbowI= github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector v0.85.0/go.mod h1:0p18Zf+aksaLxT0jtPLfVM8akdlC3dNjHfZUW45Z9vU= diff --git a/internal/signalfx-agent/go.mod b/internal/signalfx-agent/go.mod index 1bcb672aab..dcae0566cb 100644 --- a/internal/signalfx-agent/go.mod +++ b/internal/signalfx-agent/go.mod @@ -61,7 +61,7 @@ require ( github.com/mitchellh/hashstructure v1.1.0 github.com/mongodb/go-client-mongodb-atlas v0.2.0 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.27.10 + github.com/onsi/gomega v1.28.0 github.com/openshift/api v0.0.0-20230417092139-1b2161d23365 github.com/openshift/client-go v0.0.0-20230419131419-497c7032c581 github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b @@ -86,7 +86,7 @@ require ( golang.org/x/net v0.15.0 golang.org/x/sync v0.3.0 golang.org/x/sys v0.12.0 - golang.org/x/tools v0.9.3 // indirect + golang.org/x/tools v0.12.0 // indirect google.golang.org/grpc v1.58.2 gopkg.in/go-playground/validator.v9 v9.31.0 gopkg.in/yaml.v2 v2.4.0 @@ -289,7 +289,7 @@ require ( go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.13.0 // indirect golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect - golang.org/x/mod v0.11.0 // indirect + golang.org/x/mod v0.12.0 // indirect golang.org/x/oauth2 v0.11.0 // indirect golang.org/x/term v0.12.0 // indirect golang.org/x/text v0.13.0 // indirect diff --git a/internal/signalfx-agent/go.sum b/internal/signalfx-agent/go.sum index 4090e63cca..9586fd90f4 100644 --- a/internal/signalfx-agent/go.sum +++ b/internal/signalfx-agent/go.sum @@ -886,14 +886,14 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= +github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= +github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -1242,8 +1242,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1547,8 +1547,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/pkg/extension/smartagentextension/go.mod b/pkg/extension/smartagentextension/go.mod index 546f417845..0c14ddc7a7 100644 --- a/pkg/extension/smartagentextension/go.mod +++ b/pkg/extension/smartagentextension/go.mod @@ -163,13 +163,13 @@ require ( go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.13.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect - golang.org/x/mod v0.11.0 // indirect + golang.org/x/mod v0.12.0 // indirect golang.org/x/net v0.15.0 // indirect golang.org/x/oauth2 v0.11.0 // indirect golang.org/x/sys v0.12.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.9.3 // indirect + golang.org/x/tools v0.12.0 // indirect google.golang.org/api v0.138.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect diff --git a/pkg/extension/smartagentextension/go.sum b/pkg/extension/smartagentextension/go.sum index f48bbb9f9c..22f0bdcf83 100644 --- a/pkg/extension/smartagentextension/go.sum +++ b/pkg/extension/smartagentextension/go.sum @@ -751,8 +751,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -845,8 +845,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/pkg/receiver/smartagentreceiver/go.mod b/pkg/receiver/smartagentreceiver/go.mod index ccbbe62664..31ef353e25 100644 --- a/pkg/receiver/smartagentreceiver/go.mod +++ b/pkg/receiver/smartagentreceiver/go.mod @@ -287,7 +287,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.13.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect - golang.org/x/mod v0.11.0 // indirect + golang.org/x/mod v0.12.0 // indirect golang.org/x/net v0.15.0 // indirect golang.org/x/oauth2 v0.11.0 // indirect golang.org/x/sync v0.3.0 // indirect @@ -295,7 +295,7 @@ require ( golang.org/x/term v0.12.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.9.3 // indirect + golang.org/x/tools v0.12.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.138.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/pkg/receiver/smartagentreceiver/go.sum b/pkg/receiver/smartagentreceiver/go.sum index ef4fae45ce..0e5981b3b9 100644 --- a/pkg/receiver/smartagentreceiver/go.sum +++ b/pkg/receiver/smartagentreceiver/go.sum @@ -900,7 +900,7 @@ github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.85.0 h1:syi7DOno9/zo5t90bdqQe9EhFMjeozS2RT1A2Ty/bVM= github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.85.0/go.mod h1:EYEP2YlL07/NxO3pcvWnIuhzvKkqf/wWwpy18AgwswA= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.85.0 h1:coJ+4Wvu5m2vk2oaTlJlrkKU3XvN5LxO3/0RvX5YMn0= @@ -1282,8 +1282,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1503,8 +1503,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From d71e5343c5ba1f8fb8fae3088ce68b46f30bf93d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 13:34:11 -0400 Subject: [PATCH 55/55] Bump github.com/Songmu/gotesplit from 0.2.1 to 0.3.1 in /tests/tools (#3718) Bumps [github.com/Songmu/gotesplit](https://github.com/Songmu/gotesplit) from 0.2.1 to 0.3.1. - [Release notes](https://github.com/Songmu/gotesplit/releases) - [Changelog](https://github.com/Songmu/gotesplit/blob/main/CHANGELOG.md) - [Commits](https://github.com/Songmu/gotesplit/compare/v0.2.1...v0.3.1) --- updated-dependencies: - dependency-name: github.com/Songmu/gotesplit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tests/tools/go.mod | 6 +++--- tests/tools/go.sum | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/tools/go.mod b/tests/tools/go.mod index ef943db3e4..9646093e1a 100644 --- a/tests/tools/go.mod +++ b/tests/tools/go.mod @@ -2,9 +2,9 @@ module github.com/signalfx/splunk-otel-collector/tests/tools go 1.20 -require github.com/Songmu/gotesplit v0.2.1 +require github.com/Songmu/gotesplit v0.3.1 require ( - github.com/jstemmer/go-junit-report v1.0.0 // indirect - golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 // indirect + github.com/jstemmer/go-junit-report/v2 v2.0.0 // indirect + golang.org/x/sync v0.3.0 // indirect ) diff --git a/tests/tools/go.sum b/tests/tools/go.sum index e8cb91cf0e..722b8f1442 100644 --- a/tests/tools/go.sum +++ b/tests/tools/go.sum @@ -1,6 +1,8 @@ -github.com/Songmu/gotesplit v0.2.1 h1:qJFvR75nJpeKyMQFwyDtFrcc6zDWhrHAkks7DvM8oLo= -github.com/Songmu/gotesplit v0.2.1/go.mod h1:sVBfmLT26b1H5VhUpq8cRhCVK75GAmW9c8r2NiK0gzk= -github.com/jstemmer/go-junit-report v1.0.0 h1:8X1gzZpR+nVQLAht+L/foqOeX2l9DTZoaIPbEQHxsds= -github.com/jstemmer/go-junit-report v1.0.0/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4= -golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +github.com/Songmu/gotesplit v0.3.1 h1:w/xNwYEYIiIe4aErY7I4fpTYp1A53rIhx18RZfR797s= +github.com/Songmu/gotesplit v0.3.1/go.mod h1:Gc6lQzFz/oYJd2mMD8kwT1llsgtDnuEQhIQv2HSNOfg= +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/jstemmer/go-junit-report/v2 v2.0.0 h1:bMZNO9B16VFn07tKyi4YJFIbZtVmJaa5Xakv9dcwK58= +github.com/jstemmer/go-junit-report/v2 v2.0.0/go.mod h1:mgHVr7VUo5Tn8OLVr1cKnLuEy0M92wdRntM99h7RkgQ= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=