feat_: add CentralizedMetricsInfo function

Issue #15446
This commit is contained in:
Michal Iskierko 2024-07-11 09:39:19 +02:00 committed by Andrea Maria Piana
parent 67364dadc8
commit 5059c19aae
1 changed files with 12 additions and 0 deletions

View File

@ -1426,6 +1426,18 @@ func ToggleCentralizedMetrics(requestJSON string) string {
return "" return ""
} }
func CentralizedMetricsInfo() string {
metricsInfo, err := statusBackend.CentralizedMetricsInfo()
if err != nil {
return makeJSONResponse(err)
}
data, err := json.Marshal(metricsInfo)
if err != nil {
return makeJSONResponse(err)
}
return string(data)
}
func AddCentralizedMetric(requestJSON string) string { func AddCentralizedMetric(requestJSON string) string {
var request requests.AddCentralizedMetric var request requests.AddCentralizedMetric
err := json.Unmarshal([]byte(requestJSON), &request) err := json.Unmarshal([]byte(requestJSON), &request)