Skip to content

Commit

Permalink
chore: log vertex and pod name when raptor throws (#1772)
Browse files Browse the repository at this point in the history
Signed-off-by: Keran Yang <[email protected]>
  • Loading branch information
KeranYang authored Jun 26, 2024
1 parent efcd722 commit 3a0c7ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/daemon/server/service/rater/rater.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ func (r *Rater) getPodReadCounts(vertexName, podName string) *PodReadCount {
url := fmt.Sprintf("https://%s.%s.%s.svc:%v/metrics", podName, r.pipeline.Name+"-"+vertexName+"-headless", r.pipeline.Namespace, v1alpha1.VertexMetricsPort)
resp, err := r.httpClient.Get(url)
if err != nil {
r.log.Errorf("failed reading the metrics endpoint, %v", err.Error())
r.log.Errorf("[vertex name %s, pod name %s]: failed reading the metrics endpoint, %v", vertexName, podName, err.Error())
return nil
}
defer resp.Body.Close()

textParser := expfmt.TextParser{}
result, err := textParser.TextToMetricFamilies(resp.Body)
if err != nil {
r.log.Errorf("failed parsing to prometheus metric families, %v", err.Error())
r.log.Errorf("[vertex name %s, pod name %s]: failed parsing to prometheus metric families, %v", vertexName, podName, err.Error())
return nil
}

Expand All @@ -246,15 +246,15 @@ func (r *Rater) getPodReadCounts(vertexName, podName string) *PodReadCount {
}
}
if partitionName == "" {
r.log.Warnf("Partition name is not found for metric %s", readTotalMetricName)
r.log.Warnf("[vertex name %s, pod name %s]: Partition name is not found for metric %s", vertexName, podName, readTotalMetricName)
} else {
partitionReadCount[partitionName] = ele.Counter.GetValue()
}
}
podReadCount := &PodReadCount{podName, partitionReadCount}
return podReadCount
} else {
r.log.Errorf("failed getting the read total metric, the metric is not available.")
r.log.Errorf("[vertex name %s, pod name %s]: failed getting the read total metric, the metric is not available.", vertexName, podName)
return nil
}
}
Expand Down

0 comments on commit 3a0c7ae

Please sign in to comment.