From 3a30e202ab47c3b7e05aeae1d6a01227e89d46a7 Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Tue, 12 Nov 2024 08:45:15 +0100 Subject: [PATCH 1/3] reporter: replace deprecated attribute With https://github.com/open-telemetry/semantic-conventions/pull/1520 process.executable.build_id.profiling got renamed to process.executable.build_id.htlhash. Signed-off-by: Florian Lehner --- reporter/otlp_reporter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reporter/otlp_reporter.go b/reporter/otlp_reporter.go index 1cf6201c..31981e9e 100644 --- a/reporter/otlp_reporter.go +++ b/reporter/otlp_reporter.go @@ -606,7 +606,7 @@ func (r *OTLPReporter) getProfile() (profile *profiles.Profile, startTS, endTS u // semantic convention for build_id, replace these hard coded // strings. {key: "process.executable.build_id.gnu", value: execInfo.gnuBuildID}, - {key: "process.executable.build_id.profiling", + {key: "process.executable.build_id.htlhash", value: traceInfo.files[i].StringNoQuotes()}, }, attributeMap) From 79fbd8d5907195ee64fe6505bef47c1b30f2bd0e Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Tue, 12 Nov 2024 08:51:01 +0100 Subject: [PATCH 2/3] reporter: drop deprecated Mapping.BuildIdKind Signed-off-by: Florian Lehner --- reporter/otlp_reporter.go | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/reporter/otlp_reporter.go b/reporter/otlp_reporter.go index 31981e9e..0a5163b6 100644 --- a/reporter/otlp_reporter.go +++ b/reporter/otlp_reporter.go @@ -660,8 +660,8 @@ func (r *OTLPReporter) getProfile() (profile *profiles.Profile, startTS, endTS u loc.Line = append(loc.Line, line) // To be compliant with the protocol, generate a dummy mapping entry. - loc.MappingIndex = getDummyMappingIndex(fileIDtoMapping, stringMap, - profile, traceInfo.files[i]) + loc.MappingIndex = getDummyMappingIndex(fileIDtoMapping, + stringMap, attributeMap, profile, traceInfo.files[i]) } profile.Location = append(profile.Location, loc) } @@ -785,24 +785,23 @@ func addProfileAttributes[T string | int64](profile *profiles.Profile, // getDummyMappingIndex inserts or looks up an entry for interpreted FileIDs. func getDummyMappingIndex(fileIDtoMapping map[libpf.FileID]uint64, - stringMap map[string]uint32, profile *profiles.Profile, - fileID libpf.FileID) uint64 { - var locationMappingIndex uint64 + stringMap map[string]uint32, attributeMap map[string]uint64, + profile *profiles.Profile, fileID libpf.FileID) uint64 { if tmpMappingIndex, exists := fileIDtoMapping[fileID]; exists { - locationMappingIndex = tmpMappingIndex - } else { - idx := uint64(len(fileIDtoMapping)) - fileIDtoMapping[fileID] = idx - locationMappingIndex = idx - - profile.Mapping = append(profile.Mapping, &profiles.Mapping{ - Filename: int64(getStringMapIndex(stringMap, "")), - BuildId: int64(getStringMapIndex(stringMap, - fileID.StringNoQuotes())), - BuildIdKind: *profiles.BuildIdKind_BUILD_ID_BINARY_HASH.Enum(), - }) + return tmpMappingIndex } - return locationMappingIndex + idx := uint64(len(fileIDtoMapping)) + fileIDtoMapping[fileID] = idx + + mappingAttributes := addProfileAttributes(profile, []attrKeyValue[string]{ + {key: "process.executable.build_id.htlhash", + value: fileID.StringNoQuotes()}}, attributeMap) + + profile.Mapping = append(profile.Mapping, &profiles.Mapping{ + Filename: int64(getStringMapIndex(stringMap, "")), + Attributes: mappingAttributes, + }) + return idx } // waitGrpcEndpoint waits until the gRPC connection is established. From 1899daa891754e2f1a96fa35db549bc7f7a0a8ed Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Tue, 12 Nov 2024 08:53:12 +0100 Subject: [PATCH 3/3] README: provide devfiler v0.9.0 Signed-off-by: Florian Lehner --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5f3c1bd1..3922aa8a 100644 --- a/README.md +++ b/README.md @@ -91,9 +91,9 @@ devfiler spins up a local server that listens on `0.0.0.0:11000`. To run it, simply download and unpack the archive from the following URL: -https://upload.elastic.co/d/87e7697991940ec37f0c6e39ac38d213f65e8dc1ef9dbedff6aab9cba0adfaba +https://upload.elastic.co/d/f8aa0c386baa808a616ca29f86b34c726edb5af36f8840a4cf28468ad534a4b5 -Authentication token: `c74dfc4db2212015` +Authentication token: `2635c0750bf8ea69` The archive contains a build for each of the following platforms: