Skip to content
This repository has been archived by the owner on Jan 21, 2025. It is now read-only.

[PROF-9929] Export profiles as native family #13

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to change the actual runtime at one point if we want to make special rules to avoid having a service view.
Though I am fine with this 👍

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
Loading