Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions libbeat/otelbeat/beatconverter/logging.go

This file was deleted.

2 changes: 1 addition & 1 deletion x-pack/filebeat/fbreceiver/receiver_leak_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/fbreceiver/receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions x-pack/filebeat/input/gcppubsub/otel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions x-pack/filebeat/tests/integration/otel_lsexporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions x-pack/filebeat/tests/integration/otel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion x-pack/libbeat/cmd/instance/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion x-pack/libbeat/cmd/instance/beat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions x-pack/libbeat/cmd/instance/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions x-pack/libbeat/outputs/otelconsumer/otelconsumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion x-pack/libbeat/outputs/otelconsumer/otelconsumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion x-pack/metricbeat/mbreceiver/receiver_leak_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/metricbeat/mbreceiver/receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion x-pack/metricbeat/tests/integration/otel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate from this PR I think we can get rid of beatconverter and oteltranslate in this repository, created #47904 to track that.

// 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

Expand All @@ -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"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
25 changes: 25 additions & 0 deletions x-pack/otel/beatconverter/logging.go
Original file line number Diff line number Diff line change
@@ -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)
}
}
2 changes: 1 addition & 1 deletion x-pack/otel/exporter/logstashexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion x-pack/otel/exporter/logstashexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/otel/exporter/logstashexporter/internal/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

//go:build !requirefips

package otelbeat
package beatsauthextension_test

import (
"bytes"
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Loading