Skip to content

Commit 6beff06

Browse files
committed
Add CPU ID label to custom context tags
1 parent aa7d15f commit 6beff06

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

reporter/datadog_reporter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ func createTags(userTags Tags, runtimeTag, version string, splitByServiceEnabled
503503
tags := append(Tags{}, userTags...)
504504

505505
customContextTagKey := "ddprof.custom_ctx"
506+
tags = append(tags, MakeTag(customContextTagKey, pprof.CPUIDLabel))
506507
if !splitByServiceEnabled {
507508
tags = append(tags,
508509
MakeTag(customContextTagKey, "container_id"),

reporter/pprof/profile_builder.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ import (
1818
samples "github.com/DataDog/dd-otel-host-profiler/reporter/samples"
1919
)
2020

21+
const (
22+
CPUIDLabel = "cpu.logical_number"
23+
)
24+
2125
type Config struct {
2226
Start time.Time
2327
End time.Time
@@ -256,7 +260,7 @@ func addTraceLabels(labels map[string][]string, i samples.TraceAndMetaKey, proce
256260
labels["process name"] = append(labels["process name"], processName)
257261
}
258262

259-
labels["cpu.logical_number"] = append(labels["cpu.logical_number"], strconv.Itoa(int(i.CPU)))
263+
labels[CPUIDLabel] = append(labels[CPUIDLabel], strconv.Itoa(int(i.CPU)))
260264

261265
containerMetadata := processMeta.ContainerMetadata
262266
if containerMetadata.PodName != "" {

0 commit comments

Comments
 (0)