Skip to content
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: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
images: ghcr.io/rluisr/mysqlrouter_exporter
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
Expand Down
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Application Options:
--user= Username for REST API [$MYSQLROUTER_EXPORTER_USER]
--pass= Password for REST API [$MYSQLROUTER_EXPORTER_PASS]
-p, --listen-port= Listen port (default: 49152)
--service-name= Service name for MySQL Router [$MYSQLROUTER_EXPORTER_SERVICE_NAME]
--tls-ca-cert-path= TLS CA cacert path [$MYSQLROUTER_TLS_CACERT_PATH]
--tls-cert-path= TLS cert path [$MYSQLROUTER_TLS_CERT_PATH]
--tls-key-path= TLS key path [$MYSQLROUTER_TLS_KEY_PATH]
Expand Down
3 changes: 2 additions & 1 deletion gauges.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ var (
Namespace: nameSpace,
Name: "router_status",
Help: "MySQL Router information",
}, []string{"process_id", "product_edition", "time_started", "version", "hostname"})
}, []string{"process_id", "product_edition", "time_started", "version", "hostname", "service"})

metadataGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: nameSpace,
Name: "metadata",
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var args struct {
RestAPIUser string `short:"" long:"user" required:"false" env:"MYSQLROUTER_EXPORTER_USER" description:"Username for REST API"`
RestAPIPass string `short:"" long:"pass" required:"false" env:"MYSQLROUTER_EXPORTER_PASS" description:"Password for REST API"`
ListenPort int `short:"p" long:"listen-port" default:"49152" description:"Listen port"`
ServiceName string `short:"" long:"service-name" required:"true" env:"MYSQLROUTER_EXPORTER_SERVICE_NAME" description:"Service name for MySQL Router"`
TLSCACertPath string `short:"" long:"tls-ca-cert-path" required:"false" env:"MYSQLROUTER_TLS_CACERT_PATH" description:"TLS CA cacert path"`
TLSCertPath string `short:"" long:"tls-cert-path" required:"false" env:"MYSQLROUTER_TLS_CERT_PATH" description:"TLS cert path"`
TLSKeyPath string `short:"" long:"tls-key-path" required:"false" env:"MYSQLROUTER_TLS_KEY_PATH" description:"TLS key path"`
Expand Down Expand Up @@ -151,7 +152,7 @@ func collectRouterMetrics() (*mysqlrouter.Router, error) {
}

routerUpGauge.Set(1)
routerStatusGauge.WithLabelValues(strconv.Itoa(router.ProcessID), router.ProductEdition, router.TimeStarted.String(), router.Version, router.Hostname)
routerStatusGauge.WithLabelValues(strconv.Itoa(router.ProcessID), router.ProductEdition, router.TimeStarted.String(), router.Version, router.Hostname, args.ServiceName)

lastRouter = router

Expand Down