Skip to content

Commit

Permalink
Export profiles as native family
Browse files Browse the repository at this point in the history
  • Loading branch information
nsavoire committed Jun 12, 2024
1 parent 714a34c commit 72f5802
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions reporter/datadog_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func (r *DatadogReporter) reportProfile(ctx context.Context) error {
}

tags := strings.Split(config.ValidatedTags(), ";")
tags = append(tags, "runtime:go")
tags = append(tags, "runtime:native")
foundService := false
// check if service tag is set, if not set it to otel-profiling-agent
for _, tag := range tags {
Expand Down Expand Up @@ -386,12 +386,12 @@ func (r *DatadogReporter) getPprofProfile() (profile *pprofile.Profile,

numSamples := len(samplesCpy)
profile = &pprofile.Profile{
SampleType: []*pprofile.ValueType{{Type: "samples", Unit: "count"},
{Type: "cpu", Unit: "nanoseconds"}},
SampleType: []*pprofile.ValueType{{Type: "cpu-samples", Unit: "count"},
{Type: "cpu-time", Unit: "nanoseconds"}},
Sample: make([]*pprofile.Sample, 0, numSamples),
PeriodType: &pprofile.ValueType{Type: "cpu", Unit: "nanoseconds"},
PeriodType: &pprofile.ValueType{Type: "cpu-time", Unit: "nanoseconds"},
Period: int64(r.samplingPeriod),
DefaultSampleType: "cpu",
DefaultSampleType: "cpu-time",
}

fileIDtoMapping := make(map[libpf.FileID]*pprofile.Mapping)
Expand Down
4 changes: 2 additions & 2 deletions reporter/datadog_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ func buildMultipartForm(profiles []profileData, startTime, endTime time.Time,
mw := multipart.NewWriter(&buf)

event := &uploadEvent{
Version: "4",
Family: "go",
Version: "0.0.1-dd",
Family: "native",
Start: startTime.Format(time.RFC3339Nano),
End: endTime.Format(time.RFC3339Nano),
Tags: strings.Join(tags, ","),
Expand Down

0 comments on commit 72f5802

Please sign in to comment.