Orange-OpenSource / galera-operator

Galera Operator automates tasks for managing a Galera cluster in Kubernetes
Apache License 2.0
34 stars 18 forks source link

Passing parameters to the docker prom/mysql-exporter #7

Open plafosse-orange opened 4 years ago

plafosse-orange commented 4 years ago

According to the documentation of the prom/mysqld-exporter docker, it is possible to pass parameters to the mysqld-exporter program to be able to collect or delete certain metrics. For this, the collect flags must be passed under the args tag

Example deployment file

apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysqld-exporter
  labels:
    app: mysqld-exporter
spec:
  selector:
    matchLabels:
      app: mysqld-exporter
  replicas: 1
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9104"
      labels:
        app: mysqld-exporter
    spec:
      containers:
      - name: mysqld-exporter
        image: prom/mysqld-exporter
        args: [--collect.auto_increment.columns, --no-collect.slave_status]
        env:
        - name: DATA_SOURCE_NAME
          value: root:password@(mysql:3306)/ 

Currently, the Galera operator does not interpret the args tag at the metric container

sebs42 commented 4 years ago

So you want to add an "args" field instead of designing your exporter with the right argument ? It can be implemented.