Skip to content

Commit

Permalink
Fix to replace dashes with underscore in the metric names (#1103)
Browse files Browse the repository at this point in the history
* Fix to replace dashes with underscore in the metric names

Signed-off-by: aagarwalla-fx <[email protected]>

* Code style fix

Signed-off-by: aagarwalla-fx <[email protected]>

---------

Signed-off-by: aagarwalla-fx <[email protected]>
  • Loading branch information
aagarwalla-fx authored Dec 22, 2024
1 parent 6f36adf commit 5bb1702
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/postgres_exporter/pg_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type pgSetting struct {
func (s *pgSetting) metric(labels prometheus.Labels) prometheus.Metric {
var (
err error
name = strings.Replace(s.name, ".", "_", -1)
name = strings.Replace(strings.Replace(s.name, ".", "_", -1), "-", "_", -1)
unit = s.unit // nolint: ineffassign
shortDesc = fmt.Sprintf("Server Parameter: %s", s.name)
subsystem = "settings"
Expand Down

0 comments on commit 5bb1702

Please sign in to comment.