Skip to content

Commit 87b6a76

Browse files
authored
fix: remove mbreceiver and fbreceiver imports from translate pkg (#11246)
Stop importing metricbeatreceiver and filebeatreceiver into the unrelated translate config package. Those Beats imports pull in many heavy dependencies - including several CGO components - that significantly inflate build and test times.
1 parent a2919eb commit 87b6a76

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

internal/pkg/otel/translate/otelconfig.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ import (
2323
"golang.org/x/exp/maps"
2424

2525
"github.com/elastic/beats/v7/libbeat/outputs/elasticsearch"
26-
"github.com/elastic/beats/v7/x-pack/filebeat/fbreceiver"
2726
"github.com/elastic/beats/v7/x-pack/libbeat/management"
28-
"github.com/elastic/beats/v7/x-pack/metricbeat/mbreceiver"
2927
"github.com/elastic/elastic-agent-client/v7/pkg/client"
3028
"github.com/elastic/elastic-agent-libs/config"
3129
"github.com/elastic/elastic-agent/internal/pkg/agent/application/info"
@@ -388,9 +386,9 @@ func getReceiverTypeForComponent(comp *component.Component) (otelcomponent.Type,
388386
beatName := GetBeatNameForComponent(comp)
389387
switch beatName {
390388
case "filebeat":
391-
return otelcomponent.MustNewType(fbreceiver.Name), nil
389+
return otelcomponent.MustNewType("filebeatreceiver"), nil
392390
case "metricbeat":
393-
return otelcomponent.MustNewType(mbreceiver.Name), nil
391+
return otelcomponent.MustNewType("metricbeatreceiver"), nil
394392
default:
395393
return otelcomponent.Type{}, fmt.Errorf("unknown otel receiver type for input type: %s", comp.InputType)
396394
}

0 commit comments

Comments
 (0)