diff --git a/.chloggen/codeboten_cleanup-unnecessary-func-2.yaml b/.chloggen/codeboten_cleanup-unnecessary-func-2.yaml new file mode 100644 index 00000000000..16a7b9ae301 --- /dev/null +++ b/.chloggen/codeboten_cleanup-unnecessary-func-2.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: deprecation + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: scraperhelper + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: deprecate NewObsReport, ObsReport, ObsReportSettings, scrapers should use NewScraperControllerReceiver + +# One or more tracking issues or pull requests related to the change +issues: [10959] + +# (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: + +# 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: [api] diff --git a/receiver/scraperhelper/obsreport.go b/receiver/scraperhelper/obsreport.go index af9a89c4fc0..271551c80db 100644 --- a/receiver/scraperhelper/obsreport.go +++ b/receiver/scraperhelper/obsreport.go @@ -20,6 +20,8 @@ import ( ) // ObsReport is a helper to add observability to a scraper. +// +// Deprecated: [v0.108.0] will be removed. type ObsReport struct { receiverID component.ID scraper component.ID @@ -30,6 +32,8 @@ type ObsReport struct { } // ObsReportSettings are settings for creating an ObsReport. +// +// Deprecated: [v0.108.0] will be removed. type ObsReportSettings struct { ReceiverID component.ID Scraper component.ID @@ -37,6 +41,8 @@ type ObsReportSettings struct { } // NewObsReport creates a new ObsReport. +// +// Deprecated: [v0.108.0] will be removed, scrapers should use NewScraperControllerReceiver instead. func NewObsReport(cfg ObsReportSettings) (*ObsReport, error) { return newScraper(cfg) } diff --git a/receiver/scraperhelper/obsreport_test.go b/receiver/scraperhelper/obsreport_test.go index 94d58f18d97..88445e57fa8 100644 --- a/receiver/scraperhelper/obsreport_test.go +++ b/receiver/scraperhelper/obsreport_test.go @@ -95,7 +95,7 @@ func TestCheckScraperMetricsViews(t *testing.T) { require.NoError(t, err) t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) }) - s, err := NewObsReport(ObsReportSettings{ + s, err := newScraper(ObsReportSettings{ ReceiverID: receiverID, Scraper: scraperID, ReceiverCreateSettings: receiver.Settings{ID: receiverID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()}, diff --git a/receiver/scraperhelper/scrapercontroller.go b/receiver/scraperhelper/scrapercontroller.go index eed33fd2193..7ed92497e3f 100644 --- a/receiver/scraperhelper/scrapercontroller.go +++ b/receiver/scraperhelper/scrapercontroller.go @@ -103,7 +103,7 @@ func NewScraperControllerReceiver( sc.obsScrapers = make([]*ObsReport, len(sc.scrapers)) for i, scraper := range sc.scrapers { - scrp, err := NewObsReport(ObsReportSettings{ + scrp, err := newScraper(ObsReportSettings{ ReceiverID: sc.id, Scraper: scraper.ID(), ReceiverCreateSettings: sc.recvSettings,