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

Support exporting configured_hz from info server #944

Merged
merged 4 commits into from
Sep 19, 2024
Merged
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
12 changes: 12 additions & 0 deletions exporter/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,18 @@ func (e *Exporter) handleMetricsServer(ch chan<- prometheus.Metric, fieldKey str
e.registerConstMetricGauge(ch, "start_time_seconds", float64(time.Now().Unix())-uptime)
}
}

if fieldKey == "configured_hz" {
if hz, err := strconv.ParseInt(fieldValue, 10, 64); err == nil {
e.registerConstMetricGauge(ch, "configured_hz", float64(hz))
}
}

if fieldKey == "hz" {
if hz, err := strconv.ParseInt(fieldValue, 10, 64); err == nil {
e.registerConstMetricGauge(ch, "hz", float64(hz))
}
}
}

func parseMetricsCommandStats(fieldKey string, fieldValue string) (cmd string, calls float64, rejectedCalls float64, failedCalls float64, usecTotal float64, extendedStats bool, errorOut error) {
Expand Down
Loading