Logging and Monitoring

This document explains the logs generated by HCL Link and Kubernetes, how to retrieve them, and the built-in monitoring tools in Link.

  1. Locating and Retrieving Logs

    Logs are the main source for troubleshooting. HCL Link generates logs in its pods, and Kubernetes logs provide system-level context.

    HCL Link Application Logs

    Each Link component runs in a separate pod and writes logs to stdout/stderr. These logs help debug application issues:
    • Client (lnk-client pod): Logs for web interface, user sessions, and API calls from the UI.
    • Server (lnk-server pod): Core server logs, including authentication, project management, and coordination.
    • Rest (lnk-rest pod): Logs for the REST API, handling map executions and API requests.
    • Executor (lnk-executor pod): Critical logs for data transformations. Includes map execution traces, C++ errors, and JVM messages for workflows.

    Kubernetes System Logs & Events

    These logs show the environment your application runs in:

    • Pod Events: Shows pod state (Pending, Running, Failed) and errors like OOMKills, node failures, PVC issues, or image pull errors.
    • Kubelet Logs: Node-level logs useful for pod start or runtime issues.
    • Control Plane Logs: Logs from components like api-server and scheduler. Managed by cluster admins for cluster-level issues.
  2. Tools for Monitoring and Retrieving Logs
    You can use CLI commands and dashboards to monitor HCL Link.
    Table 1.
    Command Purpose Example
    kubectl logs <pod-name> Retrieve the current logs from a pod. kubectl logs lnk-executor-12345
    kubectl logs -f <pod-name> Stream logs from a pod in real-time ("follow"). kubectl logs -f lnk-server-67890
    kubectl logs --previous <pod-name> Get logs from a previous instance of a pod (for example after it crashed and restarted). kubectl logs --previous lnk-executor-12345
    kubectl describe pod <pod-name> Essential for troubleshooting. Shows a pod's full configuration, status, and its Pod Events log at the bottom. kubectl describe pod lnk-rest-abcde
    kubectl get events --sort-by=.lastTimestamp View all recent events in the namespace to see a high-level overview of cluster activity. kubectl get events -n <your-namespace>
    kubectl top pod <pod-name> Check the current CPU and memory usage of a specific pod. Requires the metrics-server to be installed. kubectl top pod lnk-executor-12345

    Linux Commands

    You can combine kubectl with Linux commands to analyze logs:
    • Grep (Filter):Find specific error messages.
      kubectl logs lnk-executor-12345 | grep "ERROR"
    • Tail (Last lines):View only the last 100 lines of a log.
      kubectl logs lnk-executor-12345 | tail -n 100
    UI Dashboards
    • Kubernetes Dashboard: Web UI to inspect pods, view resource usage, and read logs.
    • Centralized Logging (EFK/Loki): Collects logs from all pods into Elasticsearch/Kibana or Loki/Grafana for searching, filtering, and visualization. Useful for tracing requests across pods.
  3. HCL Link Flow Dashboard

    The Flow Dashboard is built into the Link web interface. It monitors application-level behavior, not infrastructure.

    Features:

    • Flow Execution Status: Lists running, completed, and failed flows in real-time.

    • Error Reporting: Shows high-level error messages to identify failures caused by data, map logic, or connections.

    • Performance Metrics: Displays execution time, records processed, and throughput to detect slow maps or bottlenecks.

    • Execution History: Historical logs for auditing and trend analysis.

    kubectl and Grafana checks the pod health (for example memory usage). The Flow Dashboard checks business logic health (for example daily invoice-processing flow failures).