Skip to content
Closed
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
5 changes: 3 additions & 2 deletions reporter/internal/pdata/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ var dummyFileID = libpf.NewFileID(0, 0)
// Generate generates a pdata request out of internal profiles data, to be
// exported.
func (p *Pdata) Generate(tree samples.TraceEventsTree,
agentName, agentVersion string) (pprofile.Profiles, error) {
agentName, agentVersion string,
) (pprofile.Profiles, error) {
profiles := pprofile.NewProfiles()
dic := profiles.ProfilesDictionary()

Expand Down Expand Up @@ -280,7 +281,7 @@ func (p *Pdata) setProfile(
log.Debugf("Reporting OTLP profile with %d samples", profile.Sample().Len())

profile.SetDuration(pcommon.Timestamp(endTS - startTS))
profile.SetStartTime(pcommon.Timestamp(startTS))
profile.SetTime(pcommon.Timestamp(startTS))

return nil
}
2 changes: 1 addition & 1 deletion reporter/internal/pdata/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func TestProfileDuration(t *testing.T) {

profile := res.ResourceProfiles().At(0).ScopeProfiles().At(0).Profiles().At(0)
require.Equal(t, pcommon.Timestamp(7), profile.Duration())
require.Equal(t, pcommon.Timestamp(1), profile.StartTime())
require.Equal(t, pcommon.Timestamp(1), profile.Time())
})
}
}