Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exporter for different NUMA nodes #611

Merged
merged 1 commit into from
Oct 16, 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
17 changes: 11 additions & 6 deletions cli/dpservice-exporter/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,17 @@ func queryTelemetry(conn net.Conn, log *logrus.Logger, command string, response
}

func Update(conn net.Conn, hostname string, log *logrus.Logger) {
var dpserviceHeapInfo DpServiceHeapInfo
queryTelemetry(conn, log, "/eal/heap_info,0", &dpserviceHeapInfo)
for key, value := range dpserviceHeapInfo.Value {
// Only export metrics of type float64 (/eal/heap_info contains also some string values)
if v, ok := value.(float64); ok {
HeapInfo.With(prometheus.Labels{"node_name": hostname, "info": key}).Set(v)
var ealHeapList EalHeapList
queryTelemetry(conn, log, "/eal/heap_list", &ealHeapList)

for _, id := range ealHeapList.Value {
var ealHeapInfo EalHeapInfo
queryTelemetry(conn, log, fmt.Sprintf("/eal/heap_info,%d", id), &ealHeapInfo)
for key, value := range ealHeapInfo.Value {
// Only export metrics of type float64 (/eal/heap_info contains also some string values)
if v, ok := value.(float64); ok {
HeapInfo.With(prometheus.Labels{"node_name": hostname, "info": key}).Set(v)
}
}
}

Expand Down
6 changes: 5 additions & 1 deletion cli/dpservice-exporter/metrics/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ type DpServiceGraphCallCount struct {
GraphCallCnt GraphCallCount `json:"/dp_service/graph/call_count"`
}

type DpServiceHeapInfo struct {
type EalHeapList struct {
Value []int `json:"/eal/heap_list"`
}

type EalHeapInfo struct {
Value map[string]any `json:"/eal/heap_info"`
}

Expand Down
Loading