From f631ea812ce045ce9d08dc2ea44c504953573e2e Mon Sep 17 00:00:00 2001 From: Rory Crispin Date: Fri, 19 Jul 2024 16:59:16 +0100 Subject: [PATCH] ClickHouse changes patch --- cmd/otelcontribcol/components.go | 43 ++++++++++++----------- cmd/otelcontribcol/go.mod | 4 +-- cmd/otelcontribcol/main.go | 5 ++- cmd/otelcontribcol/main_windows.go | 1 - processor/loghouseprocessor/factory.go | 7 ++-- processor/loghouseprocessor/go.mod | 4 --- processor/loghouseprocessor/go.sum | 5 --- processor/loghouseprocessor/metadata.yaml | 13 +++++++ 8 files changed, 42 insertions(+), 40 deletions(-) create mode 100644 processor/loghouseprocessor/metadata.yaml diff --git a/cmd/otelcontribcol/components.go b/cmd/otelcontribcol/components.go index 6cb68e059520..b793a7ad322e 100644 --- a/cmd/otelcontribcol/components.go +++ b/cmd/otelcontribcol/components.go @@ -3,25 +3,6 @@ package main import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/connector" - forwardconnector "go.opentelemetry.io/collector/connector/forwardconnector" - "go.opentelemetry.io/collector/exporter" - debugexporter "go.opentelemetry.io/collector/exporter/debugexporter" - nopexporter "go.opentelemetry.io/collector/exporter/nopexporter" - otlpexporter "go.opentelemetry.io/collector/exporter/otlpexporter" - otlphttpexporter "go.opentelemetry.io/collector/exporter/otlphttpexporter" - "go.opentelemetry.io/collector/extension" - ballastextension "go.opentelemetry.io/collector/extension/ballastextension" - zpagesextension "go.opentelemetry.io/collector/extension/zpagesextension" - "go.opentelemetry.io/collector/otelcol" - "go.opentelemetry.io/collector/processor" - batchprocessor "go.opentelemetry.io/collector/processor/batchprocessor" - memorylimiterprocessor "go.opentelemetry.io/collector/processor/memorylimiterprocessor" - "go.opentelemetry.io/collector/receiver" - nopreceiver "go.opentelemetry.io/collector/receiver/nopreceiver" - otlpreceiver "go.opentelemetry.io/collector/receiver/otlpreceiver" - countconnector "github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector" datadogconnector "github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector" exceptionsconnector "github.com/open-telemetry/opentelemetry-collector-contrib/connector/exceptionsconnector" @@ -218,6 +199,24 @@ import ( windowsperfcountersreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowsperfcountersreceiver" zipkinreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver" zookeeperreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zookeeperreceiver" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/connector" + forwardconnector "go.opentelemetry.io/collector/connector/forwardconnector" + "go.opentelemetry.io/collector/exporter" + debugexporter "go.opentelemetry.io/collector/exporter/debugexporter" + nopexporter "go.opentelemetry.io/collector/exporter/nopexporter" + otlpexporter "go.opentelemetry.io/collector/exporter/otlpexporter" + otlphttpexporter "go.opentelemetry.io/collector/exporter/otlphttpexporter" + "go.opentelemetry.io/collector/extension" + ballastextension "go.opentelemetry.io/collector/extension/ballastextension" + zpagesextension "go.opentelemetry.io/collector/extension/zpagesextension" + "go.opentelemetry.io/collector/otelcol" + "go.opentelemetry.io/collector/processor" + batchprocessor "go.opentelemetry.io/collector/processor/batchprocessor" + memorylimiterprocessor "go.opentelemetry.io/collector/processor/memorylimiterprocessor" + "go.opentelemetry.io/collector/receiver" + nopreceiver "go.opentelemetry.io/collector/receiver/nopreceiver" + otlpreceiver "go.opentelemetry.io/collector/receiver/otlpreceiver" ) func components() (otelcol.Factories, error) { @@ -598,14 +597,12 @@ func components() (otelcol.Factories, error) { cumulativetodeltaprocessor.NewFactory(), deltatorateprocessor.NewFactory(), filterprocessor.NewFactory(), - loghouseprocessor.NewFactory(), groupbyattrsprocessor.NewFactory(), groupbytraceprocessor.NewFactory(), intervalprocessor.NewFactory(), k8sattributesprocessor.NewFactory(), metricsgenerationprocessor.NewFactory(), metricstransformprocessor.NewFactory(), - logstransformprocessor.NewFactory(), probabilisticsamplerprocessor.NewFactory(), redactionprocessor.NewFactory(), resourcedetectionprocessor.NewFactory(), @@ -616,6 +613,8 @@ func components() (otelcol.Factories, error) { tailsamplingprocessor.NewFactory(), transformprocessor.NewFactory(), remotetapprocessor.NewFactory(), + logstransformprocessor.NewFactory(), + loghouseprocessor.NewFactory(), ) if err != nil { return otelcol.Factories{}, err @@ -643,6 +642,8 @@ func components() (otelcol.Factories, error) { factories.ProcessorModules[tailsamplingprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.105.0" factories.ProcessorModules[transformprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.105.0" factories.ProcessorModules[remotetapprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/remotetapprocessor v0.105.0" + factories.ProcessorModules[logstransformprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/logstransformprocessor v0.105.0" + factories.ProcessorModules[loghouseprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/loghouseprocessor v0.105.0" factories.Connectors, err = connector.MakeFactoryMap( forwardconnector.NewFactory(), diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 73ffda7b72e0..35911b31185c 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -4,7 +4,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/otelcontrib go 1.21.0 -toolchain go1.21.12 +toolchain go1.22.5 require ( github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provider/s3provider v0.105.0 @@ -105,9 +105,9 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbytraceprocessor v0.105.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/intervalprocessor v0.105.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.105.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricsgenerationprocessor v0.105.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/loghouseprocessor v0.105.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/logstransformprocessor v0.105.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricsgenerationprocessor v0.105.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstransformprocessor v0.105.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.105.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/redactionprocessor v0.105.0 diff --git a/cmd/otelcontribcol/main.go b/cmd/otelcontribcol/main.go index a6eea891e39a..9363433b3af4 100644 --- a/cmd/otelcontribcol/main.go +++ b/cmd/otelcontribcol/main.go @@ -6,6 +6,8 @@ package main import ( "log" + s3provider "github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provider/s3provider" + secretsmanagerprovider "github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provider/secretsmanagerprovider" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/confmap/converter/expandconverter" @@ -15,9 +17,6 @@ import ( httpsprovider "go.opentelemetry.io/collector/confmap/provider/httpsprovider" yamlprovider "go.opentelemetry.io/collector/confmap/provider/yamlprovider" "go.opentelemetry.io/collector/otelcol" - - s3provider "github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provider/s3provider" - secretsmanagerprovider "github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provider/secretsmanagerprovider" ) func main() { diff --git a/cmd/otelcontribcol/main_windows.go b/cmd/otelcontribcol/main_windows.go index bb68124a52c9..60d78b30a75f 100644 --- a/cmd/otelcontribcol/main_windows.go +++ b/cmd/otelcontribcol/main_windows.go @@ -7,7 +7,6 @@ package main import ( "errors" "fmt" - "go.opentelemetry.io/collector/otelcol" "golang.org/x/sys/windows" "golang.org/x/sys/windows/svc" diff --git a/processor/loghouseprocessor/factory.go b/processor/loghouseprocessor/factory.go index 7be258d9b050..afa8faecef4c 100644 --- a/processor/loghouseprocessor/factory.go +++ b/processor/loghouseprocessor/factory.go @@ -12,15 +12,14 @@ import ( "go.opentelemetry.io/otel/metric" ) -const ( - // The value of "type" key in configuration. - typeStr = "loghouse" +var ( +// LoghouseProcessorType component.Type = "loghouseprocessor" ) // NewFactory creates a factory for the routing processor. func NewFactory() processor.Factory { return processor.NewFactory( - typeStr, + component.MustNewType("json_log_encoding"), createDefaultConfig, processor.WithLogs(createLogsProcessor, component.StabilityLevelBeta), ) diff --git a/processor/loghouseprocessor/go.mod b/processor/loghouseprocessor/go.mod index 653247ee0ff5..7069175a6462 100644 --- a/processor/loghouseprocessor/go.mod +++ b/processor/loghouseprocessor/go.mod @@ -10,14 +10,11 @@ require ( go.opentelemetry.io/collector/pdata v1.0.2-0.20240125183026-3cacd40b27e8 go.opentelemetry.io/collector/processor v0.93.1-0.20240125183026-3cacd40b27e8 go.opentelemetry.io/otel/metric v1.22.0 - go.opentelemetry.io/otel/sdk/metric v1.22.0 go.uber.org/zap v1.26.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-logr/logr v1.4.1 // indirect - github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -32,7 +29,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.93.1-0.20240125183026-3cacd40b27e8 // indirect go.opentelemetry.io/collector/confmap v0.93.1-0.20240125183026-3cacd40b27e8 // indirect go.opentelemetry.io/otel v1.22.0 // indirect - go.opentelemetry.io/otel/sdk v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.20.0 // indirect diff --git a/processor/loghouseprocessor/go.sum b/processor/loghouseprocessor/go.sum index 4d1f3960c808..b05928b29e30 100644 --- a/processor/loghouseprocessor/go.sum +++ b/processor/loghouseprocessor/go.sum @@ -6,11 +6,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -76,9 +73,7 @@ go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfD go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= -go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI= -go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ= go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= diff --git a/processor/loghouseprocessor/metadata.yaml b/processor/loghouseprocessor/metadata.yaml new file mode 100644 index 000000000000..ea9cdb7a3cc8 --- /dev/null +++ b/processor/loghouseprocessor/metadata.yaml @@ -0,0 +1,13 @@ +type: processor +scope_name: otelcol/loghouse + +status: + class: processor + stability: + alpha: [traces, metrics, logs] + distributions: [core, contrib] + warnings: [Orphaned Telemetry, Other] + codeowners: + active: [RoryCrispin] +tests: + config: