Skip to content

Commit a74d308

Browse files
committed
Fixes
Signed-off-by: Matt Lord <mattalord@gmail.com>
1 parent c1e2b1f commit a74d308

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

pkg/operator/vttablet/flags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package vttablet
1818

1919
import (
2020
"fmt"
21+
"path/filepath"
2122

2223
"vitess.io/vitess/go/vt/topo/topoproto"
2324

@@ -97,9 +98,8 @@ func init() {
9798

9899
// Base mysqld_exporter flags.
99100
mysqldExporterFlags.Add(func(s lazy.Spec) vitess.Flags {
100-
spec := s.(*Spec)
101101
return vitess.Flags{
102-
"config.my-cnf": spec.myCnfFilePath(),
102+
"config.my-cnf": filepath.Join(vtMycnfPath, mysqldExporterMySQLCnf),
103103
// The default for `collect.info_schema.tables.databases` is `*`,
104104
// which causes new time series to be created for each user table.
105105
// This in turn causes scaling issues in Prometheus memory usage.

pkg/operator/vttablet/mysqlctld.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ln -sf /dev/stderr /mnt/vt/config/stderr.symlink
4040
echo "log-error = /vt/config/stderr.symlink" > /mnt/vt/config/mycnf/log-error.cnf
4141
echo "binlog_format=row" > /mnt/vt/config/mycnf/rbr.cnf
4242
echo "socket = ` + mysqlSocketPath + `" > /mnt/vt/config/mycnf/socket.cnf
43-
echo -n "[client]\nuser=` + mysqldExporterUser + `\nsocket=` + mysqlSocketPath + `\n" > /mnt/vt/config/mycnf/` + mysqldExporterMySQLCnf + `
43+
echo -e "[client]\nuser=` + mysqldExporterUser + `\nsocket=` + mysqlSocketPath + `\n" > /mnt/vt/config/mycnf/` + mysqldExporterMySQLCnf + `
4444
`
4545

4646
mysqlSocketInitScript = `set -ex

pkg/operator/vttablet/pod.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package vttablet
1818

1919
import (
20-
"path/filepath"
2120
"strconv"
2221
"strings"
2322

@@ -211,9 +210,6 @@ func UpdatePod(obj *corev1.Pod, spec *Spec) {
211210
key = strings.TrimLeft(key, "-")
212211
mysqldExporterAllFlags[key] = value
213212
}
214-
if _, ok := mysqldExporterAllFlags["config.my-cnf"]; !ok {
215-
mysqldExporterAllFlags["config.my-cnf"] = filepath.Join(vtMycnfPath, mysqldExporterMySQLCnf)
216-
}
217213
}
218214

219215
// TODO: Can/should we still run mysqld_exporter pointing at external mysql?

test/endtoend/operator/101_initial_cluster.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ spec:
2222
vtbackup: vitess/lite:v23.0.0-mysql80
2323
mysqld:
2424
mysql80Compatible: vitess/lite:v23.0.0-mysql80
25-
mysqldExporter: prom/mysqld-exporter:v0.18.0
25+
# This needs to stay at 0.14.0 until we're upgrading from v24 to v25.
26+
# At which point it can use 0.18.0.
27+
mysqldExporter: prom/mysqld-exporter:v0.14.0
2628
cells:
2729
- name: zone1
2830
gateway:

test/endtoend/utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ function checkVitessBackupScheduleStatusWithTimeout() {
521521
function checkMysqldExporterMetrics() {
522522
for vttablet in $(kubectl get pods -n example --no-headers -o custom-columns=":metadata.name" | grep "vttablet") ; do
523523
echo "Confirming that the mysqld_exporter is working in ${vttablet}"
524-
open_files=$(kubectl -n example exec -it "${vttablet}" -c vttablet -- curl localhost:9104/metrics | grep -E "^mysql_global_status_open_files" | awk '{print $2}' | bc)
524+
open_files=$(kubectl -n example exec -it "${vttablet}" -c vttablet -- curl --max-time 10 localhost:9104/metrics | grep -E "^mysql_global_status_open_files" | awk '{print $2}' | bc)
525525
if [[ ${open_files} -lt 1 ]]; then
526526
echo -e "ERROR: mysqld metrics do not appear to be successfully exported from the ${vttablet} pod (open_files result: ${open_files})"
527527
exit 1

0 commit comments

Comments
 (0)