About Creating PodMonitor Objects

By default, if the Prometheus Operator has been installed in your Kubernetes cluster, the TimesTen Operator automatically creates PodMonitor objects when it provisions TimesTen in your namespace. Specifically, the TimesTen Operator automatically creates a PodMonitor object for each deployed TimesTenClassic or TimesTenScaleout object.

This automates all of the steps required to get TimesTen metrics into Prometheus. As TimesTen objects are created and deleted, the appropriate scrape targets are automatically provisioned and removed from the Prometheus configuration without any intervention by you.

Although recommended, this is an optional capability. If you choose not to use the Prometheus Operator, you can export TimesTen metrics into Prometheus yourself. The Prometheus Operator is not a prerequisite for using the TimesTen Operator.

If you have installed the Prometheus Operator and you do not want the TimesTen Operator to automatically create PodMonitor objects, set the .spec.ttspec.prometheus.createPodMonitors datum of your TimesTenClassic or TimesTenScaleout object to false.

This capability is available whether a TimesTenClassic or TimesTenScaleout object is using http or https. It is also available with TimesTen Operator-created certificates and Secrets.

However, this capability is not available if you specify the .spec.ttspec.prometheus.certSecret datum in a TimesTenClassic or TimesTenScaleout object definition. If you provide your own Kubernetes Secret that contains your own Oracle Wallet (and this Oracle Wallet contains the necessary certificates for using https), the TimesTen Operator cannot automatically produce a PodMonitor object with sufficient information to allow Prometheus to access TimesTen. In this case, you must create your own PodMonitor objects, or otherwise edit Prometheus configuration files to access TimesTen and have TimesTen metrics scraped.

If the TimesTen Operator attempts to create a PodMonitor object and is unable to do so, the TimesTen Operator generates an appropriate Event and continues on with provisioning and other normal operations. This can happen if the Prometheus Operator is not installed in your Kubernetes cluster or if the TimesTen Operator has not been granted appropriate role-based access control (RBAC) privileges in your Kubernetes cluster. For more information about RBAC privileges, see https://kubernetes.io/docs/reference/access-authn-authz/rbac/.

A PodMonitor object created by the TimesTen Operator has an owner reference to the appropriate TimesTenClassic or TimesTenScaleout object. This ensures that the PodMonitor object is automatically deleted if the TimesTenClassic or TimesTenScaleout object is deleted.

Note:

The .spec.ttspec.prometheus.createPodMonitors datum can be added to new TimesTenClassic and TimesTenScaleout objects, but cannot be added to existing TimesTenClassic and TimesTenScaleout objects (by using the kubectl upgrade or the kubectl patch commands or by other means).

For more information about PodMonitor objects, see https://prometheus-operator.dev/docs/operator/design/#podmonitor.