Log Streaming
Categories:
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.
Overview π
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.
Key Features π
- Real-time Tailing: Watch log generation instantly as events occur in your cluster.
- Multi-Pod Streaming: Stream logs from a single specific pod or multiplex logs from several pods at once to correlate events across different services.
- Keyword Filtering: Apply search filters to the log stream to isolate specific error codes, transaction IDs, or warning messages.
- Playback Controls: Interactive controls to Play, Pause, Stop, and Clear the stream, giving you control over the flow of information during high-volume events.
How to Access Log Streaming π
To utilize the Log Streamer, ensure you are in Operator Mode and have a connected Kubernetes cluster with MeshSync active.
- Navigate to Visualizer: Open Kanvas and toggle to Operator mode (Visualizer) to view your running cluster topology.
- Select a Resource: Click on a Pod or Deployment node within your design.
- Open the Log Stream:
- Via Context Menu: Right-click the node and select Stream Logs from the context menu.
- 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.
Using the Interface π
Once the stream is active, the Log Streamer panel will display the output.
- 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). - Pause/Resume: Use the playback toggle to pause the live feed to inspect a specific log line without losing your place, then resume to catch up with the live tail.
- Copy Logs: Use the copy function to capture the current log buffer to your clipboard for external analysis or ticket submission.
Use Cases and Examples π
1. Troubleshooting CrashLoopBackOff π
Scenario: A newly deployed pod is failing to start, entering a CrashLoopBackOff state.
Action: Select the failing pod in Kanvas. The Log Streamer immediately captures the container’s startup output.
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.
2. Correlating Microservice Interactions π
Scenario: A frontend service is returning a 500 error, but the issue likely originates in a backend dependency. Action: Multi-select both the Frontend Pod and the Backend Pod in the visualizer and activate log streaming. 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.
3. Monitoring Real-time Traffic Patterns π
Scenario: You have applied a new canary rollout pattern and want to verify traffic distribution. Action: Stream logs from the new version of your deployment while filtering for specific traffic headers or successful HTTP 200 codes. Benefit: Visually verify that the application logic is processing requests as expected during the deployment window.
Technical Note π
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.
See Also π
- Interactive Terminal: Learn how to establish an interactive shell session with your containers.
- Performance Management: Run ad-hoc performance tests alongside your log monitoring.
Recent Discussions on Kanvas
- Jul 12 | Unleash Visual Power: Import Your Configs by zihan kuang
- Oct 14 | Explore Meshery's Published Relationship Design Examples by Awani Alero
- Oct 03 | Design Review RFC: Kanvas Empty State Enhancement by Lee Calcote
- Jul 19 | [For Discussion] Visual indication of semantically vs non-semantically meaningful Meshery components by Lee Calcote
- Jun 07 | What are the conditions for a "System is unhealthy" warning? by James
- May 30 | Looking for a meshmate to help with first PR by Faisal Imtiyaz123
- Feb 28 | For Discussion: Capturing potential, but unrealized Relationships in Design Snapshots by Lee Calcote
- Feb 12 | Hint on Scaling & Verifying Cronjob in Playground by Sandra Ashipala
