Back to Charts

Prometheus Mysql Exporter

stable/prometheus-mysql-exporter/README.md

latest7.7 KB
Original Source

Prometheus Mysql Exporter

DEPRECATED and moved to https://github.com/prometheus-community/helm-charts

TL;DR;

console
$ helm install stable/prometheus-mysql-exporter

Introduction

This chart bootstraps a prometheus mysql exporter deployment on a Kubernetes cluster using the Helm package manager. The exporter can connect to mysql directly or using the Cloud SQL Proxy.

Installing the Chart

To install the chart with the release name my-release:

console
$ helm install --name my-release stable/prometheus-mysql-exporter --set mysql.user="username",mysql.pass="password",mysql.host="example.com",mysql.port="3306"

The command deploys a mysql exporter on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

console
$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the mysql exporter chart and their default values.

ParameterDescriptionDefault
replicaCountAmount of pods for the deployment1
image.repositoryImage repositoryprom/mysqld-exporter
image.tagImage tagv0.11.0
image.pullPolicyImage pull policyIfNotPresent
service.nameService namemysql-exporter
service.labelsAdditional labels for the service{}
service.annotationsAnnotations to be added to the service{}
service.typeService typeClusterIP
service.externalportThe service port9104
service.internalPortThe target port of the container9104
resourcesCPU/Memory resource requests/limits{}
annotationspod annotations for easier discoverysee values.yaml
collectorsCollector configurationsee values.yaml
podLabelsAdditional labels to add to each pod{}
mysql.dbMySQL connection db (optional)""
mysql.hostMySQL connection hostlocalhost
mysql.paramMySQL connection parameters (optional)"tcp"
mysql.passMySQL connection passwordpassword
mysql.portMySQL connection port3306
mysql.protocolMySQL connection protocol (optional)""
mysql.userMySQL connection usernameexporter
mysql.existingSecretUse existing kubernetes secret for DATA_SOURCE_NAMEfalse
cloudsqlproxy.enabledFlag to enable the connection using Cloud SQL Proxyfalse
cloudsqlproxy.image.repoCloud SQL Proxy image repositorygcr.io/cloudsql-docker/gce-proxy
cloudsqlproxy.image.tagCloud SQL Proxy image tag1.14
cloudsqlproxy.image.pullPolicyCloud SQL Proxy image pull policyIfNotPresent
cloudsqlproxy.instanceConnectionNameGoogle Cloud instance connection nameproject:us-central1:dbname
cloudsqlproxy.portCloud SQL Proxy listening port3306
cloudsqlproxy.credentialsCloud SQL Proxy service account credentialsbogus credential file
serviceMonitor.enabledIntegration with prometheus-operatorfalse
serviceMonitor.intervalInterval for polling this exporter
serviceMonitor.scrapeTimeoutTimeout where exporter is considered faulty
serviceMonitor.jobLabelLabel to use to retrieve the job name from""
serviceMonitor.targetLabelsLabels to transfer from service onto the target[]
serviceMonitor.podTargetLabelsLabels to transfor from pod onto the target[]
serviceMonitor.metricRelabelingsMetricRelabelConfigs to apply to samples before ingestion.[]

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

console
$ helm install --name my-release \
  --set mysql.user="username",mysql.password="password",mysql.host="localhost",mysql.port="3306"  \
    stable/prometheus-mysql-exporter

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

console
$ helm install --name my-release -f values.yaml stable/prometheus-mysql-exporter

Documentation for the MySQL Exporter can be found here: (https://github.com/prometheus/mysqld_exporter) A mysql params overview can be found here: (https://github.com/go-sql-driver/mysql#dsn-data-source-name)

Collector Flags

Available collector flags can be found in the values.yaml and a description of each flag can be found in the mysqld_exporter repository.