Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] newObsReport is no longer needed #10957

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exporter/exporterhelper/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ type baseExporter struct {
}

func newBaseExporter(set exporter.Settings, signal component.DataType, osf obsrepSenderFactory, options ...Option) (*baseExporter, error) {
obsReport, err := newObsReport(obsReportSettings{exporterID: set.ID, exporterCreateSettings: set, dataType: signal})
obsReport, err := newExporter(obsReportSettings{exporterID: set.ID, exporterCreateSettings: set, dataType: signal})
if err != nil {
return nil, err
}
Expand Down
5 changes: 0 additions & 5 deletions exporter/exporterhelper/obsexporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ type obsReportSettings struct {
dataType component.DataType
}

// newObsReport creates a new Exporter.
func newObsReport(cfg obsReportSettings) (*obsReport, error) {
return newExporter(cfg)
}

func newExporter(cfg obsReportSettings) (*obsReport, error) {
telemetryBuilder, err := metadata.NewTelemetryBuilder(cfg.exporterCreateSettings.TelemetrySettings)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions exporter/exporterhelper/obsexporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func TestCheckExporterTracesViews(t *testing.T) {
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) })

obsrep, err := newObsReport(obsReportSettings{
obsrep, err := newExporter(obsReportSettings{
exporterID: exporterID,
exporterCreateSettings: exporter.Settings{ID: exporterID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()},
})
Expand All @@ -196,7 +196,7 @@ func TestCheckExporterMetricsViews(t *testing.T) {
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) })

obsrep, err := newObsReport(obsReportSettings{
obsrep, err := newExporter(obsReportSettings{
exporterID: exporterID,
exporterCreateSettings: exporter.Settings{ID: exporterID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()},
})
Expand All @@ -216,7 +216,7 @@ func TestCheckExporterLogsViews(t *testing.T) {
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) })

obsrep, err := newObsReport(obsReportSettings{
obsrep, err := newExporter(obsReportSettings{
exporterID: exporterID,
exporterCreateSettings: exporter.Settings{ID: exporterID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()},
})
Expand Down
2 changes: 1 addition & 1 deletion exporter/exporterhelper/obsreport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestExportEnqueueFailure(t *testing.T) {
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) })

obsrep, err := newObsReport(obsReportSettings{
obsrep, err := newExporter(obsReportSettings{
exporterID: exporterID,
exporterCreateSettings: exporter.Settings{ID: exporterID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()},
})
Expand Down
2 changes: 1 addition & 1 deletion exporter/exporterhelper/queue_sender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func TestQueuedRetryPersistentEnabled_NoDataLossOnShutdown(t *testing.T) {
func TestQueueSenderNoStartShutdown(t *testing.T) {
queue := queue.NewBoundedMemoryQueue[Request](queue.MemoryQueueSettings[Request]{})
set := exportertest.NewNopSettings()
obsrep, err := newObsReport(obsReportSettings{
obsrep, err := newExporter(obsReportSettings{
exporterID: exporterID,
exporterCreateSettings: exportertest.NewNopSettings(),
})
Expand Down
Loading