浏览代码

profiling: set `SampleType` name

Anton Petruhin 2 年之前
父节点
当前提交
44f6e37e99
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      profiling/profiling.go

+ 2 - 2
profiling/profiling.go

@@ -54,7 +54,6 @@ func Init(hostId, hostName string) chan<- containers.ProcessInfo {
 	constLabels = labels.Labels{
 		{Name: "host.name", Value: hostName},
 		{Name: "host.id", Value: hostId},
-		{Name: "profile.source", Value: "ebpf"},
 	}
 
 	reg := prometheus.NewRegistry()
@@ -167,6 +166,7 @@ func upload(b *pprof.ProfileBuilder) error {
 	}
 	u.RawQuery = q.Encode()
 
+	b.Profile.SampleType[0].Type = "ebpf:cpu:nanoseconds"
 	b.Profile.DurationNanos = CollectInterval.Nanoseconds()
 	body := bytes.NewBuffer(nil)
 	_, err := b.Write(body)
@@ -174,7 +174,7 @@ func upload(b *pprof.ProfileBuilder) error {
 		return err
 	}
 
-	req, err := http.NewRequest("POST", u.String(), body)
+	req, err := http.NewRequest(http.MethodPost, u.String(), body)
 	if err != nil {
 		return err
 	}