From dfec18e015678ac9af3276e8a13e5b71b0fcb966 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Wed, 18 May 2022 11:52:55 -0600 Subject: [PATCH 1/3] register transform processor --- cmd/configschema/go.mod | 4 ++++ cmd/configschema/go.sum | 6 ++++++ go.mod | 2 ++ go.sum | 4 ++++ internal/components/components.go | 2 ++ internal/components/processors_test.go | 3 +++ 6 files changed, 21 insertions(+) diff --git a/cmd/configschema/go.mod b/cmd/configschema/go.mod index a6209c47ee1e..e3acf0cc542a 100644 --- a/cmd/configschema/go.mod +++ b/cmd/configschema/go.mod @@ -55,6 +55,7 @@ require ( github.com/Shopify/sarama v1.33.0 // indirect github.com/Showmax/go-fqdn v1.0.0 // indirect github.com/StackExchange/wmi v1.2.1 // indirect + github.com/alecthomas/participle/v2 v2.0.0-alpha8 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/aliyun/aliyun-log-go-sdk v0.1.35 // indirect github.com/antonmedv/expr v1.9.0 // indirect @@ -328,6 +329,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.51.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor v0.51.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.51.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.51.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/receiver/activedirectorydsreceiver v0.51.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/receiver/apachereceiver v0.51.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.51.0 // indirect @@ -722,6 +724,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/span replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor => ../../processor/tailsamplingprocessor +replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor => ../../processor/transformprocessor + replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/activedirectorydsreceiver => ../../receiver/activedirectorydsreceiver replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/apachereceiver => ../../receiver/apachereceiver diff --git a/cmd/configschema/go.sum b/cmd/configschema/go.sum index 75980b666ec7..7ab43809d760 100644 --- a/cmd/configschema/go.sum +++ b/cmd/configschema/go.sum @@ -241,6 +241,10 @@ github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrd github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/alecthomas/participle/v2 v2.0.0-alpha8 h1:X6nuChfgfQXNTE+ZdjTFSfnSNr8E07LSVLAqIIjtsGI= +github.com/alecthomas/participle/v2 v2.0.0-alpha8/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= +github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 h1:GDQdwm/gAcJcLAKQQZGOJ4knlw+7rfEQQcmwTbt4p5E= +github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -1699,6 +1703,8 @@ github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+t github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.51.0 h1:VOslfnMtg8AyeJpKHtvkH0Vzkf2xXljoPWJCLvCk+EQ= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.51.0/go.mod h1:HsIFemgyUxgmtadVkkwz//dJgr7A2JpHfCTLztmPH7Q= github.com/open-telemetry/opentelemetry-log-collection v0.29.1 h1:/Norji0OWQelS2sruZwjckJiKWrP9LO0LZd23KhWXfQ= github.com/open-telemetry/opentelemetry-log-collection v0.29.1/go.mod h1:jc765D8x90g+kMfDSSb0MxoEURxoCxz1fV0dutvzlrc= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= diff --git a/go.mod b/go.mod index 33f531262049..eb2b275accc5 100644 --- a/go.mod +++ b/go.mod @@ -77,6 +77,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.51.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor v0.51.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.51.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.0.0-00010101000000-000000000000 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/activedirectorydsreceiver v0.51.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/apachereceiver v0.51.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.51.0 @@ -183,6 +184,7 @@ require ( github.com/Shopify/sarama v1.33.0 // indirect github.com/Showmax/go-fqdn v1.0.0 // indirect github.com/StackExchange/wmi v1.2.1 // indirect + github.com/alecthomas/participle/v2 v2.0.0-alpha8 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/aliyun/aliyun-log-go-sdk v0.1.35 // indirect github.com/antonmedv/expr v1.9.0 // indirect diff --git a/go.sum b/go.sum index 7597b5d4e32c..7cc99509b20f 100644 --- a/go.sum +++ b/go.sum @@ -241,6 +241,10 @@ github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrd github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/alecthomas/participle/v2 v2.0.0-alpha8 h1:X6nuChfgfQXNTE+ZdjTFSfnSNr8E07LSVLAqIIjtsGI= +github.com/alecthomas/participle/v2 v2.0.0-alpha8/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= +github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 h1:GDQdwm/gAcJcLAKQQZGOJ4knlw+7rfEQQcmwTbt4p5E= +github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= diff --git a/internal/components/components.go b/internal/components/components.go index 25568e2e842f..d03942d12ed2 100644 --- a/internal/components/components.go +++ b/internal/components/components.go @@ -97,6 +97,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor" + "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/activedirectorydsreceiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/apachereceiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver" @@ -321,6 +322,7 @@ func Components() (component.Factories, error) { spanprocessor.NewFactory(), cumulativetodeltaprocessor.NewFactory(), deltatorateprocessor.NewFactory(), + transformprocessor.NewFactory(), } factories.Processors, err = component.MakeProcessorFactoryMap(processors...) if err != nil { diff --git a/internal/components/processors_test.go b/internal/components/processors_test.go index a86c9f1ef978..eef004179f82 100644 --- a/internal/components/processors_test.go +++ b/internal/components/processors_test.go @@ -128,6 +128,9 @@ func TestDefaultProcessors(t *testing.T) { { processor: "tail_sampling", }, + { + processor: "transform", + }, } assert.Len(t, tests, len(procFactories), "All processors MUST be added to lifecycle tests") From 21d5f032dcae8b1dc737864ec5557cd519637bb5 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Wed, 18 May 2022 12:22:00 -0600 Subject: [PATCH 2/3] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3d1fa10f715..9d67434292f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ ### 💡 Enhancements 💡 - `transformprocessor`: Add transformation of metrics (#10100) +- `transformprocessor`: Include transform processor in components (#10134) - `kubeletstatsreceiver`: Update receiver to use new Metrics Builder. All emitted metrics remain the same. (#9744) ### 🧰 Bug fixes 🧰 From e9f19db074ea89bc07f85cc94685c3a4c5814940 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Wed, 18 May 2022 14:12:11 -0600 Subject: [PATCH 3/3] ran make gotidy --- cmd/configschema/go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/configschema/go.sum b/cmd/configschema/go.sum index 144887723c42..f1b1654caeec 100644 --- a/cmd/configschema/go.sum +++ b/cmd/configschema/go.sum @@ -1703,8 +1703,6 @@ github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+t github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.51.0 h1:VOslfnMtg8AyeJpKHtvkH0Vzkf2xXljoPWJCLvCk+EQ= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.51.0/go.mod h1:HsIFemgyUxgmtadVkkwz//dJgr7A2JpHfCTLztmPH7Q= github.com/open-telemetry/opentelemetry-log-collection v0.29.1 h1:/Norji0OWQelS2sruZwjckJiKWrP9LO0LZd23KhWXfQ= github.com/open-telemetry/opentelemetry-log-collection v0.29.1/go.mod h1:jc765D8x90g+kMfDSSb0MxoEURxoCxz1fV0dutvzlrc= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=