From f437e6df95dff35211d8deca2604fa84f0f917eb Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Thu, 17 Oct 2024 17:32:48 -0700 Subject: [PATCH] Remove the collectd/etcd monitor (#5520) --- CHANGELOG.md | 1 + internal/signalfx-agent/pkg/core/modules.go | 1 - .../pkg/monitors/collectd/etcd/etcd.go | 94 ------------- .../pkg/monitors/collectd/etcd/genmetadata.go | 116 ---------------- .../pkg/monitors/collectd/etcd/metadata.yaml | 125 ------------------ packaging/bundle/collectd-plugins.yaml | 6 - 6 files changed, 1 insertion(+), 342 deletions(-) delete mode 100644 internal/signalfx-agent/pkg/monitors/collectd/etcd/etcd.go delete mode 100644 internal/signalfx-agent/pkg/monitors/collectd/etcd/genmetadata.go delete mode 100644 internal/signalfx-agent/pkg/monitors/collectd/etcd/metadata.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index d9af2ef5b7..999363c6d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - (Splunk) Remove httpsink exporter ([#](https://github.com/signalfx/splunk-otel-collector/pull/)) - (Splunk) Remove signalfx-metadata and collectd/metadata monitors ([#](https://github.com/signalfx/splunk-otel-collector/pull/)) Both monitors are deprecated and replaced by the hostmetricsreceiver and processlist monitor. +- (Splunk) Remove deprecated collectd/etcd monitor. [Please use the etcd prometheus endpoint to scrape metrics.](https://etcd.io/docs/v3.5/metrics/) ([#](https://github.com/signalfx/splunk-otel-collector/pull/)) ### 🚩Deprecations 🚩 diff --git a/internal/signalfx-agent/pkg/core/modules.go b/internal/signalfx-agent/pkg/core/modules.go index f1b3c845da..5a99790d4e 100644 --- a/internal/signalfx-agent/pkg/core/modules.go +++ b/internal/signalfx-agent/pkg/core/modules.go @@ -11,7 +11,6 @@ import ( _ "github.com/signalfx/signalfx-agent/pkg/monitors/cloudfoundry" _ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/consul" _ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/couchbase" - _ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/etcd" _ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/hadoop" _ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/healthchecker" _ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/jenkins" diff --git a/internal/signalfx-agent/pkg/monitors/collectd/etcd/etcd.go b/internal/signalfx-agent/pkg/monitors/collectd/etcd/etcd.go deleted file mode 100644 index 73fdb28869..0000000000 --- a/internal/signalfx-agent/pkg/monitors/collectd/etcd/etcd.go +++ /dev/null @@ -1,94 +0,0 @@ -package etcd - -import ( - "strconv" - - "github.com/signalfx/signalfx-agent/pkg/monitors/collectd" - - "github.com/signalfx/signalfx-agent/pkg/core/config" - - "github.com/signalfx/signalfx-agent/pkg/monitors" - "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/python" - "github.com/signalfx/signalfx-agent/pkg/monitors/subproc" -) - -func init() { - monitors.Register(&monitorMetadata, func() interface{} { - return &Monitor{ - python.PyMonitor{ - MonitorCore: subproc.New(), - }, - } - }, &Config{}) -} - -// Config is the monitor-specific config with the generic config embedded -type Config struct { - config.MonitorConfig `yaml:",inline" acceptsEndpoints:"true"` - python.CommonConfig `yaml:",inline"` - pyConf *python.Config - Host string `yaml:"host" validate:"required"` - Port uint16 `yaml:"port" validate:"required"` - // An arbitrary name of the etcd cluster to make it easier to group - // together and identify instances. - ClusterName string `yaml:"clusterName" validate:"required"` - // Client private key if using client certificate authentication. - SSLKeyFile string `yaml:"sslKeyFile"` - // Client public key if using client certificate authentication. - SSLCertificate string `yaml:"sslCertificate"` - // Certificate authority or host certificate to trust. - SSLCACerts string `yaml:"sslCACerts"` - // If `true`, etcd's SSL certificate will not be verified. Enabling this option - // results in the `sslCACerts` option being ignored. - SkipSSLValidation bool `yaml:"skipSSLValidation"` - EnhancedMetrics bool `yaml:"enhancedMetrics"` -} - -// PythonConfig returns the embedded python.Config struct from the interface -func (c *Config) PythonConfig() *python.Config { - c.pyConf.CommonConfig = c.CommonConfig - return c.pyConf -} - -// Monitor is the main type that represents the monitor -type Monitor struct { - python.PyMonitor -} - -// Configure configures and runs the plugin in collectd -func (m *Monitor) Configure(conf *Config) error { - m.Logger().Warn("The ectd-collectd plugin is deprecated. Please use the etcd monitor instead. See https://docs.splunk.com/observability/en/gdi/monitors-databases/etcd.html for more information. This plugin will be removed in a future release.") - conf.pyConf = &python.Config{ - MonitorConfig: conf.MonitorConfig, - Host: conf.Host, - Port: conf.Port, - ModuleName: "etcd_plugin", - ModulePaths: []string{collectd.MakePythonPluginPath(conf.BundleDir, "etcd")}, - TypesDBPaths: []string{collectd.DefaultTypesDBPath(conf.BundleDir)}, - PluginConfig: map[string]interface{}{ - "Host": conf.Host, - "Port": conf.Port, - "Interval": conf.IntervalSeconds, - "Cluster": conf.ClusterName, - // Format as a string because collectd passes through bools as strings whereas - // we pass them through as bools so the logic currently used in collectd-etcd - // does not work correctly with bools. Maybe subproc should be changed to - // behave the same as collectd? - "ssl_cert_validation": strconv.FormatBool(!conf.SkipSSLValidation), - "EnhancedMetrics": conf.EnhancedMetrics, - "ssl_keyfile": conf.SSLKeyFile, - "ssl_certificate": conf.SSLCertificate, - "ssl_ca_certs": conf.SSLCACerts, - }, - } - - return m.PyMonitor.Configure(conf) -} - -// GetExtraMetrics returns additional metrics that should be allowed through. -func (c *Config) GetExtraMetrics() []string { - if c.EnhancedMetrics { - return monitorMetadata.NonDefaultMetrics() - } - return nil -} diff --git a/internal/signalfx-agent/pkg/monitors/collectd/etcd/genmetadata.go b/internal/signalfx-agent/pkg/monitors/collectd/etcd/genmetadata.go deleted file mode 100644 index 4ed5c75c3d..0000000000 --- a/internal/signalfx-agent/pkg/monitors/collectd/etcd/genmetadata.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by monitor-code-gen. DO NOT EDIT. - -package etcd - -import ( - "github.com/signalfx/golib/v3/datapoint" - "github.com/signalfx/signalfx-agent/pkg/monitors" -) - -const monitorType = "collectd/etcd" - -var groupSet = map[string]bool{} - -const ( - counterEtcdLeaderCountsFail = "counter.etcd.leader.counts.fail" - counterEtcdLeaderCountsSuccess = "counter.etcd.leader.counts.success" - counterEtcdSelfRecvappendreqCnt = "counter.etcd.self.recvappendreq.cnt" - counterEtcdSelfSendappendreqCnt = "counter.etcd.self.sendappendreq.cnt" - counterEtcdStoreCompareanddeleteFail = "counter.etcd.store.compareanddelete.fail" - counterEtcdStoreCompareanddeleteSuccess = "counter.etcd.store.compareanddelete.success" - counterEtcdStoreCompareandswapFail = "counter.etcd.store.compareandswap.fail" - counterEtcdStoreCompareandswapSuccess = "counter.etcd.store.compareandswap.success" - counterEtcdStoreCreateFail = "counter.etcd.store.create.fail" - counterEtcdStoreCreateSuccess = "counter.etcd.store.create.success" - counterEtcdStoreDeleteFail = "counter.etcd.store.delete.fail" - counterEtcdStoreDeleteSuccess = "counter.etcd.store.delete.success" - counterEtcdStoreExpireCount = "counter.etcd.store.expire.count" - counterEtcdStoreGetsFail = "counter.etcd.store.gets.fail" - counterEtcdStoreGetsSuccess = "counter.etcd.store.gets.success" - counterEtcdStoreSetsFail = "counter.etcd.store.sets.fail" - counterEtcdStoreSetsSuccess = "counter.etcd.store.sets.success" - counterEtcdStoreUpdateFail = "counter.etcd.store.update.fail" - counterEtcdStoreUpdateSuccess = "counter.etcd.store.update.success" - gaugeEtcdLeaderLatencyAverage = "gauge.etcd.leader.latency.average" - gaugeEtcdLeaderLatencyCurrent = "gauge.etcd.leader.latency.current" - gaugeEtcdLeaderLatencyMax = "gauge.etcd.leader.latency.max" - gaugeEtcdLeaderLatencyMin = "gauge.etcd.leader.latency.min" - gaugeEtcdLeaderLatencyStddev = "gauge.etcd.leader.latency.stddev" - gaugeEtcdSelfRecvbandwidthRate = "gauge.etcd.self.recvbandwidth.rate" - gaugeEtcdSelfRecvpkgRate = "gauge.etcd.self.recvpkg.rate" - gaugeEtcdSelfSendbandwidthRate = "gauge.etcd.self.sendbandwidth.rate" - gaugeEtcdSelfSendpkgRate = "gauge.etcd.self.sendpkg.rate" - gaugeEtcdStoreWatchers = "gauge.etcd.store.watchers" -) - -var metricSet = map[string]monitors.MetricInfo{ - counterEtcdLeaderCountsFail: {Type: datapoint.Count}, - counterEtcdLeaderCountsSuccess: {Type: datapoint.Count}, - counterEtcdSelfRecvappendreqCnt: {Type: datapoint.Count}, - counterEtcdSelfSendappendreqCnt: {Type: datapoint.Count}, - counterEtcdStoreCompareanddeleteFail: {Type: datapoint.Count}, - counterEtcdStoreCompareanddeleteSuccess: {Type: datapoint.Count}, - counterEtcdStoreCompareandswapFail: {Type: datapoint.Count}, - counterEtcdStoreCompareandswapSuccess: {Type: datapoint.Count}, - counterEtcdStoreCreateFail: {Type: datapoint.Count}, - counterEtcdStoreCreateSuccess: {Type: datapoint.Count}, - counterEtcdStoreDeleteFail: {Type: datapoint.Count}, - counterEtcdStoreDeleteSuccess: {Type: datapoint.Count}, - counterEtcdStoreExpireCount: {Type: datapoint.Count}, - counterEtcdStoreGetsFail: {Type: datapoint.Count}, - counterEtcdStoreGetsSuccess: {Type: datapoint.Count}, - counterEtcdStoreSetsFail: {Type: datapoint.Count}, - counterEtcdStoreSetsSuccess: {Type: datapoint.Count}, - counterEtcdStoreUpdateFail: {Type: datapoint.Count}, - counterEtcdStoreUpdateSuccess: {Type: datapoint.Count}, - gaugeEtcdLeaderLatencyAverage: {Type: datapoint.Gauge}, - gaugeEtcdLeaderLatencyCurrent: {Type: datapoint.Gauge}, - gaugeEtcdLeaderLatencyMax: {Type: datapoint.Gauge}, - gaugeEtcdLeaderLatencyMin: {Type: datapoint.Gauge}, - gaugeEtcdLeaderLatencyStddev: {Type: datapoint.Gauge}, - gaugeEtcdSelfRecvbandwidthRate: {Type: datapoint.Gauge}, - gaugeEtcdSelfRecvpkgRate: {Type: datapoint.Gauge}, - gaugeEtcdSelfSendbandwidthRate: {Type: datapoint.Gauge}, - gaugeEtcdSelfSendpkgRate: {Type: datapoint.Gauge}, - gaugeEtcdStoreWatchers: {Type: datapoint.Gauge}, -} - -var defaultMetrics = map[string]bool{ - counterEtcdLeaderCountsFail: true, - counterEtcdLeaderCountsSuccess: true, - counterEtcdSelfRecvappendreqCnt: true, - counterEtcdSelfSendappendreqCnt: true, - counterEtcdStoreCompareanddeleteFail: true, - counterEtcdStoreCompareanddeleteSuccess: true, - counterEtcdStoreCompareandswapFail: true, - counterEtcdStoreCompareandswapSuccess: true, - counterEtcdStoreCreateFail: true, - counterEtcdStoreCreateSuccess: true, - counterEtcdStoreDeleteFail: true, - counterEtcdStoreDeleteSuccess: true, - counterEtcdStoreExpireCount: true, - counterEtcdStoreGetsFail: true, - counterEtcdStoreGetsSuccess: true, - counterEtcdStoreSetsFail: true, - counterEtcdStoreSetsSuccess: true, - counterEtcdStoreUpdateFail: true, - counterEtcdStoreUpdateSuccess: true, - gaugeEtcdLeaderLatencyCurrent: true, - gaugeEtcdSelfRecvbandwidthRate: true, - gaugeEtcdSelfRecvpkgRate: true, - gaugeEtcdSelfSendbandwidthRate: true, - gaugeEtcdSelfSendpkgRate: true, - gaugeEtcdStoreWatchers: true, -} - -var groupMetricsMap = map[string][]string{} - -var monitorMetadata = monitors.Metadata{ - MonitorType: "collectd/etcd", - DefaultMetrics: defaultMetrics, - Metrics: metricSet, - SendUnknown: false, - Groups: groupSet, - GroupMetricsMap: groupMetricsMap, - SendAll: false, -} diff --git a/internal/signalfx-agent/pkg/monitors/collectd/etcd/metadata.yaml b/internal/signalfx-agent/pkg/monitors/collectd/etcd/metadata.yaml deleted file mode 100644 index cd0ce998fe..0000000000 --- a/internal/signalfx-agent/pkg/monitors/collectd/etcd/metadata.yaml +++ /dev/null @@ -1,125 +0,0 @@ -monitors: -- dimensions: - doc: | - Monitors an etcd key/value store using the [collectd etcd Python plugin](https://github.com/signalfx/collectd-etcd). - - Requires etcd 2.0.8 or later. - metrics: - counter.etcd.leader.counts.fail: - description: Total number of failed rpc requests to with a follower - default: true - type: counter - counter.etcd.leader.counts.success: - description: Total number of successful rpc requests to with a follower - default: true - type: counter - counter.etcd.self.recvappendreq.cnt: - description: Total number of append requests received by a member - default: true - type: counter - counter.etcd.self.sendappendreq.cnt: - description: Total number of append requests sent by a member - default: true - type: counter - counter.etcd.store.compareanddelete.fail: - description: Total number of failed compare-and-delete operations - default: true - type: counter - counter.etcd.store.compareanddelete.success: - description: Total number of successful compare-and-delete operations - default: true - type: counter - counter.etcd.store.compareandswap.fail: - description: Total number of failed compare-and-swap operations - default: true - type: counter - counter.etcd.store.compareandswap.success: - description: Total number of successful compare-and-swap operations - default: true - type: counter - counter.etcd.store.create.fail: - description: Total number of failed create operations - default: true - type: counter - counter.etcd.store.create.success: - description: Total number of successful create operations - default: true - type: counter - counter.etcd.store.delete.fail: - description: Total number of failed delete operations - default: true - type: counter - counter.etcd.store.delete.success: - description: Total number of successful delete operations - default: true - type: counter - counter.etcd.store.expire.count: - description: Total number of items expired due to TTL - default: true - type: counter - counter.etcd.store.gets.fail: - description: Total number of failed get operations - default: true - type: counter - counter.etcd.store.gets.success: - description: Total number of successful get operations - default: true - type: counter - counter.etcd.store.sets.fail: - description: Total number of failed set operations - default: true - type: counter - counter.etcd.store.sets.success: - description: Total number of successful set operations - default: true - type: counter - counter.etcd.store.update.fail: - description: Total number of failed update operations - default: true - type: counter - counter.etcd.store.update.success: - description: Total number of successful update operations - default: true - type: counter - gauge.etcd.leader.latency.average: - description: Average latency of a follower with respect to the leader - default: false - type: gauge - gauge.etcd.leader.latency.current: - description: Current latency of a follower with respect to the leader - default: true - type: gauge - gauge.etcd.leader.latency.max: - description: Max latency of a follower with respect to the leader - default: false - type: gauge - gauge.etcd.leader.latency.min: - description: Min latency of a follower with respect to the leader - default: false - type: gauge - gauge.etcd.leader.latency.stddev: - description: Std dev latency of a follower with respect to the leader - default: false - type: gauge - gauge.etcd.self.recvbandwidth.rate: - description: Bandwidth rate of a follower - default: true - type: gauge - gauge.etcd.self.recvpkg.rate: - description: Rate at which a follower receives packages - default: true - type: gauge - gauge.etcd.self.sendbandwidth.rate: - description: Bandwidth rate of a leader - default: true - type: gauge - gauge.etcd.self.sendpkg.rate: - description: Rate at which a leader sends packages - default: true - type: gauge - gauge.etcd.store.watchers: - description: Number of watchers - default: true - type: gauge - monitorType: collectd/etcd - properties: diff --git a/packaging/bundle/collectd-plugins.yaml b/packaging/bundle/collectd-plugins.yaml index 903f12658e..df1cf242d0 100644 --- a/packaging/bundle/collectd-plugins.yaml +++ b/packaging/bundle/collectd-plugins.yaml @@ -7,12 +7,6 @@ version: v1.2.0 repo: signalfx/collectd-couchbase -- name: etcd - version: v2.0.0 - repo: signalfx/collectd-etcd - can_remove: - - integration-test - - name: hadoop version: v1.1.0 repo: signalfx/collectd-hadoop