diff --git a/NOTICE.txt b/NOTICE.txt index 23714152db4..f93f8c931a9 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -10907,6 +10907,37 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +Dependency : github.com/devigned/tab +Version: v0.1.2-0.20190607222403-0c15cf42f9a2 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/devigned/tab@v0.1.2-0.20190607222403-0c15cf42f9a2/LICENSE: + +MIT License + +Copyright (c) 2019 David Justice + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + -------------------------------------------------------------------------------- Dependency : github.com/dgraph-io/badger/v3 Version: v3.2103.1 @@ -37209,37 +37240,6 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -Dependency : github.com/devigned/tab -Version: v0.1.2-0.20190607222403-0c15cf42f9a2 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/devigned/tab@v0.1.2-0.20190607222403-0c15cf42f9a2/LICENSE: - -MIT License - -Copyright (c) 2019 David Justice - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -------------------------------------------------------------------------------- Dependency : github.com/elastic/ristretto Version: v0.1.1-0.20220602190459-83b0895ca5b3 diff --git a/go.mod b/go.mod index 49a19fc29fd..35f7e52949a 100644 --- a/go.mod +++ b/go.mod @@ -53,7 +53,7 @@ require ( github.com/coreos/go-systemd/v22 v22.5.0 github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f github.com/denisenkom/go-mssqldb v0.12.3 - github.com/devigned/tab v0.1.2-0.20190607222403-0c15cf42f9a2 // indirect + github.com/devigned/tab v0.1.2-0.20190607222403-0c15cf42f9a2 github.com/dgraph-io/badger/v3 v3.2103.1 github.com/digitalocean/go-libvirt v0.0.0-20240709142323-d8406205c752 github.com/docker/docker v26.1.5+incompatible diff --git a/x-pack/filebeat/include/list.go b/x-pack/filebeat/include/list.go index 5e2cc02a4c9..fcca6f27de8 100644 --- a/x-pack/filebeat/include/list.go +++ b/x-pack/filebeat/include/list.go @@ -15,6 +15,7 @@ import ( // Import packages that perform 'func init()'. _ "github.com/elastic/beats/v7/x-pack/filebeat/input/awscloudwatch" _ "github.com/elastic/beats/v7/x-pack/filebeat/input/awss3" + _ "github.com/elastic/beats/v7/x-pack/filebeat/input/azureeventhub" _ "github.com/elastic/beats/v7/x-pack/filebeat/input/cometd" _ "github.com/elastic/beats/v7/x-pack/filebeat/input/etw" _ "github.com/elastic/beats/v7/x-pack/filebeat/input/gcppubsub" diff --git a/x-pack/filebeat/input/azureeventhub/tracer.go b/x-pack/filebeat/input/azureeventhub/tracer.go new file mode 100644 index 00000000000..f998a548e37 --- /dev/null +++ b/x-pack/filebeat/input/azureeventhub/tracer.go @@ -0,0 +1,117 @@ +// 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 !aix + +package azureeventhub + +import ( + "context" + + "github.com/devigned/tab" + + "github.com/elastic/elastic-agent-libs/logp" +) + +func init() { + tab.Register(new(logsOnlyTracer)) +} + +// logsOnlyTracer manages the creation of the required +// Spanners and Loggers with the goal of deferring logging +// to the `logp` package. +// +// According to the `github.com/devigned/tab package`, +// to implement a Tracer, you must provide the following +// three components: +// +// - Tracer +// - Spanner +// - Logger +// +// Since we are currently only interested in logging, we will +// implement a Tracer that only logs. +type logsOnlyTracer struct{} + +// ---------------------------------------------------------------------------- +// Tracer +// ---------------------------------------------------------------------------- + +// StartSpan returns the input context and a no-op Spanner +func (nt *logsOnlyTracer) StartSpan(ctx context.Context, operationName string, opts ...interface{}) (context.Context, tab.Spanner) { + return ctx, new(logsOnlySpanner) +} + +// StartSpanWithRemoteParent returns the input context and a no-op Spanner +func (nt *logsOnlyTracer) StartSpanWithRemoteParent(ctx context.Context, operationName string, carrier tab.Carrier, opts ...interface{}) (context.Context, tab.Spanner) { + return ctx, new(logsOnlySpanner) +} + +// FromContext returns a no-op Spanner without regard to the input context +func (nt *logsOnlyTracer) FromContext(ctx context.Context) tab.Spanner { + return new(logsOnlySpanner) +} + +// NewContext returns the parent context +func (nt *logsOnlyTracer) NewContext(parent context.Context, span tab.Spanner) context.Context { + return parent +} + +// ---------------------------------------------------------------------------- +// Spanner +// ---------------------------------------------------------------------------- + +// logsOnlySpanner is a Spanner implementation that focuses +// on logging only. +type logsOnlySpanner struct{} + +// AddAttributes is a no-op +func (ns *logsOnlySpanner) AddAttributes(attributes ...tab.Attribute) {} + +// End is a no-op +func (ns *logsOnlySpanner) End() {} + +// Logger returns a Logger implementation +func (ns *logsOnlySpanner) Logger() tab.Logger { + return &logpLogger{logp.L()} +} + +// Inject is no-op +func (ns *logsOnlySpanner) Inject(carrier tab.Carrier) error { + return nil +} + +// InternalSpan returns nil +func (ns *logsOnlySpanner) InternalSpan() interface{} { + return nil +} + +// ---------------------------------------------------------------------------- +// Logger +// ---------------------------------------------------------------------------- + +// logpLogger defers logging to the logp package +type logpLogger struct { + logger *logp.Logger +} + +// Info logs a message at info level +func (sl logpLogger) Info(msg string, attributes ...tab.Attribute) { + sl.logger.Info(msg) +} + +// Error logs a message at error level +func (sl logpLogger) Error(err error, attributes ...tab.Attribute) { + sl.logger.Error(err) +} + +// Fatal logs a message at Fatal level +func (sl logpLogger) Fatal(msg string, attributes ...tab.Attribute) { + sl.logger.Fatal(msg) +} + +// Debug logs a message at Debug level +func (sl logpLogger) Debug(msg string, attributes ...tab.Attribute) { + sl.logger.Debug(msg) +}