Skip to content
New issue

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

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

Already on GitHub? # to your account

Change replica_host_status terminology #496

Merged
merged 2 commits into from
Jan 5, 2022
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Changes:
* [ENHANCEMENT]
* [BUGFIX]

* [FEATURE] Add collector for `replica_host_status` #496

## 0.13.0 / 2021-05-18

BREAKING CHANGES:
Expand Down
12 changes: 6 additions & 6 deletions collector/info_schema_replica_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ var (
"The CPU usage as a percentage.",
[]string{"server_id", "role"}, nil,
)
infoSchemaReplicaHostSlaveLatencyDesc = prometheus.NewDesc(
prometheus.BuildFQName(namespace, informationSchema, "replica_host_slave_latency_seconds"),
"The master-slave latency in seconds.",
infoSchemaReplicaHostReplicaLatencyDesc = prometheus.NewDesc(
prometheus.BuildFQName(namespace, informationSchema, "replica_host_replica_latency_seconds"),
"The source-replica latency in seconds.",
[]string{"server_id", "role"}, nil,
)
infoSchemaReplicaHostLagDesc = prometheus.NewDesc(
Expand Down Expand Up @@ -102,7 +102,7 @@ func (ScrapeReplicaHost) Scrape(ctx context.Context, db *sql.DB, ch chan<- prome
serverId string
role string
cpu float64
slaveLatency uint64
replicaLatency uint64
replicaLag float64
logStreamSpeed float64
replayLatency uint64
Expand All @@ -112,7 +112,7 @@ func (ScrapeReplicaHost) Scrape(ctx context.Context, db *sql.DB, ch chan<- prome
&serverId,
&role,
&cpu,
&slaveLatency,
&replicaLatency,
&replicaLag,
&logStreamSpeed,
&replayLatency,
Expand All @@ -124,7 +124,7 @@ func (ScrapeReplicaHost) Scrape(ctx context.Context, db *sql.DB, ch chan<- prome
serverId, role,
)
ch <- prometheus.MustNewConstMetric(
infoSchemaReplicaHostSlaveLatencyDesc, prometheus.GaugeValue, float64(slaveLatency)*0.000001,
infoSchemaReplicaHostReplicaLatencyDesc, prometheus.GaugeValue, float64(replicaLatency)*0.000001,
serverId, role,
)
ch <- prometheus.MustNewConstMetric(
Expand Down