File tree Expand file tree Collapse file tree 4 files changed +4
-8
lines changed
Expand file tree Collapse file tree 4 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package vttablet
1818
1919import (
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.
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ ln -sf /dev/stderr /mnt/vt/config/stderr.symlink
4040echo "log-error = /vt/config/stderr.symlink" > /mnt/vt/config/mycnf/log-error.cnf
4141echo "binlog_format=row" > /mnt/vt/config/mycnf/rbr.cnf
4242echo "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
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ limitations under the License.
1717package vttablet
1818
1919import (
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?
Original file line number Diff line number Diff line change @@ -521,7 +521,7 @@ function checkVitessBackupScheduleStatusWithTimeout() {
521521function 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
You can’t perform that action at this time.
0 commit comments