-
Notifications
You must be signed in to change notification settings - Fork 352
Updated MySQL Prometheus documentation #596
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
Changes from 3 commits
81a4c3d
361e113
5daec61
9b1f6dc
5f0f960
ab57dc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,47 +7,46 @@ exporter_name: the MySQL exporter | |
| exporter_pkg_name: mysqld_exporter | ||
| exporter_repo_url: https://github.com/prometheus/mysqld_exporter | ||
| dashboard_available: true | ||
| minimum_exporter_version: v0.14.0 | ||
| minimum_exporter_version: v0.15.0 | ||
| multiple_dashboards: false | ||
| dashboard_display_name: {{app_name_short}} Prometheus Overview | ||
| config_mods: | | ||
| apiVersion: apps/v1 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per the other example, we can update https://github.com/GoogleCloudPlatform/prometheus-engine/blob/main/examples/mysql/exporter.yaml.snippet directly (after addressing the other comments here) But unlike the consul example, this PR doesn't become completely obsolete -- we do still need to update this file because of the change you made in line 70 (additional_install_info).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good, just for clarity I wanted to make sure that the line you're mentioning here doesn't need to be changed? We just want to update things in this repo and the other one, right?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep |
||
| kind: StatefulSet | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: mysql | ||
| spec: | ||
| serviceName: mysql | ||
| selector: | ||
| matchLabels: | ||
| + app.kubernetes.io/name: mysql | ||
| template: | ||
| metadata: | ||
| labels: | ||
| + app.kubernetes.io/name: mysql | ||
| spec: | ||
| containers: | ||
| + - name: exporter | ||
| + image: prom/mysqld-exporter:v0.14.0 | ||
| + env: | ||
| + - name: DATA_SOURCE_NAME | ||
| + value: root:password@(localhost:3306)/ | ||
| + ports: | ||
| + - containerPort: 9104 | ||
| + name: prometheus | ||
| - image: mysql:5.7 | ||
|
algchoo marked this conversation as resolved.
|
||
| name: mysql | ||
| env: | ||
| - name: MYSQL_ROOT_PASSWORD | ||
| value: password | ||
| - name: MYSQL_USER | ||
| value: sbtest | ||
| - name: MYSQL_PASSWORD | ||
| value: password | ||
| - name: MYSQL_DATABASE | ||
| value: sbtest | ||
| ports: | ||
| - containerPort: 3306 | ||
| name: mysql | ||
| name: mysql-exporter-config | ||
| data: | ||
| my.cnf: | | ||
| [client] | ||
| user=root | ||
| password=password | ||
| ------- | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: mysql | ||
| spec: | ||
| serviceName: mysql | ||
| selector: | ||
| matchLabels: | ||
| + app.kubernetes.io/name: mysql | ||
| template: | ||
| metadata: | ||
| labels: | ||
| + app.kubernetes.io/name: mysql | ||
| spec: | ||
| containers: | ||
| + - name: exporter | ||
| + image: prom/mysqld-exporter:v0.15.0 | ||
| + args: | ||
| + - --config.my-cnf=/home/my.cnf | ||
| + ports: | ||
| + - containerPort: 9104 | ||
| + name: prometheus | ||
| + volumeMounts: | ||
| + - mountPath: /home/my.cnf | ||
| + subPath: my.cnf | ||
| + name: mysql-exporter-config | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried applying this yaml and got Looks like we need to define a volume that corresponds to the volumeMount?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've updated the yaml to include a
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think so. In some cases like the nginx one, you can reasonably expect that anyone setting up nginx on k8s will have a configmap set up, so we just use "+"s to indicate the lines they need to add to the config map. In this case, if you already had a mysql instance up and running, and then you were adding an exporter, you wouldn't already have a configmap with credentials beforehand, so the volume, volumemount, configmap are all indicated with "+"s. Does that make sense?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe so, I pushed changes to include the |
||
| podmonitoring_config: | | ||
| apiVersion: monitoring.googleapis.com/v1 | ||
| kind: PodMonitoring | ||
|
|
@@ -68,7 +67,7 @@ podmonitoring_config: | | |
| additional_prereq_info: | | ||
| For information about creating a least-privileged user, see [Required Grants](https://github.com/prometheus/mysqld_exporter#required-grants){:class=external}. | ||
| additional_install_info: | ||
| Update the `DATA_SOURCE_NAME` environment variable with credentials that work with your {{app_name}} instance. | ||
| Update the `--config.my-cnf` argument with a path to a configuration file with credentials that work with your {{app_name}} instance | ||
| sample_promql_query: up{job="mysql", cluster="{{cluster_name}}", namespace="{{namespace_name}}"} | ||
| alerts_config: | | ||
| apiVersion: monitoring.googleapis.com/v1 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.