-
Notifications
You must be signed in to change notification settings - Fork 803
Fix lock_wait_timeout after #259 #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| slowLogFilter = kingpin.Flag( | ||
| "exporter.log_slow_filter", | ||
| "Add a log_slow_filter to avoid exessive MySQL slow logging. NOTE: Not supported by Oracle MySQL.", | ||
| "Add a log_slow_filter to avoid slow query logging of scrapes. NOTE: Not supported by Oracle MySQL.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make it in sync with what's in README.
| func New(dsn string, collect Collect) *Exporter { | ||
| // Setup extra params for the DSN, default to having a lock timeout. | ||
| dsnParams := []string{fmt.Sprintf(timeoutParam, exporterLockTimeout)} | ||
| dsnParams := []string{fmt.Sprintf(timeoutParam, *exporterLockTimeout)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual fix, pass value with * instead of address.
| dsn = dsn + "?" + strings.Join(dsnParams, "&") | ||
| dsn = dsn + "?" | ||
| } | ||
| dsn += strings.Join(dsnParams, "&") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to drop logic dupe.
SuperQ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# This is the 1st commit message: Move session params to DSN (prometheus#259) * Move session params to DSN In order to avoid lost session params if the `db` object reconnects in the background, move session params to the DSN string configuration. * Move log_slow_filter flag to exporter * Update flag name to be in `exporter` namespace. * Update README. * Tweak exporter.log_slow_filter flag documentation. # This is the commit message prometheus#2: Fix lock_wait_timeout after prometheus#259 (prometheus#263) # This is the commit message prometheus#3: Broken landing page, doesn't include metric path. (prometheus#264) * Broken landing page, doesn't include metric path. * Fix landing page. # This is the commit message prometheus#4: first commit Signed-off-by: Roi Ezra <ezraroi@gmail.com> # This is the commit message prometheus#5: fixed code review Signed-off-by: Roi Ezra <ezraroi@gmail.com> # This is the commit message prometheus#6: fixed code review Signed-off-by: Roi Ezra <ezraroi@gmail.com>
Move session params to DSN (prometheus#259) * Move session params to DSN In order to avoid lost session params if the `db` object reconnects in the background, move session params to the DSN string configuration. * Move log_slow_filter flag to exporter * Update flag name to be in `exporter` namespace. * Update README. * Tweak exporter.log_slow_filter flag documentation. Fix lock_wait_timeout after prometheus#259 (prometheus#263) Broken landing page, doesn't include metric path. (prometheus#264) * Broken landing page, doesn't include metric path. * Fix landing page. first commit Signed-off-by: Roi Ezra <ezraroi@gmail.com> fixed code review Signed-off-by: Roi Ezra <ezraroi@gmail.com> fixed code review Signed-off-by: Roi Ezra <ezraroi@gmail.com> first commit Signed-off-by: Roi Ezra <ezraroi@gmail.com> fixed code review fixed code review
Passing
exporterLockTimeouttolock_wait_timeout=%dresults in large integer instead of expected default2or whatever user passes. This is becauseexporterLockTimeoutis a pointer so it results in passing memory address rather ofexporterLockTimeoutthan value ofexporterLockTimeout. Getting value with*solves the issue.Error I was getting: