From 657d754a8fa76483860de9509a21f37bcdb58a4e Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Thu, 15 Jun 2023 10:21:42 -0700 Subject: [PATCH] [chore] add websocketprocessor to otelcontribcol (#23409) --- cmd/otelcontribcol/builder-config.yaml | 2 ++ cmd/otelcontribcol/components.go | 2 ++ cmd/otelcontribcol/go.mod | 3 +++ cmd/otelcontribcol/processors_test.go | 9 +++++++++ 4 files changed, 16 insertions(+) diff --git a/cmd/otelcontribcol/builder-config.yaml b/cmd/otelcontribcol/builder-config.yaml index adacf180f2ae..3e5b3d24426b 100644 --- a/cmd/otelcontribcol/builder-config.yaml +++ b/cmd/otelcontribcol/builder-config.yaml @@ -103,6 +103,7 @@ processors: - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor v0.79.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.79.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.79.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/websocketprocessor v0.79.0 receivers: - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.79.1-0.20230609201858-ed8547a8e5d6 @@ -404,6 +405,7 @@ replaces: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowseventlogreceiver => ../../receiver/windowseventlogreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/webhookeventreceiver => ../../receiver/webhookeventreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver => ../../extension/observer/ecsobserver + - github.com/open-telemetry/opentelemetry-collector-contrib/processor/websocketprocessor => ../../processor/websocketprocessor # see https://github.com/mattn/go-ieproxy/issues/45 - github.com/mattn/go-ieproxy => github.com/mattn/go-ieproxy v0.0.1 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest diff --git a/cmd/otelcontribcol/components.go b/cmd/otelcontribcol/components.go index 44c6e6343f71..98449d51d622 100644 --- a/cmd/otelcontribcol/components.go +++ b/cmd/otelcontribcol/components.go @@ -106,6 +106,7 @@ import ( spanprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor" tailsamplingprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor" transformprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor" + websocketprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/websocketprocessor" activedirectorydsreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/activedirectorydsreceiver" aerospikereceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/aerospikereceiver" apachereceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/apachereceiver" @@ -397,6 +398,7 @@ func components() (otelcol.Factories, error) { spanprocessor.NewFactory(), tailsamplingprocessor.NewFactory(), transformprocessor.NewFactory(), + websocketprocessor.NewFactory(), ) if err != nil { return otelcol.Factories{}, err diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index eda23caa3d1a..ab8df411f30b 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -94,6 +94,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor v0.79.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.79.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/websocketprocessor v0.79.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/activedirectorydsreceiver v0.79.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/aerospikereceiver v0.79.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/apachereceiver v0.79.0 @@ -1085,6 +1086,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/webho replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver => ../../extension/observer/ecsobserver +replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/websocketprocessor => ../../processor/websocketprocessor + replace github.com/mattn/go-ieproxy => github.com/mattn/go-ieproxy v0.0.1 replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest diff --git a/cmd/otelcontribcol/processors_test.go b/cmd/otelcontribcol/processors_test.go index 46580b2ca02a..257a2bb0e141 100644 --- a/cmd/otelcontribcol/processors_test.go +++ b/cmd/otelcontribcol/processors_test.go @@ -25,6 +25,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor" + "github.com/open-telemetry/opentelemetry-collector-contrib/processor/websocketprocessor" ) func TestDefaultProcessors(t *testing.T) { @@ -136,6 +137,14 @@ func TestDefaultProcessors(t *testing.T) { { processor: "redaction", }, + { + processor: "websocket", + getConfigFn: func() component.Config { + cfg := procFactories["websocket"].CreateDefaultConfig().(*websocketprocessor.Config) + cfg.Endpoint = "localhost:0" + return cfg + }, + }, } processorCount := 0