diff --git a/libbeat/otelbeat/beatconverter/logging.go b/libbeat/otelbeat/beatconverter/logging.go deleted file mode 100644 index 53c90f7d7ed9..000000000000 --- a/libbeat/otelbeat/beatconverter/logging.go +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package beatconverter - -import ( - "fmt" - "strings" -) - -func getOTelLogLevel(level string) (string, error) { - switch strings.ToLower(level) { - case "debug": - return "DEBUG", nil - case "info": - return "INFO", nil - case "warning": - return "WARN", nil - case "error", "critical": - return "ERROR", nil - default: - return "", fmt.Errorf("unrecognized level: %s", level) - } -} diff --git a/x-pack/filebeat/fbreceiver/receiver_leak_test.go b/x-pack/filebeat/fbreceiver/receiver_leak_test.go index d04498c24db6..f95c0997c6aa 100644 --- a/x-pack/filebeat/fbreceiver/receiver_leak_test.go +++ b/x-pack/filebeat/fbreceiver/receiver_leak_test.go @@ -21,7 +21,7 @@ import ( "go.uber.org/zap/zapcore" "go.uber.org/zap/zaptest/observer" - "github.com/elastic/beats/v7/libbeat/otelbeat/oteltest" + "github.com/elastic/beats/v7/x-pack/otel/oteltest" ) func TestLeak(t *testing.T) { diff --git a/x-pack/filebeat/fbreceiver/receiver_test.go b/x-pack/filebeat/fbreceiver/receiver_test.go index b4b9dcf4ca1a..e5d07dc265a5 100644 --- a/x-pack/filebeat/fbreceiver/receiver_test.go +++ b/x-pack/filebeat/fbreceiver/receiver_test.go @@ -23,7 +23,7 @@ import ( "sync/atomic" "testing" - "github.com/elastic/beats/v7/libbeat/otelbeat/oteltest" + "github.com/elastic/beats/v7/x-pack/otel/oteltest" "github.com/elastic/elastic-agent-libs/mapstr" "github.com/stretchr/testify/assert" diff --git a/x-pack/filebeat/input/gcppubsub/otel_test.go b/x-pack/filebeat/input/gcppubsub/otel_test.go index 341c465e47bc..36cf50f3e84c 100644 --- a/x-pack/filebeat/input/gcppubsub/otel_test.go +++ b/x-pack/filebeat/input/gcppubsub/otel_test.go @@ -18,10 +18,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/libbeat/otelbeat/oteltest" "github.com/elastic/beats/v7/libbeat/tests/integration" "github.com/elastic/beats/v7/x-pack/filebeat/input/gcppubsub/testutil" - "github.com/elastic/beats/v7/x-pack/libbeat/common/otelbeat/oteltestcol" + "github.com/elastic/beats/v7/x-pack/otel/oteltest" + "github.com/elastic/beats/v7/x-pack/otel/oteltestcol" "github.com/elastic/elastic-agent-libs/testing/estools" ) diff --git a/x-pack/filebeat/tests/integration/otel_lsexporter_test.go b/x-pack/filebeat/tests/integration/otel_lsexporter_test.go index cb673ada68b8..03098495a6c9 100644 --- a/x-pack/filebeat/tests/integration/otel_lsexporter_test.go +++ b/x-pack/filebeat/tests/integration/otel_lsexporter_test.go @@ -27,9 +27,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/libbeat/otelbeat/oteltest" "github.com/elastic/beats/v7/libbeat/tests/integration" - "github.com/elastic/beats/v7/x-pack/libbeat/common/otelbeat/oteltestcol" + "github.com/elastic/beats/v7/x-pack/otel/oteltest" + "github.com/elastic/beats/v7/x-pack/otel/oteltestcol" "github.com/elastic/elastic-agent-libs/mapstr" ) diff --git a/x-pack/filebeat/tests/integration/otel_test.go b/x-pack/filebeat/tests/integration/otel_test.go index 153e2e7c4fd7..4d6fd386b470 100644 --- a/x-pack/filebeat/tests/integration/otel_test.go +++ b/x-pack/filebeat/tests/integration/otel_test.go @@ -32,10 +32,10 @@ import ( "github.com/gofrs/uuid/v5" - "github.com/elastic/beats/v7/libbeat/otelbeat/oteltest" libbeattesting "github.com/elastic/beats/v7/libbeat/testing" "github.com/elastic/beats/v7/libbeat/tests/integration" - "github.com/elastic/beats/v7/x-pack/libbeat/common/otelbeat/oteltestcol" + "github.com/elastic/beats/v7/x-pack/otel/oteltest" + "github.com/elastic/beats/v7/x-pack/otel/oteltestcol" "github.com/elastic/elastic-agent-libs/mapstr" "github.com/elastic/elastic-agent-libs/testing/estools" "github.com/elastic/go-elasticsearch/v8" diff --git a/x-pack/libbeat/cmd/instance/beat.go b/x-pack/libbeat/cmd/instance/beat.go index f0f8210b4e9a..24ab2587ea27 100644 --- a/x-pack/libbeat/cmd/instance/beat.go +++ b/x-pack/libbeat/cmd/instance/beat.go @@ -24,7 +24,7 @@ import ( "github.com/elastic/beats/v7/libbeat/publisher/pipeline" "github.com/elastic/beats/v7/libbeat/publisher/processing" "github.com/elastic/beats/v7/libbeat/version" - "github.com/elastic/beats/v7/x-pack/libbeat/common/otelbeat/otelmanager" + "github.com/elastic/beats/v7/x-pack/otel/otelmanager" "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/keystore" "github.com/elastic/elastic-agent-libs/logp" diff --git a/x-pack/libbeat/cmd/instance/beat_test.go b/x-pack/libbeat/cmd/instance/beat_test.go index 0d76a0cdd994..710fea571aec 100644 --- a/x-pack/libbeat/cmd/instance/beat_test.go +++ b/x-pack/libbeat/cmd/instance/beat_test.go @@ -16,7 +16,7 @@ import ( "github.com/elastic/beats/v7/filebeat/cmd" "github.com/elastic/beats/v7/filebeat/input/log" "github.com/elastic/beats/v7/libbeat/management" - "github.com/elastic/beats/v7/x-pack/libbeat/common/otelbeat/otelmanager" + "github.com/elastic/beats/v7/x-pack/otel/otelmanager" conf "github.com/elastic/elastic-agent-libs/config" ) diff --git a/x-pack/libbeat/cmd/instance/receiver.go b/x-pack/libbeat/cmd/instance/receiver.go index aebd4c240c87..02dd41e50343 100644 --- a/x-pack/libbeat/cmd/instance/receiver.go +++ b/x-pack/libbeat/cmd/instance/receiver.go @@ -16,9 +16,9 @@ import ( "github.com/elastic/beats/v7/libbeat/cfgfile" "github.com/elastic/beats/v7/libbeat/cmd/instance" "github.com/elastic/beats/v7/libbeat/common/backoff" - "github.com/elastic/beats/v7/x-pack/libbeat/common/otelbeat/otelmanager" - "github.com/elastic/beats/v7/x-pack/libbeat/common/otelbeat/status" _ "github.com/elastic/beats/v7/x-pack/libbeat/include" + "github.com/elastic/beats/v7/x-pack/otel/otelmanager" + "github.com/elastic/beats/v7/x-pack/otel/status" "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/monitoring" metricreport "github.com/elastic/elastic-agent-system-metrics/report" diff --git a/x-pack/libbeat/outputs/otelconsumer/otelconsumer.go b/x-pack/libbeat/outputs/otelconsumer/otelconsumer.go index 6f94c53480b4..886d232d6dfa 100644 --- a/x-pack/libbeat/outputs/otelconsumer/otelconsumer.go +++ b/x-pack/libbeat/outputs/otelconsumer/otelconsumer.go @@ -13,10 +13,10 @@ import ( "github.com/elastic/beats/v7/libbeat/beat" "github.com/elastic/beats/v7/libbeat/common" - "github.com/elastic/beats/v7/libbeat/otelbeat/otelctx" - "github.com/elastic/beats/v7/libbeat/otelbeat/otelmap" "github.com/elastic/beats/v7/libbeat/outputs" "github.com/elastic/beats/v7/libbeat/publisher" + "github.com/elastic/beats/v7/x-pack/otel/otelctx" + "github.com/elastic/beats/v7/x-pack/otel/otelmap" "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/mapstr" diff --git a/x-pack/libbeat/outputs/otelconsumer/otelconsumer_test.go b/x-pack/libbeat/outputs/otelconsumer/otelconsumer_test.go index 6940070aa297..0c2f3cbd9419 100644 --- a/x-pack/libbeat/outputs/otelconsumer/otelconsumer_test.go +++ b/x-pack/libbeat/outputs/otelconsumer/otelconsumer_test.go @@ -22,9 +22,9 @@ import ( "go.opentelemetry.io/collector/receiver/receivertest" "github.com/elastic/beats/v7/libbeat/beat" - "github.com/elastic/beats/v7/libbeat/otelbeat/otelctx" "github.com/elastic/beats/v7/libbeat/outputs" "github.com/elastic/beats/v7/libbeat/outputs/outest" + "github.com/elastic/beats/v7/x-pack/otel/otelctx" "github.com/elastic/elastic-agent-libs/logp/logptest" "github.com/elastic/elastic-agent-libs/mapstr" ) diff --git a/x-pack/metricbeat/mbreceiver/receiver_leak_test.go b/x-pack/metricbeat/mbreceiver/receiver_leak_test.go index 86b158b67edc..eaa59ef3baef 100644 --- a/x-pack/metricbeat/mbreceiver/receiver_leak_test.go +++ b/x-pack/metricbeat/mbreceiver/receiver_leak_test.go @@ -21,7 +21,7 @@ import ( "go.uber.org/zap/zapcore" "go.uber.org/zap/zaptest/observer" - "github.com/elastic/beats/v7/libbeat/otelbeat/oteltest" + "github.com/elastic/beats/v7/x-pack/otel/oteltest" ) func TestLeak(t *testing.T) { diff --git a/x-pack/metricbeat/mbreceiver/receiver_test.go b/x-pack/metricbeat/mbreceiver/receiver_test.go index e0d0b36e2089..6aa6c9c90a1a 100644 --- a/x-pack/metricbeat/mbreceiver/receiver_test.go +++ b/x-pack/metricbeat/mbreceiver/receiver_test.go @@ -21,7 +21,7 @@ import ( "strings" "testing" - "github.com/elastic/beats/v7/libbeat/otelbeat/oteltest" + "github.com/elastic/beats/v7/x-pack/otel/oteltest" "github.com/elastic/elastic-agent-libs/mapstr" "github.com/stretchr/testify/assert" diff --git a/x-pack/metricbeat/tests/integration/otel_test.go b/x-pack/metricbeat/tests/integration/otel_test.go index fd2e907c8aaf..dc110ff63305 100644 --- a/x-pack/metricbeat/tests/integration/otel_test.go +++ b/x-pack/metricbeat/tests/integration/otel_test.go @@ -24,7 +24,7 @@ import ( libbeattesting "github.com/elastic/beats/v7/libbeat/testing" "github.com/elastic/beats/v7/libbeat/tests/integration" - "github.com/elastic/beats/v7/x-pack/libbeat/common/otelbeat/oteltestcol" + "github.com/elastic/beats/v7/x-pack/otel/oteltestcol" "github.com/elastic/elastic-agent-libs/mapstr" "github.com/elastic/elastic-agent-libs/testing/estools" ) diff --git a/libbeat/otelbeat/beatconverter/beatconverter.go b/x-pack/otel/beatconverter/beatconverter.go similarity index 88% rename from libbeat/otelbeat/beatconverter/beatconverter.go rename to x-pack/otel/beatconverter/beatconverter.go index f303ae302c45..50c6c63d0fbc 100644 --- a/libbeat/otelbeat/beatconverter/beatconverter.go +++ b/x-pack/otel/beatconverter/beatconverter.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. package beatconverter @@ -24,9 +11,9 @@ import ( "go.opentelemetry.io/collector/confmap" "github.com/elastic/beats/v7/libbeat/cloudid" - elasticsearchtranslate "github.com/elastic/beats/v7/libbeat/otelbeat/oteltranslate/outputs/elasticsearch" - logstashstranslate "github.com/elastic/beats/v7/libbeat/otelbeat/oteltranslate/outputs/logstash" "github.com/elastic/beats/v7/libbeat/outputs/elasticsearch" + elasticsearchtranslate "github.com/elastic/beats/v7/x-pack/otel/oteltranslate/outputs/elasticsearch" + logstashstranslate "github.com/elastic/beats/v7/x-pack/otel/oteltranslate/outputs/logstash" "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/logp" ) diff --git a/libbeat/otelbeat/beatconverter/beatconverter_test.go b/x-pack/otel/beatconverter/beatconverter_test.go similarity index 95% rename from libbeat/otelbeat/beatconverter/beatconverter_test.go rename to x-pack/otel/beatconverter/beatconverter_test.go index 7ab3c99d891e..4a7f29725752 100644 --- a/libbeat/otelbeat/beatconverter/beatconverter_test.go +++ b/x-pack/otel/beatconverter/beatconverter_test.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. package beatconverter diff --git a/x-pack/otel/beatconverter/logging.go b/x-pack/otel/beatconverter/logging.go new file mode 100644 index 000000000000..0080355c0b3f --- /dev/null +++ b/x-pack/otel/beatconverter/logging.go @@ -0,0 +1,25 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +package beatconverter + +import ( + "fmt" + "strings" +) + +func getOTelLogLevel(level string) (string, error) { + switch strings.ToLower(level) { + case "debug": + return "DEBUG", nil + case "info": + return "INFO", nil + case "warning": + return "WARN", nil + case "error", "critical": + return "ERROR", nil + default: + return "", fmt.Errorf("unrecognized level: %s", level) + } +} diff --git a/x-pack/otel/exporter/logstashexporter/exporter.go b/x-pack/otel/exporter/logstashexporter/exporter.go index 240240f684ce..4be594bc71ec 100644 --- a/x-pack/otel/exporter/logstashexporter/exporter.go +++ b/x-pack/otel/exporter/logstashexporter/exporter.go @@ -20,9 +20,9 @@ import ( "github.com/elastic/beats/v7/libbeat/outputs" - "github.com/elastic/beats/v7/libbeat/otelbeat/otelctx" "github.com/elastic/beats/v7/libbeat/outputs/logstash" "github.com/elastic/beats/v7/x-pack/otel/exporter/logstashexporter/internal" + "github.com/elastic/beats/v7/x-pack/otel/otelctx" "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/transport" diff --git a/x-pack/otel/exporter/logstashexporter/exporter_test.go b/x-pack/otel/exporter/logstashexporter/exporter_test.go index dac577d1ac63..a4e67d1b7f2d 100644 --- a/x-pack/otel/exporter/logstashexporter/exporter_test.go +++ b/x-pack/otel/exporter/logstashexporter/exporter_test.go @@ -21,9 +21,9 @@ import ( "go.opentelemetry.io/collector/pdata/plog" "github.com/elastic/beats/v7/libbeat/beat" - "github.com/elastic/beats/v7/libbeat/otelbeat/otelctx" "github.com/elastic/beats/v7/libbeat/publisher" "github.com/elastic/beats/v7/x-pack/otel/exporter/logstashexporter/internal" + "github.com/elastic/beats/v7/x-pack/otel/otelctx" "github.com/elastic/elastic-agent-libs/transport" ) diff --git a/x-pack/otel/exporter/logstashexporter/exporter_tls_test.go b/x-pack/otel/exporter/logstashexporter/exporter_tls_test.go index 6c370195d0b9..fe3f445af397 100644 --- a/x-pack/otel/exporter/logstashexporter/exporter_tls_test.go +++ b/x-pack/otel/exporter/logstashexporter/exporter_tls_test.go @@ -19,7 +19,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/libbeat/otelbeat/oteltest" + "github.com/elastic/beats/v7/x-pack/otel/oteltest" "github.com/elastic/elastic-agent-libs/transport/tlscommontest" v2 "github.com/elastic/go-lumber/server/v2" ) diff --git a/x-pack/otel/exporter/logstashexporter/internal/batch_test.go b/x-pack/otel/exporter/logstashexporter/internal/batch_test.go index c0c6e66fb7df..b14e5b8616eb 100644 --- a/x-pack/otel/exporter/logstashexporter/internal/batch_test.go +++ b/x-pack/otel/exporter/logstashexporter/internal/batch_test.go @@ -16,8 +16,8 @@ import ( "go.opentelemetry.io/collector/pdata/plog" "github.com/elastic/beats/v7/libbeat/beat" - "github.com/elastic/beats/v7/libbeat/otelbeat/otelctx" "github.com/elastic/beats/v7/libbeat/publisher" + "github.com/elastic/beats/v7/x-pack/otel/otelctx" ) func TestNewLogBatch(t *testing.T) { diff --git a/x-pack/otel/exporter/logstashexporter/internal/event.go b/x-pack/otel/exporter/logstashexporter/internal/event.go index a45a93cb2246..24fd2b62b50c 100644 --- a/x-pack/otel/exporter/logstashexporter/internal/event.go +++ b/x-pack/otel/exporter/logstashexporter/internal/event.go @@ -14,7 +14,7 @@ import ( "go.opentelemetry.io/collector/pdata/plog" "github.com/elastic/beats/v7/libbeat/beat" - "github.com/elastic/beats/v7/libbeat/otelbeat/otelctx" + "github.com/elastic/beats/v7/x-pack/otel/otelctx" ) func parseEvent(ctx context.Context, logRecord *plog.LogRecord) (beat.Event, error) { diff --git a/x-pack/otel/exporter/logstashexporter/internal/event_test.go b/x-pack/otel/exporter/logstashexporter/internal/event_test.go index 8a43795bc538..f2b9c32ace0c 100644 --- a/x-pack/otel/exporter/logstashexporter/internal/event_test.go +++ b/x-pack/otel/exporter/logstashexporter/internal/event_test.go @@ -17,7 +17,7 @@ import ( "go.opentelemetry.io/collector/pdata/plog" "github.com/elastic/beats/v7/libbeat/beat" - "github.com/elastic/beats/v7/libbeat/otelbeat/otelctx" + "github.com/elastic/beats/v7/x-pack/otel/otelctx" ) func TestParseEvent(t *testing.T) { diff --git a/x-pack/libbeat/common/otelbeat/beatsuth_test.go b/x-pack/otel/extension/beatsauthextension/beatsauth_test.go similarity index 99% rename from x-pack/libbeat/common/otelbeat/beatsuth_test.go rename to x-pack/otel/extension/beatsauthextension/beatsauth_test.go index 37ae87d60c38..67789f0f1ec4 100644 --- a/x-pack/libbeat/common/otelbeat/beatsuth_test.go +++ b/x-pack/otel/extension/beatsauthextension/beatsauth_test.go @@ -4,7 +4,7 @@ //go:build !requirefips -package otelbeat +package beatsauthextension_test import ( "bytes" @@ -42,9 +42,9 @@ import ( "gopkg.in/yaml.v2" - "github.com/elastic/beats/v7/libbeat/otelbeat/beatconverter" - "github.com/elastic/beats/v7/libbeat/otelbeat/oteltest" + "github.com/elastic/beats/v7/x-pack/otel/beatconverter" "github.com/elastic/beats/v7/x-pack/otel/extension/beatsauthextension" + "github.com/elastic/beats/v7/x-pack/otel/oteltest" "github.com/elastic/elastic-agent-libs/testing/proxytest" "github.com/elastic/elastic-agent-libs/transport/tlscommontest" mockes "github.com/elastic/mock-es/pkg/api" diff --git a/libbeat/otelbeat/otelctx/otelctx.go b/x-pack/otel/otelctx/otelctx.go similarity index 76% rename from libbeat/otelbeat/otelctx/otelctx.go rename to x-pack/otel/otelctx/otelctx.go index 4df2e7c0de5a..2cce61e7be63 100644 --- a/libbeat/otelbeat/otelctx/otelctx.go +++ b/x-pack/otel/otelctx/otelctx.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. package otelctx diff --git a/libbeat/otelbeat/otelctx/otelctx_test.go b/x-pack/otel/otelctx/otelctx_test.go similarity index 88% rename from libbeat/otelbeat/otelctx/otelctx_test.go rename to x-pack/otel/otelctx/otelctx_test.go index c1cce7dd5a30..ef02354fc0de 100644 --- a/libbeat/otelbeat/otelctx/otelctx_test.go +++ b/x-pack/otel/otelctx/otelctx_test.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. package otelctx diff --git a/x-pack/libbeat/common/otelbeat/otelmanager/manager.go b/x-pack/otel/otelmanager/manager.go similarity index 100% rename from x-pack/libbeat/common/otelbeat/otelmanager/manager.go rename to x-pack/otel/otelmanager/manager.go diff --git a/libbeat/otelbeat/otelmap/otelmap.go b/x-pack/otel/otelmap/otelmap.go similarity index 83% rename from libbeat/otelbeat/otelmap/otelmap.go rename to x-pack/otel/otelmap/otelmap.go index 45e2e913f4e5..75659c98339e 100644 --- a/libbeat/otelbeat/otelmap/otelmap.go +++ b/x-pack/otel/otelmap/otelmap.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. // Package otelmap provides utilities for converting between beats and otel map types. package otelmap diff --git a/libbeat/otelbeat/otelmap/otelmap_test.go b/x-pack/otel/otelmap/otelmap_test.go similarity index 91% rename from libbeat/otelbeat/otelmap/otelmap_test.go rename to x-pack/otel/otelmap/otelmap_test.go index b7cd618edfa3..3c2a05bef2a7 100644 --- a/libbeat/otelbeat/otelmap/otelmap_test.go +++ b/x-pack/otel/otelmap/otelmap_test.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. package otelmap diff --git a/libbeat/otelbeat/oteltest/helper.go b/x-pack/otel/oteltest/helper.go similarity index 52% rename from libbeat/otelbeat/oteltest/helper.go rename to x-pack/otel/oteltest/helper.go index 0f5522676098..9f48afa4dec3 100644 --- a/libbeat/otelbeat/oteltest/helper.go +++ b/x-pack/otel/oteltest/helper.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. package oteltest diff --git a/libbeat/otelbeat/oteltest/oteltest.go b/x-pack/otel/oteltest/oteltest.go similarity index 91% rename from libbeat/otelbeat/oteltest/oteltest.go rename to x-pack/otel/oteltest/oteltest.go index 417783cbfdb4..6acd8524d2c6 100644 --- a/libbeat/otelbeat/oteltest/oteltest.go +++ b/x-pack/otel/oteltest/oteltest.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. // Package oteltest provides test utilities for OpenTelemetry and Beats components. package oteltest diff --git a/libbeat/otelbeat/oteltest/tls_helper.go b/x-pack/otel/oteltest/tls_helper.go similarity index 70% rename from libbeat/otelbeat/oteltest/tls_helper.go rename to x-pack/otel/oteltest/tls_helper.go index 68887da6021a..0b0f52784149 100644 --- a/libbeat/otelbeat/oteltest/tls_helper.go +++ b/x-pack/otel/oteltest/tls_helper.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. package oteltest diff --git a/x-pack/libbeat/common/otelbeat/oteltestcol/collector.go b/x-pack/otel/oteltestcol/collector.go similarity index 100% rename from x-pack/libbeat/common/otelbeat/oteltestcol/collector.go rename to x-pack/otel/oteltestcol/collector.go diff --git a/x-pack/libbeat/common/otelbeat/oteltestcol/collector_test.go b/x-pack/otel/oteltestcol/collector_test.go similarity index 100% rename from x-pack/libbeat/common/otelbeat/oteltestcol/collector_test.go rename to x-pack/otel/oteltestcol/collector_test.go diff --git a/libbeat/otelbeat/oteltranslate/outputs/elasticsearch/config_otel.go b/x-pack/otel/oteltranslate/outputs/elasticsearch/config_otel.go similarity index 90% rename from libbeat/otelbeat/oteltranslate/outputs/elasticsearch/config_otel.go rename to x-pack/otel/oteltranslate/outputs/elasticsearch/config_otel.go index ecd158036244..3cbe093d4c4e 100644 --- a/libbeat/otelbeat/oteltranslate/outputs/elasticsearch/config_otel.go +++ b/x-pack/otel/oteltranslate/outputs/elasticsearch/config_otel.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. // The translation logic here has been moved to elastic-agent. Any development here is effectively never used on beatreceivers // should only be used for manual testing diff --git a/libbeat/otelbeat/oteltranslate/outputs/elasticsearch/config_otel_test.go b/x-pack/otel/oteltranslate/outputs/elasticsearch/config_otel_test.go similarity index 91% rename from libbeat/otelbeat/oteltranslate/outputs/elasticsearch/config_otel_test.go rename to x-pack/otel/oteltranslate/outputs/elasticsearch/config_otel_test.go index 95e889abb2d6..5650a8ffa6e0 100644 --- a/libbeat/otelbeat/oteltranslate/outputs/elasticsearch/config_otel_test.go +++ b/x-pack/otel/oteltranslate/outputs/elasticsearch/config_otel_test.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. package elasticsearchtranslate diff --git a/libbeat/otelbeat/oteltranslate/outputs/logstash/config_otel.go b/x-pack/otel/oteltranslate/outputs/logstash/config_otel.go similarity index 52% rename from libbeat/otelbeat/oteltranslate/outputs/logstash/config_otel.go rename to x-pack/otel/oteltranslate/outputs/logstash/config_otel.go index e1ee5ae596c9..4da9f5ebafc8 100644 --- a/libbeat/otelbeat/oteltranslate/outputs/logstash/config_otel.go +++ b/x-pack/otel/oteltranslate/outputs/logstash/config_otel.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. package logstash diff --git a/libbeat/otelbeat/oteltranslate/testdata/certs/client.crt b/x-pack/otel/oteltranslate/testdata/certs/client.crt similarity index 100% rename from libbeat/otelbeat/oteltranslate/testdata/certs/client.crt rename to x-pack/otel/oteltranslate/testdata/certs/client.crt diff --git a/libbeat/otelbeat/oteltranslate/testdata/certs/client.key b/x-pack/otel/oteltranslate/testdata/certs/client.key similarity index 100% rename from libbeat/otelbeat/oteltranslate/testdata/certs/client.key rename to x-pack/otel/oteltranslate/testdata/certs/client.key diff --git a/libbeat/otelbeat/oteltranslate/testdata/certs/rootCA.crt b/x-pack/otel/oteltranslate/testdata/certs/rootCA.crt similarity index 100% rename from libbeat/otelbeat/oteltranslate/testdata/certs/rootCA.crt rename to x-pack/otel/oteltranslate/testdata/certs/rootCA.crt diff --git a/libbeat/otelbeat/oteltranslate/tls_otel.go b/x-pack/otel/oteltranslate/tls_otel.go similarity index 86% rename from libbeat/otelbeat/oteltranslate/tls_otel.go rename to x-pack/otel/oteltranslate/tls_otel.go index c35c758e2147..db555de8910c 100644 --- a/libbeat/otelbeat/oteltranslate/tls_otel.go +++ b/x-pack/otel/oteltranslate/tls_otel.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. package oteltranslate diff --git a/libbeat/otelbeat/oteltranslate/tls_otel_fips_test.go b/x-pack/otel/oteltranslate/tls_otel_fips_test.go similarity index 70% rename from libbeat/otelbeat/oteltranslate/tls_otel_fips_test.go rename to x-pack/otel/oteltranslate/tls_otel_fips_test.go index 7b3edd952471..9c7704868e18 100644 --- a/libbeat/otelbeat/oteltranslate/tls_otel_fips_test.go +++ b/x-pack/otel/oteltranslate/tls_otel_fips_test.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. //go:build requirefips diff --git a/libbeat/otelbeat/oteltranslate/tls_otel_nofips_test.go b/x-pack/otel/oteltranslate/tls_otel_nofips_test.go similarity index 90% rename from libbeat/otelbeat/oteltranslate/tls_otel_nofips_test.go rename to x-pack/otel/oteltranslate/tls_otel_nofips_test.go index a07f4a906c54..074133572222 100644 --- a/libbeat/otelbeat/oteltranslate/tls_otel_nofips_test.go +++ b/x-pack/otel/oteltranslate/tls_otel_nofips_test.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. //go:build !requirefips diff --git a/libbeat/otelbeat/oteltranslate/tls_otel_test.go b/x-pack/otel/oteltranslate/tls_otel_test.go similarity index 71% rename from libbeat/otelbeat/oteltranslate/tls_otel_test.go rename to x-pack/otel/oteltranslate/tls_otel_test.go index 2f4ff2f4ceb5..c29114e3e641 100644 --- a/libbeat/otelbeat/oteltranslate/tls_otel_test.go +++ b/x-pack/otel/oteltranslate/tls_otel_test.go @@ -1,19 +1,6 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. package oteltranslate diff --git a/x-pack/libbeat/common/otelbeat/status/reporter.go b/x-pack/otel/status/reporter.go similarity index 100% rename from x-pack/libbeat/common/otelbeat/status/reporter.go rename to x-pack/otel/status/reporter.go diff --git a/x-pack/libbeat/common/otelbeat/status/reporter_test.go b/x-pack/otel/status/reporter_test.go similarity index 96% rename from x-pack/libbeat/common/otelbeat/status/reporter_test.go rename to x-pack/otel/status/reporter_test.go index bd339180ac24..e12b83acb39c 100644 --- a/x-pack/libbeat/common/otelbeat/status/reporter_test.go +++ b/x-pack/otel/status/reporter_test.go @@ -11,7 +11,7 @@ import ( "go.opentelemetry.io/collector/component/componentstatus" "github.com/elastic/beats/v7/libbeat/management/status" - "github.com/elastic/beats/v7/libbeat/otelbeat/oteltest" + "github.com/elastic/beats/v7/x-pack/otel/oteltest" ) func TestGroupStatus(t *testing.T) { diff --git a/x-pack/libbeat/common/otelbeat/status/runner.go b/x-pack/otel/status/runner.go similarity index 100% rename from x-pack/libbeat/common/otelbeat/status/runner.go rename to x-pack/otel/status/runner.go