Skip to content

Commit

Permalink
build: bump apm-data for vtpool improvements (#11703)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kruskall authored Sep 27, 2023
1 parent c220ed4 commit 4233ee1
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].20230908092227-4426f61e0c5c/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected].20230927073442-5e901c06ffc4/LICENSE:

Apache License
Version 2.0, January 2004
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
9 changes: 4 additions & 5 deletions internal/beater/otlp/clientmetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/beater/processors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/model/modelprocessor/libraryframe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down
2 changes: 1 addition & 1 deletion internal/r8/deobfuscator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/sourcemap/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (p BatchProcessor) processStacktraceFrame(
}

if frame.Original == nil {
frame.Original = &modelpb.Original{}
frame.Original = modelpb.OriginalFromVTPool()
}

// Store original source information.
Expand Down

0 comments on commit 4233ee1

Please sign in to comment.