Skip to content

Commit fbdbd50

Browse files
authored
[scraperhelper] deprecate NewObsReport, ObsReport, ObsReportSettings (#10959)
These functions and structs doesn't appear used in any of the components in either core or contrib. Deprecating to remove the surface area of the package. --------- Signed-off-by: Alex Boten <[email protected]>
1 parent 93ecf69 commit fbdbd50

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: deprecation
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: scraperhelper
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: deprecate NewObsReport, ObsReport, ObsReportSettings, scrapers should use NewScraperControllerReceiver
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [10959]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: [api]

receiver/scraperhelper/obsreport.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import (
2020
)
2121

2222
// ObsReport is a helper to add observability to a scraper.
23+
//
24+
// Deprecated: [v0.108.0] will be removed.
2325
type ObsReport struct {
2426
receiverID component.ID
2527
scraper component.ID
@@ -30,13 +32,17 @@ type ObsReport struct {
3032
}
3133

3234
// ObsReportSettings are settings for creating an ObsReport.
35+
//
36+
// Deprecated: [v0.108.0] will be removed.
3337
type ObsReportSettings struct {
3438
ReceiverID component.ID
3539
Scraper component.ID
3640
ReceiverCreateSettings receiver.Settings
3741
}
3842

3943
// NewObsReport creates a new ObsReport.
44+
//
45+
// Deprecated: [v0.108.0] will be removed, scrapers should use NewScraperControllerReceiver instead.
4046
func NewObsReport(cfg ObsReportSettings) (*ObsReport, error) {
4147
return newScraper(cfg)
4248
}

receiver/scraperhelper/obsreport_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func TestCheckScraperMetricsViews(t *testing.T) {
9595
require.NoError(t, err)
9696
t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) })
9797

98-
s, err := NewObsReport(ObsReportSettings{
98+
s, err := newScraper(ObsReportSettings{
9999
ReceiverID: receiverID,
100100
Scraper: scraperID,
101101
ReceiverCreateSettings: receiver.Settings{ID: receiverID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()},

receiver/scraperhelper/scrapercontroller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func NewScraperControllerReceiver(
103103

104104
sc.obsScrapers = make([]*ObsReport, len(sc.scrapers))
105105
for i, scraper := range sc.scrapers {
106-
scrp, err := NewObsReport(ObsReportSettings{
106+
scrp, err := newScraper(ObsReportSettings{
107107
ReceiverID: sc.id,
108108
Scraper: scraper.ID(),
109109
ReceiverCreateSettings: sc.recvSettings,

0 commit comments

Comments
 (0)