|
| 1 | +--- |
| 2 | +title: Log Streaming in Kanvas |
| 3 | +weight: 5 |
| 4 | +description: > |
| 5 | + Learn about Log Streaming in Operator mode |
| 6 | +categories: [Operator] |
| 7 | +--- |
| 8 | + |
| 9 | +# Log Streaming in Kanvas |
| 10 | + |
| 11 | +Efficient troubleshooting requires immediate visibility into your application's behavior. The **Log Streamer** in Kanvas allows you to live-tail logs from your Kubernetes pods and containers directly within the visual topology. Unlike static log files, this feature provides a real-time, multiplexed view of your infrastructure's activities, enabling you to debug interactions between services without leaving the Kanvas interface. |
| 12 | + |
| 13 | +## Overview |
| 14 | + |
| 15 | +Kanvas Log Streaming is part of the **Operator** mode (Visualizer). It establishes a persistent, low-latency connection to your cluster resources, allowing you to stream `stdout` and `stderr` logs from one or multiple pods simultaneously. |
| 16 | + |
| 17 | +### Key Features |
| 18 | + |
| 19 | +* **Real-time Tailing:** Watch logs generation instantly as events occur in your cluster. |
| 20 | +* **Multi-Pod Streaming:** Stream logs from a single specific pod or multiplex logs from several pods at once to correlate events across different services. |
| 21 | +* **Keyword Filtering:** Apply search filters to the log stream to isolate specific error codes, transaction IDs, or warning messages. |
| 22 | +* **Playback Controls:** Interactive controls to **Play**, **Pause**, **Stop**, and **Clear** the stream, giving you control over the flow of information during high-volume events. |
| 23 | + |
| 24 | +## How to Access Log Streaming |
| 25 | + |
| 26 | +To utilize the Log Streamer, ensure you are in **Operator Mode** and have a connected Kubernetes cluster with MeshSync active. |
| 27 | + |
| 28 | +1. **Navigate to Visualizer:** Open Kanvas and toggle to **Operator** mode (Visualizer) to view your running cluster topology. |
| 29 | +2. **Select a Resource:** Click on a **Pod** or **Deployment** node within your design. |
| 30 | +3. **Open the Log Stream:** |
| 31 | + * **Via Context Menu:** Right-click the node and select **Stream Logs** from the context menu. |
| 32 | + * **Via Details Panel:** With the node selected, expand the bottom panel or the **Details** drawer. Locate the **Log Stream** tab next to the Terminal and Performance tabs. |
| 33 | + |
| 34 | +## Using the Interface |
| 35 | + |
| 36 | +Once the stream is active, the Log Streamer panel will display the output. |
| 37 | + |
| 38 | +* **Search/Filter:** Use the search bar within the panel to highlight or filter lines containing specific strings (e.g., `Error`, `Exception`, or specific request IDs). |
| 39 | +* **Toggle State:** Use the toggle switches to pause the live feed to inspect a specific log line without losing your place, then resume to catch up with the live tail. |
| 40 | +* **Copy Logs:** Use the copy function to capture the current log buffer to your clipboard for external analysis or ticket submission. |
| 41 | + |
| 42 | +## Use Cases and Examples |
| 43 | + |
| 44 | +### 1. Troubleshooting CrashLoopBackOff |
| 45 | + |
| 46 | +**Scenario:** A newly deployed pod is failing to start, entering a `CrashLoopBackOff` state. |
| 47 | +**Action:** Select the failing pod in Kanvas. The Log Streamer immediately captures the container's startup output. |
| 48 | +**Benefit:** You can instantly see the specific runtime error or missing environment variable causing the crash without manually running `kubectl logs -f` commands in a separate terminal window. |
| 49 | + |
| 50 | +### 2. Correlating Microservice Interactions |
| 51 | + |
| 52 | +**Scenario:** A frontend service is returning a 500 error, but the issue likely originates in a backend dependency. |
| 53 | +**Action:** Multi-select both the Frontend Pod and the Backend Pod in the visualizer and activate log streaming. |
| 54 | +**Benefit:** Kanvas multiplexes the streams. You can watch the request leave the frontend and fail at the backend in a single view, allowing you to pinpoint exactly where the transaction breaks. |
| 55 | + |
| 56 | +### 3. Monitoring Real-time Traffic Patterns |
| 57 | + |
| 58 | +**Scenario:** You have applied a new canary rollout pattern and want to verify traffic distribution. |
| 59 | +**Action:** Stream logs from the new version of your deployment while filtering for specific traffic headers or successful HTTP 200 codes. |
| 60 | +**Benefit:** Visually verify that the application logic is processing requests as expected during the deployment window. |
| 61 | + |
| 62 | +## Technical Note |
| 63 | + |
| 64 | +The Log Streamer utilizes a robust architecture where the **Meshery Operator** signals the **MeshSync** controller to start the log flow. Data is streamed using **NATS** to the Meshery Broker, preprocessed, and then delivered to your browser via a **WebSocket** connection using GraphQL subscriptions. This ensures minimal latency and high performance, even when streaming data from multiple active containers. |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +*** |
| 69 | + |
| 70 | +### See Also |
| 71 | + |
| 72 | +* **[Interactive Terminal](/kanvas/terminal):** Learn how to establish an interactive shell session with your containers. |
| 73 | +* **[Performance Management](/kanvas/performance):** Run ad-hoc performance tests alongside your log monitoring. |
0 commit comments