Skip to content
Open
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
7 changes: 7 additions & 0 deletions internal/pkg/collector/gpu_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ func toMetric(
attrs["err_msg"] = unknownErr
}
}
if val.FieldType == dcgm.DCGM_FT_STRING {
attrs[counter.FieldName] = v // converse string value in prometheus to label , prometheus can't accept string type in value
v = "1" //set value to number, 1 don't mean anything
}

m := Metric{
Counter: counter,
Expand Down Expand Up @@ -366,6 +370,9 @@ func toString(value dcgm.FieldValue_v1) string {
default:
return v
}
case dcgm.DCGM_FT_BINARY:
// I don't know how to convert this variable, I try to value.String() but result is empty
return value.String()
}

return FailedToConvert
Expand Down