> For the complete documentation index, see [llms.txt](https://docs.cennso.com/cennso/cennso-db/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/cennso/cennso-db/latest/concepts/cennso-db-instance.md).

# Cennso Database Instance

A Cennso Database Instance is represented by the `DBInstance` Custom Resource (CR) and defines a MySQL cluster managed by the [Cennso Database Operator](https://docs.cennso.com/cennso/cennso-db/latest/concepts/cennso-db-operator.md).

> [!IMPORTANT]
> Before deploying the MySQL cluster, you must have the Database Operator up and running.

The sections below provide information about configuration parameters that you can specify in the `DBInstance` CR. For more information on how to configure and deploy the database cluster, see the [Deploy Cennso Database](https://docs.cennso.com/cennso/cennso-db/latest/deployment-guides/cennso-database.md) and [Cennso Database Instance Custom Resource Definition](https://docs.cennso.com/cennso/cennso-db/latest/technical-reference/configurations/cennso-db/xdbinstance_definition.md) documents.

## Naming constraint

> [!IMPORTANT]
> The `DBInstance` **metadata.name** must not exceed `15` characters.

The Cennso Database extension derives the names of the MySQL cluster resources (the underlying MySQL custom resource, the StatefulSet pods, PVCs, and the HAProxy Service) from the `DBInstance` **metadata.name**, with a fixed prefix `ps-db-` that is added automatically. The combined name is bound by an upper limit of `21` characters. Since the prefix consumes `6` characters, only `15` characters remain for the name you choose.

If the `DBInstance` name is longer than `15` characters, the generated resource names are silently truncated, while the HAProxy Service selectors still reference the un-truncated name. As a result, the HAProxy Service selector does not match the actual MySQL pods, and the MySQL cluster becomes unreachable through HAProxy.

## Kubernetes cluster secret reference

To deploy the Cennso Database Instance to a Core Cluster, you must specify the reference to the [Kubernetes secret](https://kubernetes.io/docs/concepts/configuration/secret/) so this cluster can be accessible. You can do this using the following configuration parameters:

```yaml
spec:
  connectionSecretRef:
    name: {CORE-CLUSTER-NAME}
    namespace: {CORE-CLUSTER-SECRET-NAMESPACE}
```

Set **spec.connectionSecretRef.name** to the name of the Core Cluster where the Cennso Database Instance should be installed. The **spec.connectionSecretRef.namespace** configuration parameter defines the Kubernetes Namespace on the Management Cluster where the Kubernetes secret to access this Core Cluster is stored.

## Image and chart configuration

You can use the following configuration parameters to specify the versions of the container image along with the secret to pull the image and Helm chart of the Cennso Database Instance:

```yaml
spec:
  mysql:
    image:
      repository: {DATABASE-INSTANCE-IMAGE-REPOSITORY}
      tag: {DATABASE-INSTANCE-IMAGE-TAG}
    initImage:
      repository: {DATABASE-INSTANCE-INIT-IMAGE-REPOSITORY}
      tag: {DATABASE-INSTANCE-INIT-IMAGE-TAG}
  imagePullSecretRef:
    name: {SECRET-NAME}
  chart:
    registry: {CHART-REGISTRY-NAME}
    name: {DATABASE-INSTANCE-CHART-NAME}
    version: {DATABASE-INSTANCE-CHART-VERSION}
```

## Scheduling and placement configuration

The MySQL instances specified by the Cennso Database Instance CR are deployed in the Kubernetes namespace specified by the following configuration option:

```yaml
spec:
  namespace: {MYSQL-CLUSTER-NAMESPACE}
```

The node where a MySQL instance runs depends on how its storage is configured, as described in the [Storage configuration](#storage-configuration) section.

## MySQL cluster size

> [!IMPORTANT]
> The value of the **spec.mysql.size** parameter must not exceed the number of entries in **spec.instances**.

The Cennso Database extension allows you to deploy and manage database clusters consisting of multiple database instances. By default, the number of MySQL instances that run in the cluster equals the number of entries in the **spec.instances** parameter. Using the optional **spec.mysql.size** configuration option, you can change the number of instances. The most common use case is to scale down your cluster for maintenance operations, for example, restoring a database from backup. You can use this configuration option to scale down your cluster to zero nodes:

```yaml
spec:
  mysql:
    size: 0
```

Scaling down does not remove the storage of the stopped instances. When you increase **spec.mysql.size** again, the instances reuse their existing storage.

## Liveness, readiness, and startup probes configuration

> [!IMPORTANT]
> Since a MySQL instance can take a long time to get up and running after a restart, make sure that the startup probes are configured with a `failureThreshold` value high enough for the MySQL restore procedure.

You can use the following configuration parameters to specify the configuration for the liveness, readiness, and startup probes applied to the MySQL instance deployments:

```yaml
spec:
  mysql:
    startupProbe:
      initialDelaySeconds: 15
      timeoutSeconds: 43200
      periodSeconds: 10
      failureThreshold: 1
      successThreshold: 1
    readinessProbe:
      initialDelaySeconds: 30
      timeoutSeconds: 3
      periodSeconds: 5
      failureThreshold: 3
      successThreshold: 1
    livenessProbe:
      initialDelaySeconds: 15
      timeoutSeconds: 10
      periodSeconds: 10
      failureThreshold: 3
      successThreshold: 1
```

For more information, see the [official Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/).

## Storage configuration

The storage configuration section allows you to specify the size and the [storage class](https://kubernetes.io/docs/concepts/storage/storage-classes/) of the requested storage for a MySQL database instance:

```yaml
spec:
  storage:
    capacity: 20Gi
    className: {STORAGE-CLASS-NAME}
```

The **spec.storage.className** refers to a StorageClass on the target Core Cluster. This can be a StorageClass that already exists there, or one of the storage classes created with **spec.storage.classes** of the `DBOperator` CR, as described in the [Storage configuration](https://docs.cennso.com/cennso/cennso-db/latest/concepts/cennso-db-operator.md#storage-configuration) section of the Cennso Database Operator document. If you plan to use an existing StorageClass, make sure that it exists on the target Core Cluster before you deploy the database instances.

These settings apply to all MySQL instances of the cluster. The source of each MySQL instance's volume is defined per instance in **spec.instances** or by the storage class from **spec.storage.className**. Read the next sections to get more information.

### Volumes provided by the storage class

If you don't define spec.instances[].storage, the volume of each MySQL instance is requested with a PersistentVolumeClaim (PVC) created from the volume claim template of the MySQL StatefulSet. This PVC refers to the storage class specified in **spec.storage.className**. In this case, you can not directly specify nodes or paths in the Cennso Database Instance CR. Each MySQL instance runs on a node where the provisioner can provide its volume. Depending on the provisioner, this can be any node of the Core Cluster or only specific nodes. The MySQL instances must still be listed in **spec.instances**, each as an empty entry:

```yaml
spec:
  instances:
    0: {}
    1: {}
```

### Node-local volumes

The **spec.instances[].storage** setting places a MySQL instance on a specific node and keeps its data in a specific directory on that node. Use it when the data must stay on the local disks of dedicated nodes, or when you need to know in advance on which node each MySQL instance runs.

For each entry with this setting, the Cennso Database Instance creates the following resources:

- Persistent Volume with the capacity specified in **spec.storage.capacity** for the given node and path
- Persistent Volume Claim bound to this volume

In such a case, the provisioner of the storage class specified in **spec.storage.className** does not create the volume. The name of the storage class is only assigned to the Persistent Volume and the Persistent Volume Claim. The Persistent Volume has a node affinity for the node specified in **spec.instances[].storage.node**, so the MySQL instance always runs on this node. See the configuration example:

```yaml
spec:
  instances:
    0:
      storage:
        node: {NODE-NAME-1}
        path: /opt/local-path-provisioner/mysql-cluster-datadir/instance0
    1:
      storage:
        node: {NODE-NAME-2}
        path: /opt/local-path-provisioner/mysql-cluster-datadir/instance1
```

> [!IMPORTANT]
> The directories specified in the **spec.instances[].storage.path** must exist on the nodes before you deploy the Cennso Database Instance. For more information, read the [Deploy Cennso Database](https://docs.cennso.com/cennso/cennso-db/latest/deployment-guides/cennso-database.md) guide.

### Data after deletion

The database data is kept when the Cennso Database Instance is deleted if **spec.persistentVolumeReclaimPolicy** was set to [Retain](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reclaiming) in the database's Persistent Volume. A Cennso Database Instance created later with the same name and storage configuration starts with this data. To start with empty data, remove it first:

- Without **spec.instances[].storage**, delete the Persistent Volume Claims of the MySQL instances in the namespace of the MySQL cluster. If the storage class was created by the Cennso Database Operator, also remove the directories of the volumes on the nodes, as described in the [Storage configuration](https://docs.cennso.com/cennso/cennso-db/latest/concepts/cennso-db-operator.md#storage-configuration) section of the Cennso Database Operator document. 
- With **spec.instances[].storage**, delete the content of the directories specified in **spec.instances[].storage.path** on the nodes.

## TLS secret configuration

Using the following configuration option, you can configure the reference to the Kubernetes Secret which contains TLS certificates and keys used for the encrypted connections to the MySQL server:

```yaml
spec:
  tlsSecretName: "tls-secret"
```

This Kubernetes Secret must exist in the Core Cluster, in the same namespace where you deployed your MySQL instances.

By default, this value is an empty string, which means the TLS secret created by the Cennso Database Operator is used. In addition, you can specify the secret generated based on the `XDBTLSCertificate`. For more information, see the [Cennso Database Certificate](https://docs.cennso.com/cennso/cennso-db/latest/concepts/cennso-db-certificate.md) and [Manage TLS certificates](https://docs.cennso.com/cennso/cennso-db/latest/operation-guides/certificates.md) documents.

## MySQL resources, server, and environment configuration

You can specify [resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for MySQL instances using the following configuration options:

```yaml
spec:
  mysql:
    resources:
      cpu: 8
      memory: 8Gi
```

Both **spec.mysql.resources.cpu** and **spec.mysql.resources.memory** are set to the CPU/memory requests and limits.

> [!IMPORTANT]
> The value specified in the **spec.mysql.resources.memory** parameter is a base to calculate the size of [innodb_buffer_pool_size](https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_buffer_pool_size), which configures the underlying database engine. The size of the buffer pool is set to 75% of the specified resources. To get a valid value, you must use only `G` or `Gi` [quantity suffix](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory).

To configure the MySQL server, use the following configuration option:

```yaml
spec:
  mysql:
    additionalConfiguration: |
       max_error_count: 10000
```

For more information about available configuration options, see the [official MySQL documentation](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html).

To improve memory management, you can enable [jemalloc](https://jemalloc.net/) allocator in MySQL servers. You can do this using the following configuration options:

```yaml
spec:
  jemalloc:
    enabled: true
```

By default, the jemalloc shared library is located at `/lib64/libjemalloc.so.2` and is defined in the **ldPreload** parameter. The allocator settings are specified in **mallocConf**, which is by default set to `background_thread:true,dirty_decay_ms:2000,muzzy_decay_ms:0,narenas:4,lg_tcache_max:14`. For more information about these and other available jemalloc tunables, see the [official documentation](https://jemalloc.net/jemalloc.3.html).

You can change both settings using the following configuration options:

```yaml
spec:
  jemalloc:
    ldPreload: "/lib64/libjemalloc.so.2"
    mallocConf: "background_thread:true,dirty_decay_ms:2000,muzzy_decay_ms:0,narenas:4,lg_tcache_max:14"
```

In addition, you can use the **spec.mysql.additionalEnvs** configuration option to specify extra environment variables for MySQL server instances. For example:

```yaml
spec:
  mysql:
    additionalEnvs:
      - name: LIBMYSQL_PLUGIN_DIR
        value: "/var/lib/mysql/plugin"
```

## Cloning database instances

> [!IMPORTANT]
> If you enable `binary-donor` with setting **spec.binaryDonor.enabled** to `true`, the `CLONE` is always disabled, even if you enable it by setting the configuration option described below.

When a new secondary replica is up and running, it clones data from the primary instance using the [CLONE](https://dev.mysql.com/doc/refman/8.0/en/clone-plugin.html) operation. To disable this behaviour, use the following configuration option:

```yaml
spec:
  mysql:
    cloneRequiredOnAsyncCluster: false
```

## SQL applied during role change

The Cennso Database extension lets you tune MySQL server settings based on the role of the instance. This covers the initial bootstrap, scale-out of new replicas, MySQL restarts, automatic failovers, and graceful takeovers. In every case, the matching SQL is re-applied so the server-side settings always reflect the pod's current role. The `DBInstance` CR exposes the following configuration options, which can contain a set of SQL commands executed during a role change:

```yaml
spec:
  mysql:
    roleChange:
      primarySQL: |
        set global sync_binlog = 1;
        set global innodb_flush_log_at_trx_commit = 1;
        set global event_scheduler = ON;
      replicaSQL: |
        set global sync_binlog = 0;
        set global innodb_flush_log_at_trx_commit = 0;
        set global event_scheduler = OFF;
```

The **spec.mysql.roleChange.primarySQL** is applied to the pod currently labelled as the primary. The **spec.mysql.roleChange.replicaSQL** is applied to every other pod.

> [!NOTE]
> Each statement must be terminated by `;`.

The default values prioritize replication throughput over durability. The primary flushes the binary log and InnoDB redo log on every transaction commit, while replicas leave both flush operations to the operating system. The MySQL event scheduler is enabled only on the primary, so scheduled events do not run twice during a failover.

> [!TIP]
> Events created on a primary are replicated to replicas with the status `REPLICA_SIDE_DISABLED`. After a failover, the former replica that takes over as primary may not run those events even though its event scheduler is now `ON`. To activate them on the new primary, add the following SQL command to your **spec.mysql.roleChange.primarySQL** configuration:
>
> ```sql
> ALTER DEFINER='user'@'{USER-HOST}' EVENT my_database.my_event ENABLE;
> ```

## Additional services and tools

In addition to the MySQL itself, the `DBInstance` CR controls the following components:

- [HAProxy](#haproxy-configuration)
- [Orchestrator](#orchestrator-configuration)
- [Backup](#backup-configuration)
- [Percona MySQL Toolkit](#percona-mysql-toolkit-configuration)
- [Prometheus mysqld exporter](#prometheus-mysqld-exporter-configuration)
- [Binary log donor server](#binary-log-donor-server)

The following sections provide information about the configuration of these tools and services.

### Binary log donor server

> [!IMPORTANT]
> This section provides information only about the available configuration options for `binary-donor`. For the deployment details, see the [Deploy Cennso Database](https://docs.cennso.com/cennso/cennso-db/latest/deployment-guides/cennso-database.md) deployment guide. For more information, see [Enable `binary-donor`](https://docs.cennso.com/cennso/cennso-db/latest/deployment-guides/binary-donor.md).

The Cennso Database extension provides a lightweight MySQL binary log server that enables zero data loss during MySQL failover. You can enable it using the following configuration options:

```yaml
spec:
  binaryDonor:
    enabled: true
```

The `binary-donor` also replaces the deprecated **spec.replicationSyncWaitTimeOnUpgrade** configuration option of the `DBOperator` Custom Resource. A restarted database instance catches up with the primary from the exposed binary logs, so the database operator does not need to wait between the restarts of the database instances. For more information, see the [Graceful upgrade](https://docs.cennso.com/cennso/cennso-db/latest/concepts/cennso-db-operator.md#graceful-upgrade) section.

Each `binary-donor` instance should have assigned [server-id](https://dev.mysql.com/doc/refman/8.0/en/replication-options.html#sysvar_server_id). You can do it using the following configuration option:

```yaml
spec:
  binaryDonor:
    serverIdBase: 70000
```

This configuration option is optional and can be omitted. In this case, the unique `server-id` is assigned during deployment, starting from `65536`.

You can specify the repository and container image tag for `binary-donor` using the following configuration options:

```yaml
spec:
  binaryDonor:
    image:
      registry: registry.cennso.com/cennso/binlog-donor
      tag: v1.0.0
      pullPolicy: Always
```

To specify [Kubernetes resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for `binary-donor`, you can use the following configuration options:

```yaml
spec:
  binaryDonor:
    resources:
      requests:
        cpu: 500m
        memory: 500Mi
      limits:
        cpu: 500m
        memory: 500Mi
```

You can apply additional [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) and [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) to the `binary-donor` Kubernetes Deployment and Service resources:

```yaml
spec:
  binaryDonor:
    deploymentLabels:
      app.kubernetes.io/component: binlog-donor
    deploymentAnnotations:
      custom-annotation: custom-value
    serviceLabels:
      app.kubernetes.io/component: binlog-donor
    serviceAnnotations:
      custom-annotation: custom-value
```

The **spec.binaryDonor.deploymentLabels** are applied to both the Deployment and its Pod templates.

To change the log level of the log messages that `binary-donor` produces, you can use the following configuration:

```yaml
spec:
  binaryDonor:
    env:
      - name: LOG_LEVEL
        value: debug
```

The available log levels are:

- `debug`
- `info`
- `warn`
- `error`

### HAProxy configuration

To connect to the database instances, you can enable and configure the deployment of the [HAProxy](https://www.haproxy.org/) service using the following configuration options:

```yaml
spec:
  haproxy:
    enabled: true
    size: 2
    image:
      registry: {HAPROXY-IMAGE-REGISTRY}
      tag: {HAPROXY-IMAGE-TAG}
    initImage:
      registry: {HAPROXY-INIT-IMAGE-REGISTRY}
      tag: {HAPROXY-INIT-IMAGE-TAG}
```

The **spec.haproxy.image** configuration option defines the image of the HAProxy container itself, while the **spec.haproxy.initImage** configuration option defines the image of the init container that provisions the HAProxy configuration and the helper scripts.

You can specify [resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for HAProxy using the following configuration options:

```yaml
spec:
  haproxy:
    resources:
      cpu: 600m
      memory: 1G
```

Both **spec.haproxy.resources.cpu** and **spec.haproxy.resources.memory** are set to the CPU/memory requests and limits. If an HAProxy container needs more CPU than the limit, Kubernetes throttles it. If it needs more memory than the limit, Kubernetes kills the container with the `OOMKilled` reason, and the client connections through this HAProxy pod are interrupted. Set the values according to the expected load on HAProxy. To see how much CPU and memory HAProxy uses, see the [HAProxy CPU and memory usage](https://docs.cennso.com/cennso/cennso-db/latest/observability/dashboard.md#haproxy-cpu-and-memory-usage) section of the Grafana dashboard.

> [!NOTE]
> The values are applied to each container of the HAProxy pod. Every HAProxy pod runs the HAProxy container and the sidecar that updates the HAProxy backends, so the requests and limits of the pod are twice the specified CPU and memory.

You can specify the [Pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/), using the following configuration options:

```yaml
spec:
  haproxy:
    podSecurityContext:
      runAsUser: 1001
      fsGroup: 1001
```

HAProxy applies a set of options to each MySQL backend server. These options control the health check - a check for replication status and the value of the `read_only` status variable. This lets HAProxy detect a failed MySQL instance and stop routing traffic to it. By default, it is configured like this for each MySQL backend:

```
check inter 10000 rise 1 fall 2 weight 1
```

The default configuration means:

- `check` enables the health check for the MySQL instance.
- `inter 10000` runs a health check every `10000` milliseconds.
- `rise 1` marks the MySQL instance as available after `1` successful health check.
- `fall 2` marks the MySQL instance as unavailable after `2` consecutive failed health checks.
- `weight 1` gives the MySQL instance the same share of the traffic as the other instances with the same weight.

You can change some values of these configuration options using these parameters:

```yaml
spec:
  haproxy:
    serverOptions:
      interval: 10000
      rise: 1
      fall: 2
      weight: 1
```

Each value has an allowed range. The API server rejects a claim with a value outside it:

| Configuration option | Allowed values |
|---|---|
| **spec.haproxy.serverOptions.interval** | `1000` to `300000` milliseconds |
| **spec.haproxy.serverOptions.rise** | `1` to `20` |
| **spec.haproxy.serverOptions.fall** | `1` to `20` |
| **spec.haproxy.serverOptions.weight** | `0` to `256` |

> [!NOTE]
> The health check option is always enabled, and you can not turn it off.

Using the **spec.haproxy.serverOptions.additionalOptions** configuration option, you can append further options to the ones above. For example:

```yaml
spec:
  haproxy:
    serverOptions:
      additionalOptions: "on-marked-down shutdown-sessions"
```

> [!NOTE]
> The **spec.haproxy.serverOptions.additionalOptions** configuration option can be up to `1024` characters long, and must not contain the `check`, `no-check`, `inter`, `rise`, `fall`, and `weight` options. HAProxy applies the value from the last occurrence of a repeated option, so these options override the values configured for other **spec.haproxy.serverOptions** configuration options.

For more information about the available options, see the [official documentation](https://www.haproxy.com/documentation/haproxy-configuration-manual/latest/#server%20%28Peers%20declaration%29).

In addition, you can specify [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) for the HAProxy Kubernetes [service](https://kubernetes.io/docs/concepts/services-networking/service/) using these parameters:

```yaml
spec:
  service:
    haproxy:
      annotations: {}
```

For each entry in **spec.instances**, the Cennso Database Instance also creates a Kubernetes service that targets the single HAProxy instance with the same number. Using the optional **spec.instances[].externalIP** configuration option, you can assign an external IP address to this service. The number of external IP addresses must not exceed the number of HAProxy instances specified in **spec.haproxy.size**:

```yaml
spec:
  instances:
    0:
      externalIP: {HAPROXY-0-EXTERNAL-IP-ADDRESS}
    1:
      externalIP: {HAPROXY-1-EXTERNAL-IP-ADDRESS}
```

### Orchestrator configuration

To orchestrate the MySQL instances within a MySQL cluster, you can enable and configure the deployment of the MySQL [Orchestrator](https://github.com/openark/orchestrator) service using the following configuration options:

```yaml
spec:
  orchestrator:
    enabled: true
    size: 2
    image:
      registry: {ORCHESTRATOR-IMAGE-REGISTRY}
      image: {ORCHESTRATOR-IMAGE-NAME}:{ORCHESTRATOR-IMAGE-TAG}
```

In addition, you can use the **spec.orchestrator.additionalEnvs** configuration option to specify extra environment variables for the Orchestrator container. For example:

```yaml
spec:
  orchestrator:
    additionalEnvs:
      - name: ORC_DEBUG
        value: "true"
```

### Backup configuration

To perform backups, you can deploy the [Percona XtraBackup](https://docs.percona.com/percona-xtrabackup/8.4/) with [restic](https://restic.net/) client using the Cennso Database Instance CR. To configure the deployment of these components, use the following configuration options:

```yaml
spec:
  backup:
    enabled: true
    image:
      registry: {BACKUP-IMAGE-REGISTRY}
      image: {BACKUP-IMAGE-NAME}:{BACKUP-IMAGE-TAG}
    resources:
      cpu: "2"
      memory: "4Gi"
```

For more information about backups, see the [Cennso Database Backup](https://docs.cennso.com/cennso/cennso-db/latest/concepts/cennso-db-backup.md) and [Back up and restore](https://docs.cennso.com/cennso/cennso-db/latest/operation-guides/backup.md) documents.

### Percona MySQL Toolkit configuration

The Cennso Database Instance CR provides deployment of the [Percona Toolkit](https://www.percona.com/percona-toolkit) along with the MySQL database instances. You can configure it using the following configuration options:

```yaml
spec:
  toolkit:
    image:
      registry: {TOOLKIT-IMAGE-REGISTRY}
      image: {TOOLKIT-IMAGE-NAME}:{TOOLKIT-IMAGE-TAG}
    resources:
      cpu: "1"
      memory: "1Gi"
```

### Prometheus mysqld exporter configuration

The Cennso Database Instance CR allows deployment of the [Prometheus mysqld exporter](https://github.com/percona/mysqld_exporter) for monitoring the MySQL database clusters. You can enable it with:

```yaml
spec:
  metricsExporter:
    enabled: true
```

For more information, see [Enable metrics collector](https://docs.cennso.com/cennso/cennso-db/latest/deployment-guides/cennso-database-observability.md).
