From 4233ee1603c9d1806fc5c431627ce7ce14a49378 Mon Sep 17 00:00:00 2001 From: kruskall <99559985+kruskall@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:25:56 +0200 Subject: [PATCH] build: bump apm-data for vtpool improvements (#11703) * build: bump apm-data for vtpool improvements * test: remove empty transaction marks from test data files * feat: migrate to vtpool * build: bump apm-data * build: regenerate notice file * test: revert testdata file changes * refactor: reduce diff and keep changes to a minimum --- NOTICE.txt | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- internal/beater/otlp/clientmetadata.go | 9 ++++----- internal/beater/processors.go | 2 +- internal/model/modelprocessor/libraryframe.go | 2 +- internal/r8/deobfuscator.go | 2 +- internal/sourcemap/processor.go | 2 +- 8 files changed, 13 insertions(+), 14 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index 310e545ba38..6f11c3eb7c5 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -362,11 +362,11 @@ these terms. -------------------------------------------------------------------------------- Dependency : github.com/elastic/apm-data -Version: v0.1.1-0.20230908092227-4426f61e0c5c +Version: v0.1.1-0.20230927073442-5e901c06ffc4 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/apm-data@v0.1.1-0.20230908092227-4426f61e0c5c/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/apm-data@v0.1.1-0.20230927073442-5e901c06ffc4/LICENSE: Apache License Version 2.0, January 2004 diff --git a/go.mod b/go.mod index c7d2de523e9..9592d961339 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/dgraph-io/badger/v2 v2.2007.3-0.20201012072640-f5a7e0a1c83b github.com/dustin/go-humanize v1.0.1 github.com/elastic/apm-aggregation v0.0.0-20230815024520-e75a37d9ddd6 - github.com/elastic/apm-data v0.1.1-0.20230908092227-4426f61e0c5c + github.com/elastic/apm-data v0.1.1-0.20230927073442-5e901c06ffc4 github.com/elastic/beats/v7 v7.0.0-alpha2.0.20230925204457-f111cbc73ec4 github.com/elastic/elastic-agent-client/v7 v7.4.0 github.com/elastic/elastic-agent-libs v0.3.15-0.20230913212237-dbdaf18c898b diff --git a/go.sum b/go.sum index f5bfd9269df..eda17147cef 100644 --- a/go.sum +++ b/go.sum @@ -153,8 +153,8 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/elastic/apm-aggregation v0.0.0-20230815024520-e75a37d9ddd6 h1:Js+C3HEE0a5BDFmhEmJV/Uo4uzj/paHjd7yl6+KYguw= github.com/elastic/apm-aggregation v0.0.0-20230815024520-e75a37d9ddd6/go.mod h1:ba3gaJCuhxXN/O5AuiI56xxd6DukQdVOK0NfpzBntNo= -github.com/elastic/apm-data v0.1.1-0.20230908092227-4426f61e0c5c h1:THld+d7v6wEwM1v+gzI9j0kktOI/tZHRWJVIVUGHctc= -github.com/elastic/apm-data v0.1.1-0.20230908092227-4426f61e0c5c/go.mod h1:lMTMoCWNadiDJih/tLechuMTtumEeedtKJlBOYAv030= +github.com/elastic/apm-data v0.1.1-0.20230927073442-5e901c06ffc4 h1:oCZ3NvlJCbIbd+hpIozWR73A9v8FddfrM03lB1dYxa8= +github.com/elastic/apm-data v0.1.1-0.20230927073442-5e901c06ffc4/go.mod h1:lMTMoCWNadiDJih/tLechuMTtumEeedtKJlBOYAv030= github.com/elastic/beats/v7 v7.0.0-alpha2.0.20230925204457-f111cbc73ec4 h1:Rly2YRlcqkiU8JvZLBgmfjqUuC67N4pK+jECUmji8c4= github.com/elastic/beats/v7 v7.0.0-alpha2.0.20230925204457-f111cbc73ec4/go.mod h1:qgXAHO18gZmQhE8bQwmigeANroMnUq+98hgbCHh+hjk= github.com/elastic/elastic-agent-autodiscover v0.6.2 h1:7P3cbMBWXjbzA80rxitQjc+PiWyZ4I4F4LqrCYgYlNc= diff --git a/internal/beater/otlp/clientmetadata.go b/internal/beater/otlp/clientmetadata.go index 9dbddb1b6ba..fe5a72aa3c7 100644 --- a/internal/beater/otlp/clientmetadata.go +++ b/internal/beater/otlp/clientmetadata.go @@ -45,7 +45,7 @@ func SetClientMetadata(ctx context.Context, batch *modelpb.Batch) error { if event.GetSource().GetIp() == nil { if tcpAddr, ok := clientMetadata.SourceAddr.(*net.TCPAddr); ok { if event.Source == nil { - event.Source = &modelpb.Source{} + event.Source = modelpb.SourceFromVTPool() } sourceAddrPort := tcpAddr.AddrPort() event.Source.Ip = modelpb.Addr2IP(sourceAddrPort.Addr().Unmap()) @@ -54,14 +54,13 @@ func SetClientMetadata(ctx context.Context, batch *modelpb.Batch) error { } if event.GetClient().GetIp() == nil && clientMetadata.ClientIP.IsValid() { if event.Client == nil { - event.Client = &modelpb.Client{} + event.Client = modelpb.ClientFromVTPool() } event.Client.Ip = modelpb.Addr2IP(clientMetadata.ClientIP) } if clientMetadata.SourceNATIP.IsValid() { - event.Source.Nat = &modelpb.NAT{ - Ip: modelpb.Addr2IP(clientMetadata.SourceNATIP), - } + event.Source.Nat = modelpb.NATFromVTPool() + event.Source.Nat.Ip = modelpb.Addr2IP(clientMetadata.SourceNATIP) } } } diff --git a/internal/beater/processors.go b/internal/beater/processors.go index c81d9c6c4a8..02acc59b351 100644 --- a/internal/beater/processors.go +++ b/internal/beater/processors.go @@ -74,7 +74,7 @@ func newObserverBatchProcessor() modelpb.ProcessBatchFunc { return func(ctx context.Context, b *modelpb.Batch) error { for i := range *b { if (*b)[i].Observer == nil { - (*b)[i].Observer = &modelpb.Observer{} + (*b)[i].Observer = modelpb.ObserverFromVTPool() } observer := (*b)[i].Observer observer.Hostname = hostname diff --git a/internal/model/modelprocessor/libraryframe.go b/internal/model/modelprocessor/libraryframe.go index 9d33e8ff767..7e7a803053b 100644 --- a/internal/model/modelprocessor/libraryframe.go +++ b/internal/model/modelprocessor/libraryframe.go @@ -68,7 +68,7 @@ func (s SetLibraryFrame) processException(ctx context.Context, exception *modelp func (s SetLibraryFrame) processStacktraceFrames(ctx context.Context, frames ...*modelpb.StacktraceFrame) { for _, frame := range frames { if frame.Original == nil { - frame.Original = &modelpb.Original{} + frame.Original = modelpb.OriginalFromVTPool() } frame.Original.LibraryFrame = frame.LibraryFrame frame.LibraryFrame = frame.Filename != "" && s.Pattern.MatchString(frame.Filename) || diff --git a/internal/r8/deobfuscator.go b/internal/r8/deobfuscator.go index e56eeaf0f65..8249e6674c4 100644 --- a/internal/r8/deobfuscator.go +++ b/internal/r8/deobfuscator.go @@ -107,7 +107,7 @@ func resolveMappings(types map[string]StacktraceType, mapReader io.Reader) error for _, frames := range stacktraceType.methods { for _, frame := range frames { if frame.Original == nil { - frame.Original = &modelpb.Original{} + frame.Original = modelpb.OriginalFromVTPool() } // Multiple frames might point to the same class, so we need to deobfuscate the class name for them all. frame.Original.Classname = obfuscatedName diff --git a/internal/sourcemap/processor.go b/internal/sourcemap/processor.go index 99889e2741a..6b2174da390 100644 --- a/internal/sourcemap/processor.go +++ b/internal/sourcemap/processor.go @@ -135,7 +135,7 @@ func (p BatchProcessor) processStacktraceFrame( } if frame.Original == nil { - frame.Original = &modelpb.Original{} + frame.Original = modelpb.OriginalFromVTPool() } // Store original source information.