Skip to content

Commit

Permalink
Update MakeFactoryMap calls
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryax committed Feb 27, 2025
1 parent a0b5859 commit a588787
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 5 additions & 7 deletions internal/components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,12 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowseventlogreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowsperfcountersreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver"
"go.opentelemetry.io/collector/connector"
"go.opentelemetry.io/collector/connector/forwardconnector"
"go.opentelemetry.io/collector/exporter"

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / darwin-test (macos-13-xlarge)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / darwin-test (macos-14)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / otelcol (arm64)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_amd64)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / otelcol (amd64)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_arm64)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_ppc64le)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-darwin_amd64)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_arm64)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / test

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-windows_amd64)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-darwin_arm64)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_amd64)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-windows_amd64)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_ppc64le)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_amd64)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_arm64)

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / coverage

"go.opentelemetry.io/collector/exporter" imported and not used

Check failure on line 123 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / windows-test (windows-2025)

"go.opentelemetry.io/collector/exporter" imported and not used
"go.opentelemetry.io/collector/exporter/debugexporter"
"go.opentelemetry.io/collector/exporter/nopexporter"
"go.opentelemetry.io/collector/exporter/otlpexporter"
"go.opentelemetry.io/collector/exporter/otlphttpexporter"
"go.opentelemetry.io/collector/extension"
"go.opentelemetry.io/collector/extension/zpagesextension"
"go.opentelemetry.io/collector/otelcol"
"go.opentelemetry.io/collector/processor"

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / darwin-test (macos-13-xlarge)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / darwin-test (macos-14)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / otelcol (arm64)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_amd64)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / otelcol (amd64)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_arm64)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_ppc64le)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-darwin_amd64)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_arm64)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / test

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-windows_amd64)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-darwin_arm64)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_amd64)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-windows_amd64)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_ppc64le)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_amd64)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / cross-compile (binaries-linux_arm64)

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / coverage

"go.opentelemetry.io/collector/processor" imported and not used

Check failure on line 130 in internal/components/components.go

View workflow job for this annotation

GitHub Actions / windows-test (windows-2025)

"go.opentelemetry.io/collector/processor" imported and not used
Expand All @@ -148,7 +146,7 @@ import (

func Get() (otelcol.Factories, error) {
var errs []error
extensions, err := otelcol.MakeFactoryMap[extension.Factory](
extensions, err := otelcol.MakeFactoryMap(
ackextension.NewFactory(),
basicauthextension.NewFactory(),
bearertokenauthextension.NewFactory(),
Expand All @@ -170,7 +168,7 @@ func Get() (otelcol.Factories, error) {
errs = append(errs, err)
}

receivers, err := otelcol.MakeFactoryMap[receiver.Factory](
receivers, err := otelcol.MakeFactoryMap(
activedirectorydsreceiver.NewFactory(),
apachereceiver.NewFactory(),
apachesparkreceiver.NewFactory(),
Expand Down Expand Up @@ -244,7 +242,7 @@ func Get() (otelcol.Factories, error) {
errs = append(errs, err)
}

exporters, err := otelcol.MakeFactoryMap[exporter.Factory](
exporters, err := otelcol.MakeFactoryMap(
awss3exporter.NewFactory(),
debugexporter.NewFactory(),
fileexporter.NewFactory(),
Expand All @@ -262,7 +260,7 @@ func Get() (otelcol.Factories, error) {
errs = append(errs, err)
}

processors, err := otelcol.MakeFactoryMap[processor.Factory](
processors, err := otelcol.MakeFactoryMap(
attributesprocessor.NewFactory(),
batchprocessor.NewFactory(),
cumulativetodeltaprocessor.NewFactory(),
Expand All @@ -287,7 +285,7 @@ func Get() (otelcol.Factories, error) {
errs = append(errs, err)
}

connectors, err := connector.MakeFactoryMap(
connectors, err := otelcol.MakeFactoryMap(
countconnector.NewFactory(),
forwardconnector.NewFactory(),
routingconnector.NewFactory(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/otelcol"
"go.opentelemetry.io/collector/receiver"
"go.opentelemetry.io/collector/receiver/receivertest"

"github.com/signalfx/splunk-otel-collector/internal/receiver/signalfxgatewayprometheusremotewritereceiver/internal/metadata"
Expand Down Expand Up @@ -61,7 +60,7 @@ func TestNewFactory(t *testing.T) {
func TestFactoryOtelIntegration(t *testing.T) {
cfg := NewFactory().CreateDefaultConfig()
require.NotNil(t, cfg)
factory, err := otelcol.MakeFactoryMap[receiver.Factory](NewFactory())
factory, err := otelcol.MakeFactoryMap(NewFactory())
factories := otelcol.Factories{Receivers: factory}
require.NoError(t, err)
parsedFactory := factories.Receivers[metadata.Type]
Expand Down

0 comments on commit a588787

Please sign in to comment.