> ## Documentation Index
> Fetch the complete documentation index at: https://docs-xcor.paloaltonetworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# cert-manager

> Certificate lifecycle and expiry metrics from cert-manager, scraped from its controller's Prometheus endpoint.

The cert-manager integration requires CXDOT Collector 1.4.0 or greater.

[cert-manager](https://cert-manager.io/) manages TLS certificates in Kubernetes. Use the
cert-manager integration with the
[CXDOT Collector](https://docs-xcor.paloaltonetworks.com/ingest/xcor/integrations/collector)
to collect certificate lifecycle and controller activity metrics.

The cert-manager integration supports cert-manager version 1.21.1 or later.

## Supported telemetry types

The cert-manager integration supports these telemetry types:

| Type | Supported |
| - | - |
| Logs | No |
| Metrics | Yes |
| Traces | No |
| Events | No |

## Prerequisites

Meet these requirements before configuring the integration:

* Expose each controller's
  [Prometheus metrics endpoint](https://cert-manager.io/docs/devops-tips/prometheus-metrics/)
  at `/metrics`.
* For controller pods, allow the node Collector to connect to the pods.
* For Services or static targets, allow the cluster Collector to connect to each
  target.

## Configure

The cert-manager integration is enabled by default. You can configure targets either by
annotating controller pods in your Kubernetes cluster or by listing static endpoints in
your Helm values. To configure the cert-manager integration, follow these steps:

1. To collect from cert-manager controller pods in Kubernetes, add a CXDOT integration
   annotation to the pod template. The annotation key must end with the container name.
   For example, add the following annotation to your cert-manager controller Deployment:

   ```yaml theme={null}
   spec:
     template:
       metadata:
         annotations:
           integrations.cxdot.paloaltonetworks.com/cert-manager-controller: |
             schema_version: v1.14
             cert_manager:
               endpoints:
                 - endpoint: ${target.host}:${target.port.http-metrics}
       spec:
         containers:
           - name: cert-manager-controller
             image: quay.io/jetstack/cert-manager-controller:v1.21.1
             ports:
               - name: http-metrics
                 containerPort: 9402
   ```

   The Collector replaces `${target.host}` with the pod IP address and
   `${target.port.http-metrics}` with the container port named `http-metrics`.

   The Collector also discovers controller pods that carry the
   `app.kubernetes.io/name: cert-manager` and `app.kubernetes.io/component: controller`
   labels and listen on port `9402`. A CXDOT integration annotation takes precedence over
   the labels for its container. To stop collecting from a container, set
   `cert_manager: {enabled: false}` in the annotation. For more information, see
   [autodiscovery](https://docs-xcor.paloaltonetworks.com/ingest/xcor/collector/discover/kubernetes.md).

2. Optional: To collect from specific cert-manager endpoints, configure static
   targets by listing their `host:port` values in `endpoints`. The instance then scrapes
   only those targets. For example:

   ```yaml theme={null}
   collection:
     cxdot:
       integrations:
         cert_manager:
           endpoints:
             - endpoint: 10.0.0.5:9402
   ```

   Each static target resolves to `http://<host>:<port>/metrics`.

3. Optional: To combine annotated pods and static targets, configure separate
   instances. The bare `cert_manager` key discovers pods, and the named instance scrapes
   the static targets:

   ```yaml theme={null}
   collection:
     cxdot:
       integrations:
         cert_manager: {}
         cert_manager/static:
           endpoints:
             - endpoint: 10.0.0.5:9402
   ```

### Validate

1. In the
   [Live Telemetry Analyzer](https://docs-xcor.paloaltonetworks.com/investigate/analyze/telemetry-analyzer.md),
   add the following label filters:

   * Set **Label** to `__name__` and **Value** to
     `cxdot.integration.target.health`.
   * Set **Label** to `cxdot.integration.name` and **Value** to `cert_manager`.

   Group the results by `cxdot.integration.target`, and confirm that the metric
   reports `1` for each target.

2. In
   [Metrics Explorer](https://docs-xcor.paloaltonetworks.com/investigate/querying/metrics/explorer.md),
   run the following query:

   ```text theme={null}
   max by ("certmanager.name", "k8s.namespace.name", "certmanager.condition") ({"certmanager.certificate.ready"})
   ```

   Confirm that the query returns a time series for each certificate condition.

## Disable the cert-manager integration

Deleting every `cert_manager` block restores the default unnamed instance. To remove
custom settings and stop collection, retain a disabled configuration:

```yaml theme={null}
collection:
  cxdot:
    integrations:
      cert_manager:
        enabled: false
```

## Configuration reference

Configure one cert-manager integration instance with the following settings. In Helm values,
place these settings under `collection.cxdot.integrations.cert_manager`. In a Collector
configuration file, place them under `cxdot.integrations.cert_manager`.

### Optional settings

* **`enabled`**
  Type: `boolean`. Optional. Default: `true`.
  Whether to enable this cert-manager integration instance. If true, the Collector runs the
  instance. If false, the Collector doesn't run it.

* **`endpoints`**
  Type: `array of object`. Optional. Default: `[]`.
  Targets for cert-manager. Specify each target as `host:port`. The Collector requests
  `http://<host>:<port>/metrics`.

* **`endpoints[].endpoint`**
  Type: `string`. Required.
  cert-manager target in `host:port` format.

* **`collection_interval`**
  Type: `duration`. Optional. Default: `60s`.
  How often the Collector collects metrics from each cert-manager target.

* **`timeout`**
  Type: `duration`. Optional. Default: `60s`.
  Maximum time allowed to collect metrics from one cert-manager target. The value must not
  exceed `collection_interval`.


## Related topics

- [CXDOT Collector integrations](https://docs-xcor.paloaltonetworks.com/ingest/xcor/integrations/collector.md)
- [Apache Spark](https://docs-xcor.paloaltonetworks.com/ingest/xcor/integrations/collector/spark.md)
- [Ingest Google Cloud logs](https://docs-xcor.paloaltonetworks.com/ingest/xcor/integrations/server/gcp/logs.md)
- [Differences between the Prometheus Operator and Chronosphere Collector](https://docs-xcor.paloaltonetworks.com/ingest/metrics-traces/collector/mappings/prometheus/operator-collector.md)
- [Upgrade Palo Alto Networks Telemetry Pipeline](https://docs-xcor.paloaltonetworks.com/ingest/pipeline/v2/install/upgrade.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.