From 37e12cd90be893920ad2cebc7655aec3c255131e Mon Sep 17 00:00:00 2001
From: Antoine Toulme <atoulme@splunk.com>
Date: Thu, 17 Oct 2024 08:12:51 -0700
Subject: [PATCH] Deprecate statsd monitor, use statsd receiver (#5513)

* Deprecate statsd monitor, use statsd receiver

* Update CHANGELOG.md
---
 CHANGELOG.md                                              | 1 +
 internal/signalfx-agent/pkg/monitors/statsd/metadata.yaml | 3 +++
 internal/signalfx-agent/pkg/monitors/statsd/monitor.go    | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2962c62f39..1921094437 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@
 - (Splunk) Deprecate the heroku observer. Use the [resource detection observer with heroku detector](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#heroku) instead. ([#5496](https://github.com/signalfx/splunk-otel-collector/pull/5496))
 - (Splunk) Deprecate mongodb atlas monitor. [Please use the mongodbatlasreceiver instead](https://docs.splunk.com/observability/en/gdi/opentelemetry/components/mongodb-atlas-receiver.html) ([#](https://github.com/signalfx/splunk-otel-collector/pull/))
 - (Splunk) Deprecate python-monitor monitor ([#5501](https://github.com/signalfx/splunk-otel-collector/pull/5501))
+- (Splunk) Deprecate statsd monitor. Use the [statsd receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/statsdreceiver) instead. ([#5513](https://github.com/signalfx/splunk-otel-collector/pull/5513))
 
 ## v0.111.0
 
diff --git a/internal/signalfx-agent/pkg/monitors/statsd/metadata.yaml b/internal/signalfx-agent/pkg/monitors/statsd/metadata.yaml
index c872abc6e3..2b11f5c4b0 100644
--- a/internal/signalfx-agent/pkg/monitors/statsd/metadata.yaml
+++ b/internal/signalfx-agent/pkg/monitors/statsd/metadata.yaml
@@ -1,6 +1,9 @@
 monitors:
 - dimensions:
   doc: |2
+    The statsd monitor is deprecated and will be removed in a future release.
+    Use the statsd receiver instead.
+    
     This monitor will receive and aggergate Statsd metrics and convert them to
     data points.  It listens on a configured address and port in order to
     receive the statsd metrics.  Note that this monitor does not support statsd
diff --git a/internal/signalfx-agent/pkg/monitors/statsd/monitor.go b/internal/signalfx-agent/pkg/monitors/statsd/monitor.go
index dd962a0c6d..eef81ce6d2 100644
--- a/internal/signalfx-agent/pkg/monitors/statsd/monitor.go
+++ b/internal/signalfx-agent/pkg/monitors/statsd/monitor.go
@@ -74,7 +74,7 @@ type Monitor struct {
 // Configure the monitor and kick off volume metric syncing
 func (m *Monitor) Configure(conf *Config) error {
 	m.logger = utils.NewThrottledLogger(log.WithFields(log.Fields{"monitorType": monitorMetadata.MonitorType, "monitorID": conf.MonitorID}), 30*time.Second)
-
+	m.logger.Warn("[NOTICE] The statsd monitor is deprecated and will be removed in a future release. Use the statsd receiver instead.")
 	var ctx context.Context
 	ctx, m.cancel = context.WithCancel(context.Background())