From 2b425ebe944f061dc1ec2187a39a70c4c7dddecf Mon Sep 17 00:00:00 2001 From: Nicolas Savoire Date: Wed, 12 Jun 2024 11:30:00 +0200 Subject: [PATCH] [PROF-9929] Export profiles as native family (#13) --- reporter/datadog_reporter.go | 10 +++++----- reporter/datadog_upload.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reporter/datadog_reporter.go b/reporter/datadog_reporter.go index 68ab505..daf8fda 100644 --- a/reporter/datadog_reporter.go +++ b/reporter/datadog_reporter.go @@ -295,7 +295,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 { @@ -337,12 +337,12 @@ func (r *DatadogReporter) getPprofProfile() (profile *pprofile.Profile, funcMap := make(map[funcInfo]*pprofile.Function) 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) diff --git a/reporter/datadog_upload.go b/reporter/datadog_upload.go index 8c6187b..1781bba 100644 --- a/reporter/datadog_upload.go +++ b/reporter/datadog_upload.go @@ -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, ","),