Cloud Native Experience Kubernetes Ready

CNE Kubernetes Ready: Observability and Telemetry

Kubernetes Ready deployments expose Prometheus-compatible metrics, container-native logs, and optional traces. The liferay-default Helm chart installs a JMX exporter as part of the Liferay JVM startup, so no external monitoring sidecars are required. Configure your existing Prometheus, Grafana, OpenTelemetry, and log aggregation stacks to ingest from the pods.

Metrics

The chart includes a jmx_prometheus_javaagent attached to the Liferay JVM. This agent exposes runtime metrics on a dedicated metrics endpoint to scrape directly from each pod.

No additional JMX exporter or sidecar is required.

The metrics endpoint is http://<pod-ip>:12345/metrics. Each pod exposes the agent on container port 12345, set via the JMX_AGENT_PORT environment variable.

The chart does NOT add the metrics port to the liferay-default Service, and does NOT add Prometheus pod annotations. Scrape the endpoint directly on each pod’s IP at port 12345 (see Scraping the Metrics Endpoint below). Autoscaling (HPA on CPU, or KEDA against Prometheus metrics) is configured separately in architecture-sizing-and-support-model.md.

Key Metrics

Monitor these core runtime metrics:

  • JVM memory usage (jvm_memory_bytes_used)
  • Garbage collection activity (jvm_gc_*)
  • Thread counts (jvm_threads_current)
  • Database connection pool (hikari_active_connections, hikari_idle_connections)
  • Tomcat session activity (tomcat_sessions_active_current)
  • Standard process-level metrics (process_*)

Scraping the Metrics Endpoint

Scrape the /metrics endpoint exposed by each Liferay pod to integrate your monitoring platform.

Because the chart does not expose port 12345 through the Service or via standard pod annotations, you must configure your scrape target explicitly. Two patterns work.

Verify the Endpoint

Confirm metrics are flowing before configuring a scrape target:

kubectl --namespace liferay port-forward pod/liferay-default-0 12345:12345
curl http://localhost:12345/metrics | head

The terminal displays Prometheus exposition lines (# HELP ..., # TYPE ..., sample values).

Prometheus-Based Ingestion

If your platform uses Prometheus Operator or a compatible distribution, use a PodMonitor to scrape the JMX agent’s container port directly:

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: liferay
  namespace: liferay

spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: liferay

  podMetricsEndpoints:
    - port: jmx-metrics
      path: /metrics
      interval: 30s

  podTargetLabels:
    - app.kubernetes.io/name

A PodMonitor is needed because the chart’s Service does not include the metrics port. The port: jmx-metrics reference requires that you expose the agent via the chart’s customPorts extension point. Add this to your values.yaml:

customPorts:
  - name: jmx-metrics
    containerPort: 12345
    protocol: TCP

A plain Prometheus installation can scrape Liferay using a kubernetes_sd_configs job that targets pods by label and overrides the scrape port:

- job_name: liferay
  kubernetes_sd_configs:
    - role: pod
      namespaces:
        names: [liferay]
  relabel_configs:
    - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_name]
      action: keep
      regex: liferay
    - source_labels: [__meta_kubernetes_pod_ip]
      target_label: __address__
      replacement: $1:12345

OpenTelemetry-Based Ingestion

Scrape from Kubernetes and export to your chosen backend to complete the ingestion pattern.

Logs

Liferay writes logs to standard output and error streams inside the container. Kubernetes collects these logs from the container runtime.

Pod, namespace, and deployment metadata correlate these logs.

Distributed Tracing (Optional)

Distributed tracing tracks request flows across multiple systems, such as the ingress, Liferay, database, and search engine.

Health Signals

Pod readiness, stable resource usage, and successful connectivity to external dependencies (including the database, search engine, and object storage) indicate system health.