Metrics, logs, and auditing
to follow every change.
How metrics, operational interfaces, logs, events, and auditing combine to monitor TDP Kubernetes, investigate deviations, and guide the team's actions.
Observability means using the environment signals to understand its behavior.
A slower query in Trino, a growing queue in NiFi or a restarting Pod are starting points: correlating metrics, records and recent changes helps explain what is happening and choose how to act.
What the figure shows:
- Metrics: Prometheus endpoints in Trino, Argo CD, NiFi, ClickHouse and PostgreSQL. Metrics
- Logs: the output of each component's Pods, read by the log collector. Logs and events
- Interfaces: the web interfaces of Argo CD, Airflow, NiFi, Kafka UI, Trino, Spark, Ozone Recon and Ranger. Component interfaces
- Audit: Ranger writes the access audit to Solr, and the Ozone S3 Gateway records the S3 access audit. Access and audit trail
- Collection and display: the four signals are collected and displayed by the customer's cluster, with Prometheus, Grafana and a log collector. What TDP exposes and what the cluster collects
Monitor
The evolution of workloads, queues and executions shows the usual behavior of the environment.
Investigate
A deviation gains context when correlated with the logs, the Kubernetes events and the state of the components involved.
Verify recovery
After an intervention, the same signals show whether processing and service have recovered.
One signal for each question
Each source helps answer part of the investigation. The starting point is the symptom and the time interval in which it appeared.
| Question | Signals that help answer it |
|---|---|
| Did the load increase or did processing slow down? | Metrics over time and the state of queues and executions in the component interfaces. |
| What did the application record during the failure? | Logs of the container and of the affected task or query. |
| Why did the Pod fail to start or get restarted? | Pod state, Kubernetes events and logs of the previous execution. |
| What changed in the configuration delivered through GitOps? | Differences and synchronization state of the Application in Argo CD. |
| Who requested an operation on the data? | Service audit, such as the Ranger records. |
Topics on this page
- Metrics: the evolution of the environment
- What TDP exposes and what the cluster collects
- Component interfaces
- Logs and events in failure investigation
- Access and audit trail
- Alerts that guide an action
Metrics: the evolution of the environment
Metrics show how a measurement varies over time, helping compare the current load with previous periods and notice trends.
The metrics are exposed in the Prometheus format (OpenMetrics). The cluster can collect them with Prometheus, according to the flow below, or with another tool compatible with this format, such as VictoriaMetrics or OpenTelemetry Collector.
The flow with Prometheus has three stages:
- Expose: the component or an exporter publishes the metrics on an endpoint.
- Collect: Prometheus queries this endpoint periodically and stores the time series. With the Prometheus Operator, a
ServiceMonitordescribes the collection from selected Services. - Monitor and alert: the team uses the series in queries and dashboards of the monitoring solution and configures rules to signal conditions that require action.
The TDP Kubernetes charts offer the integration points below. The default and configuration indications refer to these charts. Collection, dashboards and alerts are organized in the monitoring infrastructure chosen for the environment.
Enabled by default (tdp-trino.jmx.enabled). Exposes the internal Trino metrics.
Enabled on the Argo CD server (tdp-argo.server.metrics).
The NiFi cluster is declared with a listener of type prometheus, whose port is defined in nifiCluster.listenersConfig.internalListeners.
The ClickHouse operator is installed with the Altinity metrics-exporter, which exposes the metrics of the ClickHouse clusters in Prometheus format.
Available through configuration (tdp-trino.jmx.exporter.enabled and tdp-trino.serviceMonitor.enabled). The exporter publishes the JMX metrics for collection. The ServiceMonitor configures discovery by the Prometheus Operator. These metrics can also feed worker scaling triggers in KEDA.
Available through configuration (tdp-postgresql.metrics.enabled).
Scenario: connect Trino to metrics collection
Situation: the platform team wants to monitor the load of the Trino cluster in Prometheus.
The cluster already has the Prometheus Operator and the ServiceMonitor CRD installed.
What TDP does: the Trino chart ships with JMX enabled and offers the JMX metrics exporter and the ServiceMonitor, turned on in this excerpt of the values file:
tdp-trino:
jmx:
enabled: true
exporter:
enabled: true
serviceMonitor:
enabled: true
Effect: the Trino metrics endpoint starts to appear among the Prometheus scrape targets.
For this to happen, the selectors and the discovery scope of the Prometheus instance must include this monitor.
References: Prometheus and collection with the Prometheus Operator.
Trino. How the metrics feed worker scaling: Scalability.
The workers' native HPA needs the cluster's resource metrics API (metrics.k8s.io, provided by metrics-server or, on OpenShift, by monitoring). The JMX/Prometheus collection in this example does not replace that API. Without it, the workers stay at server.workers and the HPA records FailedGetResourceMetric.
What TDP exposes and what the cluster collects
The components publish the signals. The cluster monitoring infrastructure collects, stores and presents them.
| Signal | What TDP Kubernetes exposes | What the cluster infrastructure provides |
|---|---|---|
| Metrics | Endpoints in Prometheus format: Argo CD, NiFi and ClickHouse by default. Trino, through the JMX metrics exporter, and PostgreSQL, through the metrics exporter, when configured. | Collection and storage of the time series, as in Prometheus; dashboards, as in Grafana; and alert rules with notification routing, as in Alertmanager. |
| Collection discovery | ServiceMonitor for Argo CD, enabled, and for Trino, when configured. | Prometheus Operator and the ServiceMonitor CRD. |
| Logs | The container output of each component. | Querying with kubectl logs and, to store and search the records over time, a log collection solution installed in the cluster. |
Component interfaces
The interfaces help move from the overview to the specific execution: the DAG that failed, the query that is waiting or the flow that accumulated data.
| What can be monitored | Where |
|---|---|
Synchronization (Synced, OutOfSync) and health (Healthy, Progressing, Degraded) of each component delivered through GitOps | Argo CD: web interface, per Application |
| DAG and task runs | Airflow: web interface |
| Data flows, queues and processors | NiFi: web interface |
| Topics, messages, consumer groups and basic cluster metrics | Kafka UI, enabled by default |
| Running and completed queries in the cluster | Trino: web interface |
| Workers and applications of the Spark cluster | Spark Master UI, with access to the worker and application interfaces through the Master address |
| Completed Spark applications | Spark History Server, off by default and available through configuration (spark.historyServer.enabled) |
| State of the object storage | Ozone Recon, enabled by default, and the Ozone Manager, SCM and S3 Gateway interfaces |
| User access to the protected services | Ranger Admin: audit query |
The Spark History Server shows the completed applications when event log writing is enabled and the drivers and the history server use the same directory, with spark.eventLog.enabled and spark.eventLog.dir.
This also applies to the drivers run by JupyterHub and Airflow.
Access to the interfaces from outside the cluster, through Ingress or Gateway API: External exposure. Event logs in S3 or in a persistent volume: History Server.
Logs and events in failure investigation
The logs show the container output. The Pod state and the Kubernetes events show what happened to it.
Together, this information correlates the error recorded by the application with occurrences such as a scheduling failure, an image download or a container termination.
# Recent events in the namespace, in chronological order
kubectl get events -n <NAMESPACE> --sort-by=.metadata.creationTimestamp
# State of a Pod and the events associated with it
kubectl describe pod <POD_NAME> -n <NAMESPACE>
# Logs from the last 30 minutes
kubectl logs <POD_NAME> -n <NAMESPACE> --since=30m
# Logs from the previous run, when the container restarted
kubectl logs <POD_NAME> -n <NAMESPACE> --previous
In Pods with multiple containers, the -c <CONTAINER_NAME> option selects which one to query.
The component labels also allow selecting a specific part of the environment:
# JupyterHub: Hub and proxy are separate
kubectl -n <NAMESPACE> logs -l app.kubernetes.io/component=hub
kubectl -n <NAMESPACE> logs -l app.kubernetes.io/component=proxy
# ClickHouse: Pods of one installation
kubectl -n <NAMESPACE> logs -l clickhouse.altinity.com/chi=<CHI_NAME>
The availability of the records during the investigation depends on the collection and retention configured in the environment's log solution.
In Airflow, the triggerer logs are kept in a persistent volume by default. Persistence of the other logs can be enabled with tdp-airflow.logs.persistence.enabled.
Reference: debugging Pods in Kubernetes.
Access and audit trail
When the investigation involves data access, the audit correlates identity, resource, operation and result.
The time of the occurrence and the service involved locate the records, which can be compared with the logs of the application that made the request.
Integrated services
Ranger audit
In the services protected by Ranger and with audit enabled, the access decisions are available in Ranger Admin. The TDP Kubernetes chart delivers this integration with a dedicated Solr and a persistent volume, and the policies it creates in the Kafka, NiFi and Trino integrations come with audit enabled.
Configurable
Audit history
The Solr volume size and StorageClass are sized according to the retention period of the records and the volume of events.
Ranger. Authorization and audit concepts: Security. Audit in Solr: Ranger in TDP Kubernetes.
Alerts that guide an action
A useful alert starts from a condition that represents an impact on operations, such as recurring task failures in Airflow, persistent data accumulation in the NiFi queues or the unavailability of a service.
Each alert defines the duration of the condition, the responsible team and the first investigation step.
As an example, in a solution with Prometheus, the rules evaluate the time series and Alertmanager groups and routes the notifications according to the adopted configuration.
Dashboards and rules are organized together with the monitoring infrastructure of the environment. Reference: Prometheus alerting flow.
The maintenance context also matters.
In the documented Trino configuration, the FailedPreStopHook event can appear during a successful graceful shutdown.
Correlated with the worker stop and the query results, it indicates this known behavior, and any alert exceptions can be restricted to it.
Details in High availability of the Trino workers.
Scenario: investigate slower queries
Situation: during a monthly close, the team notices that the Trino queries are taking longer.
What TDP does: the Trino web interface lists the running and completed queries, and the JMX metrics, when collected, show the resource usage of the workers in the same period.
The recent changes to the Argo CD Applications, the Pod events and the logs of the components involved, including dependencies such as the Hive Metastore and the S3 storage, complete the picture.
Effect: the team tells a configuration change apart from a failure and chooses the adjustment, which can concern capacity, configuration or the queries themselves. The same signals confirm the recovery.
Relationship between sizing and the observed signals: Scalability.