About Exposing TimesTen Metrics

The TimesTen Operator supports the TimesTen exporter, providing the ability for TimesTen databases deployed in your Kubernetes cluster to have TimesTen metrics exported. In addition, the Prometheus Operator configures and stands up Prometheus servers and creates and manages configuration files associated with these Prometheus servers. However, there are additional tasks that Prometheus requires to scrape TimesTen metrics.

For example:
  • If you are using https to serve TimesTen metrics, an Oracle Wallet and certificates must be created.

  • The certificates must be made available to Prometheus.

  • Prometheus configuration files must be edited to cause Prometheus to scrape metrics from TimesTen. This is true whether TimesTen metrics are served using https or http.

Let's look at these tasks, examine our options for completing these tasks, and discuss how the TimesTen Operator can automatically perform these tasks for you.

Startung with TimesTen release 22.1, the TimesTen Operator automatically exports and exposes TimesTen metrics. In addition, if the Prometheus Operator is installed in your Kubernetes cluster, the TimesTen Operator provides Prometheus with all the information it needs to scrape TimesTen metrics from TimesTen databases.

Let's look at how the TimesTen Operator does this.

By default, the TimesTen Operator does the following:
  • Exports and exposes TimesTen metrics from TimesTen databases deployed in your Kubernetes cluster.

  • Uses https/Transport Layer Security (mutual TLS) to make these metrics available.

  • If the Prometheus Operator is installed, creates the necessary objects to cause Prometheus to be automatically modified, which then causes Prometheus to scrape TimesTen metrics from the TimesTen databases.

  • Exposes TimesTen metrics outside of the TimesTen Pods.

Although this default behavior is recommended, you have the option of changing the default behavior. Let's examine our options:

  • https or http?: TimesTen metrics are available by https (default) or http.

  • Create a Kubernetes PodMonitor object?: If the Prometheus Operator is installed in your Kubernetes cluster, the TimesTen Operator can create a PodMonitor object. This object contains the information needed by the Prometheus Operator to configure TimesTen databases as a scrape target. If the Prometheus Operator has been installed in your Kubernetes cluster, then by default the TimesTen Operator attempts to create a PodMonitor object.

  • Expose TimesTen metrics outside of the TimesTen Pods?: The TimesTen exporter listens on and accepts GETs on the sampleobject.mynamespace.svc.cluster.local:8080/metrics endpoint (where sampleobject is the name of a TimesTenClassic or TimesTenScaleout object and mynamespace is the name of your namespace). By default, the TimesTen Operator deploys a Kubernetes Service that makes this endpoint available to other Pods in the Kubernetes cluster.

Note:

Having the TimesTen Operator automatically expose TimesTen metrics is not available in TimesTen release 18.1. This functionality is available in TimesTen release 22.1 and above.

Now let's look at how we can change this default behavior.

A TimesTenClassic or TimesTenScaleout object that is deployed in your namespace has specific datum associated with the object. These datum define the characteristics of a TimesTenClassic or TimesTenScaleout object, including the TimesTen databases associated with the object. You have the option of customizing a TimesTenClassic or TimesTenScaleout object by specifying values for particular datum in the object's YAML manifest file.

For exposing TimesTen metrics, the TimesTen Operator provides the .spec.ttspec.prometheus datum/clause and provides specific datum for use within this clause. This clause and its associated datum determine if and how the TimesTen Operator exports and exposes TimesTen metrics.

Let's look at the specific datum in the .spec.ttspec.prometheus clause in greater detail:
  • .spec.ttspec.prometheus.publish: Determines if the TimesTen Operator provisions an exporter container for the TimesTen exporter. The default is true. We discuss this in About Choosing to Expose TimesTen Metrics.

  • .spec.ttspec.prometheus.insecure: Determines if TimesTen metrics are served using https or http. If the value is false or not specified, TimesTen metrics are served using https. If the value is true, TimesTen metrics are served using http. For more information, see About Using http or https for TimesTen Metrics.

  • .spec.ttspec.prometheus.certSecret: If specified, contains a Kubernetes Secret that you have previously created. This Secret contains an Oracle Wallet and the necessary certificates for https. If not specified, the TimesTen Operator automatically creates an Oracle Wallet, the necessary certificates, and the Kubernetes Secrets.

    We recommend that you do not specify .spec.ttspec.prometheus.certSecret and instead let the TimesTen Operator automate this process for you. For more information, see About Transport Layer Security (mutual TLS) Certificates for TimesTen Metrics. If you want to specify .spec.ttspec.prometheus.certSecret, see Create Your Own Oracle Wallet, Certificates, and Secrets for Exposing TimesTen Metrics.

  • .spec.ttspec.prometheus.createPodMonitors: Determines if the TimesTen Operator should create a PodMonitor object. The default is true. We discuss this in About Creating PodMonitor Objects.

For additional information about .spec.ttspec.prometheus and its associated datum, see TimesTenClassicSpecSpecPrometheus for a TimesTenClassic object and TimesTenScaleoutSpecSpecPrometheus for a TimesTen Scaleout object.