Skip to content

Commit

Permalink
[PROF-9960] Use mapping filename instead of comm for function filename (
Browse files Browse the repository at this point in the history
#21)

* Rename comm label into 'thread_name' and add it to custom context

* Use mapping filename instead of comm for function filename
  • Loading branch information
nsavoire authored and Gandem committed Jun 26, 2024
1 parent 4476326 commit f313755
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reporter/datadog_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (r *DatadogReporter) reportProfile(ctx context.Context) error {

tags := strings.Split(config.ValidatedTags(), ";")

customAttributes := []string{"container_id", "container_name"}
customAttributes := []string{"container_id", "container_name", "thread_name"}
for _, attr := range customAttributes {
tags = append(tags, "ddprof.custom_ctx:"+attr)
}
Expand Down Expand Up @@ -414,7 +414,7 @@ func (r *DatadogReporter) getPprofProfile() (profile *pprofile.Profile,
loc.Mapping = tmpMapping
}
line := pprofile.Line{Function: createPprofFunctionEntry(funcMap, profile, "",
traceInfo.comm)}
loc.Mapping.File)}
loc.Line = append(loc.Line, line)
case libpf.KernelFrame:
// Reconstruct frameID
Expand Down Expand Up @@ -543,7 +543,7 @@ func createPprofFunctionEntry(funcMap map[funcInfo]*pprofile.Function,

func addTraceLabels(labels map[string][]string, i traceFramesCounts) {
if i.comm != "" {
labels["comm"] = append(labels["comm"], i.comm)
labels["thread_name"] = append(labels["thread_name"], i.comm)
}

if i.podName != "" {
Expand Down

0 comments on commit f313755

Please sign in to comment.