From ed084eb09a4749c18d82791d214b68bb781fbaa6 Mon Sep 17 00:00:00 2001
From: Alex Boten <223565+codeboten@users.noreply.github.com>
Date: Tue, 6 Aug 2024 16:19:16 -0700
Subject: [PATCH 1/2] [receiver/haproxyreceiver] update scope name for
 consistency

Update the scope name for telemetry produced by the haproxyreceiverreceiver from otelcol/haproxyreceiver to github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiverreceiver

Part of https://github.com/open-telemetry/opentelemetry-collector/issues/9494

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
---
 ...odeboten_update-scope-haproxyreceiver.yaml | 27 +++++++++++++++++++
 .../internal/metadata/generated_metrics.go    |  2 +-
 receiver/haproxyreceiver/metadata.yaml        |  1 -
 .../testdata/integration/expected.yaml        |  2 +-
 .../testdata/scraper/30252_expected.yaml      | 10 +++----
 .../testdata/scraper/expected.yaml            | 12 ++++-----
 6 files changed, 40 insertions(+), 14 deletions(-)
 create mode 100644 .chloggen/codeboten_update-scope-haproxyreceiver.yaml

diff --git a/.chloggen/codeboten_update-scope-haproxyreceiver.yaml b/.chloggen/codeboten_update-scope-haproxyreceiver.yaml
new file mode 100644
index 000000000000..e7aa49286b0a
--- /dev/null
+++ b/.chloggen/codeboten_update-scope-haproxyreceiver.yaml
@@ -0,0 +1,27 @@
+# Use this changelog template to create an entry for release notes.
+
+# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
+change_type: breaking
+
+# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
+component: haproxyreceiver
+
+# A brief description of the change.  Surround your text with quotes ("") if it needs to start with a backtick (`).
+note: "Update the scope name for telemetry produced by the haproxyreceiver from `otelcol/haproxyreceiver` to `github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver`"
+
+# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
+issues: [34429]
+
+# (Optional) One or more lines of additional information to render under the primary note.
+# These lines will be padded with 2 spaces and then inserted directly into the document.
+# Use pipe (|) for multiline entries.
+subtext:
+
+# If your change doesn't affect end users or the exported elements of any package,
+# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
+# Optional: The change log or logs in which this entry should be included.
+# e.g. '[user]' or '[user, api]'
+# Include 'user' if the change is relevant to end users.
+# Include 'api' if there is a change to a library API.
+# Default: '[user]'
+change_logs: []
diff --git a/receiver/haproxyreceiver/internal/metadata/generated_metrics.go b/receiver/haproxyreceiver/internal/metadata/generated_metrics.go
index 4c078072bfe8..f5b63433549a 100644
--- a/receiver/haproxyreceiver/internal/metadata/generated_metrics.go
+++ b/receiver/haproxyreceiver/internal/metadata/generated_metrics.go
@@ -1533,7 +1533,7 @@ func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption {
 func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) {
 	rm := pmetric.NewResourceMetrics()
 	ils := rm.ScopeMetrics().AppendEmpty()
-	ils.Scope().SetName("otelcol/haproxyreceiver")
+	ils.Scope().SetName("github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver")
 	ils.Scope().SetVersion(mb.buildInfo.Version)
 	ils.Metrics().EnsureCapacity(mb.metricsCapacity)
 	mb.metricHaproxyBytesInput.emit(ils.Metrics())
diff --git a/receiver/haproxyreceiver/metadata.yaml b/receiver/haproxyreceiver/metadata.yaml
index e9c3febce0c5..513091d6f581 100644
--- a/receiver/haproxyreceiver/metadata.yaml
+++ b/receiver/haproxyreceiver/metadata.yaml
@@ -1,5 +1,4 @@
 type: haproxy
-scope_name: otelcol/haproxyreceiver
 
 status:
   class: receiver
diff --git a/receiver/haproxyreceiver/testdata/integration/expected.yaml b/receiver/haproxyreceiver/testdata/integration/expected.yaml
index 882247b1d7f8..cb9069fb4958 100644
--- a/receiver/haproxyreceiver/testdata/integration/expected.yaml
+++ b/receiver/haproxyreceiver/testdata/integration/expected.yaml
@@ -144,5 +144,5 @@ resourceMetrics:
             name: haproxy.sessions.rate
             unit: '{sessions}'
         scope:
-          name: otelcol/haproxyreceiver
+          name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver
           version: latest
diff --git a/receiver/haproxyreceiver/testdata/scraper/30252_expected.yaml b/receiver/haproxyreceiver/testdata/scraper/30252_expected.yaml
index b1b2d4b59bd9..57c3ef3540ce 100644
--- a/receiver/haproxyreceiver/testdata/scraper/30252_expected.yaml
+++ b/receiver/haproxyreceiver/testdata/scraper/30252_expected.yaml
@@ -144,7 +144,7 @@ resourceMetrics:
             name: haproxy.sessions.rate
             unit: '{sessions}'
         scope:
-          name: otelcol/haproxyreceiver
+          name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver
           version: latest
   - resource:
       attributes:
@@ -291,7 +291,7 @@ resourceMetrics:
             name: haproxy.sessions.rate
             unit: '{sessions}'
         scope:
-          name: otelcol/haproxyreceiver
+          name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver
           version: latest
   - resource:
       attributes:
@@ -480,7 +480,7 @@ resourceMetrics:
             name: haproxy.sessions.rate
             unit: '{sessions}'
         scope:
-          name: otelcol/haproxyreceiver
+          name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver
           version: latest
   - resource:
       attributes:
@@ -659,7 +659,7 @@ resourceMetrics:
             name: haproxy.sessions.rate
             unit: '{sessions}'
         scope:
-          name: otelcol/haproxyreceiver
+          name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver
           version: latest
   - resource:
       attributes:
@@ -838,5 +838,5 @@ resourceMetrics:
             name: haproxy.sessions.rate
             unit: '{sessions}'
         scope:
-          name: otelcol/haproxyreceiver
+          name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver
           version: latest
diff --git a/receiver/haproxyreceiver/testdata/scraper/expected.yaml b/receiver/haproxyreceiver/testdata/scraper/expected.yaml
index 15a4a9dc8ecb..2bf1e37f6391 100644
--- a/receiver/haproxyreceiver/testdata/scraper/expected.yaml
+++ b/receiver/haproxyreceiver/testdata/scraper/expected.yaml
@@ -144,7 +144,7 @@ resourceMetrics:
             name: haproxy.sessions.rate
             unit: '{sessions}'
         scope:
-          name: otelcol/haproxyreceiver
+          name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver
           version: latest
   - resource:
       attributes:
@@ -291,7 +291,7 @@ resourceMetrics:
             name: haproxy.sessions.rate
             unit: '{sessions}'
         scope:
-          name: otelcol/haproxyreceiver
+          name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver
           version: latest
   - resource:
       attributes:
@@ -480,7 +480,7 @@ resourceMetrics:
             name: haproxy.sessions.rate
             unit: '{sessions}'
         scope:
-          name: otelcol/haproxyreceiver
+          name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver
           version: latest
   - resource:
       attributes:
@@ -659,7 +659,7 @@ resourceMetrics:
             name: haproxy.sessions.rate
             unit: '{sessions}'
         scope:
-          name: otelcol/haproxyreceiver
+          name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver
           version: latest
   - resource:
       attributes:
@@ -838,7 +838,7 @@ resourceMetrics:
             name: haproxy.sessions.rate
             unit: '{sessions}'
         scope:
-          name: otelcol/haproxyreceiver
+          name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver
           version: latest
   - resource:
       attributes:
@@ -1017,5 +1017,5 @@ resourceMetrics:
             name: haproxy.sessions.rate
             unit: '{sessions}'
         scope:
-          name: otelcol/haproxyreceiver
+          name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver
           version: latest

From fd2c0347413213cbdbdebf63e010f761436bc925 Mon Sep 17 00:00:00 2001
From: Alex Boten <223565+codeboten@users.noreply.github.com>
Date: Wed, 7 Aug 2024 13:52:49 -0700
Subject: [PATCH 2/2] Update
 .chloggen/codeboten_update-scope-haproxyreceiver.yaml

---
 .chloggen/codeboten_update-scope-haproxyreceiver.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.chloggen/codeboten_update-scope-haproxyreceiver.yaml b/.chloggen/codeboten_update-scope-haproxyreceiver.yaml
index e7aa49286b0a..5525d24756df 100644
--- a/.chloggen/codeboten_update-scope-haproxyreceiver.yaml
+++ b/.chloggen/codeboten_update-scope-haproxyreceiver.yaml
@@ -10,7 +10,7 @@ component: haproxyreceiver
 note: "Update the scope name for telemetry produced by the haproxyreceiver from `otelcol/haproxyreceiver` to `github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver`"
 
 # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
-issues: [34429]
+issues: [34498]
 
 # (Optional) One or more lines of additional information to render under the primary note.
 # These lines will be padded with 2 spaces and then inserted directly into the document.