You've already forked mysqld_exporter
mirror of
https://github.com/prometheus/mysqld_exporter.git
synced 2025-07-30 06:43:05 +03:00
compatible with mysql<=5.7
Signed-off-by: hateeyan <hateeyan@gmail.com>
This commit is contained in:
@ -153,6 +153,7 @@ func (ScrapeGlobalVariables) Scrape(ctx context.Context, db *sql.DB, ch chan<- p
|
||||
"version_comment": "",
|
||||
"wsrep_cluster_name": "",
|
||||
"wsrep_provider_options": "",
|
||||
"tx_isolation": "",
|
||||
"transaction_isolation": "",
|
||||
}
|
||||
|
||||
@ -206,12 +207,16 @@ func (ScrapeGlobalVariables) Scrape(ctx context.Context, db *sql.DB, ch chan<- p
|
||||
}
|
||||
|
||||
// mysql_transaction_isolation metric.
|
||||
if textItems["transaction_isolation"] != "" {
|
||||
if textItems["transaction_isolation"] != "" || textItems["tx_isolation"] != "" {
|
||||
level := textItems["transaction_isolation"]
|
||||
if level == "" {
|
||||
level = textItems["tx_isolation"]
|
||||
}
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
prometheus.NewDesc(prometheus.BuildFQName(namespace, "transaction", "isolation"), "MySQL transaction isolation.",
|
||||
[]string{"level"}, nil),
|
||||
prometheus.GaugeValue,
|
||||
1, textItems["transaction_isolation"],
|
||||
1, level,
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user