Dozzle

repository·master·Indexed 11 days ago

https://github.com/amir20/dozzle

A lightweight, web-based real-time Docker log monitoring application designed for live viewing. It supports Docker Swarm, Podman, and Agent Mode for monitoring multiple hosts. Key features include container lifecycle actions (start, stop, restart, remove, update), log and metric alerts with webhook notifications for Slack, Discord, and ntfy, and remote Docker host connectivity.

Tokens
37.6K
Snippets
124
Records
181
Agent score
95%

What's inside Dozzle

  1. Overview of Dozzle Cloud features

    master

    Dozzle Cloud is an optional managed companion to self-hosted Dozzle. It provides several advanced observability and automation features:

    • Log Summaries: Uses LLMs to batch and summarize container events, including severity and source.
    • Pattern Clustering: Groups repeated errors into single notifications to prevent alert fatigue.
    • AI Agent: A chat-based agent (available in Telegram and Discord) that answers questions about container state. On Pro/Team plans, it can perform container actions like start, stop, or restart.
    • Daily Digests: Scheduled email summaries of activity, error patterns, and health.
    • Multi-Instance Dashboard: A single view to manage multiple linked Dozzle instances.
    • Full-Text Log Search: A high-speed search index across all linked instances, allowing queries by container, severity, or time range. Retention varies by plan (24 hours to 30 days).
  2. Overview of Dozzle features

    master

    Dozzle is a lightweight, open-source log viewer designed for Docker, Swarm, and Kubernetes. It allows you to stream container logs in real-time, monitor live resource metrics (CPU, memory, network), and debug containers directly from your browser.

    Key capabilities include:

    • Real-time Logs: Stream, search, and filter logs across containers.
    • Live Stats & Metrics: View rolling history charts for container resource usage.
    • SQL Log Analysis: Query logs using full SQL via DuckDB and WebAssembly running in the browser.
    • Alerts & Webhooks: Set up pattern matching to trigger notifications to Slack, Discord, ntfy, or custom webhooks.
    • Multi-host & Swarm Support: Connect to multiple Docker hosts and Swarm clusters using TLS agents.
    • Shell & Exec Access: Attach to containers or execute commands from the browser.
    • MCP Support: Expose container data and logs via the Model Context Protocol for AI assistants.
    • Self-hosted Security: Deploy on your own infrastructure with support for simple or forward-proxy authentication.
  3. Overview of Dozzle features and capabilities

    master

    Dozzle is a lightweight, web-based log viewer for monitoring and debugging containerized applications. It is designed to work across Docker, Docker Swarm, and Kubernetes environments.

    Core Capabilities:

    • Real-time Monitoring: Stream logs with instant updates and view live CPU, memory, and network metrics with historical visualizations.
    • Flexible Deployment: Can be deployed as a standalone server, in Docker Swarm, in Kubernetes, or using remote agents for multi-host support.
    • Advanced Log Handling: Supports automatic JSON detection, color coding, multi-line stack-trace grouping, log filters, and an embedded SQL engine for ad-hoc queries.
    • Interactive Terminal: Allows users to attach to or exec into running containers directly from the browser.
    • Container Actions: Provides UI controls to start, stop, restart, and update containers.
    • Alerts & Webhooks: Supports defining log patterns to trigger notifications to external services like Slack, Discord, and email.
    • Authentication: Supports open access or layered authentication via simple or forward-proxy auth with role-based access control.
    • Performance: Built with a Go backend and Vue 3 frontend, utilizing SSE (Server-Sent Events) and WebSockets for streaming with a minimal resource footprint.
  4. What is dtop?

    master

    dtop is a command-line companion to Dozzle designed to provide a real-time terminal view of Docker containers running on your system. It acts as a richer alternative to docker ps that can be kept open in a terminal multiplexer like tmux.

    Key characteristics:

    • Real-time monitoring: Provides a live view of containers.
    • Dozzle Integration: Allows jumping from the terminal view directly into the Dozzle web UI for full log history, search, and charts.
    • Multi-host support: Connects to Docker hosts via ssh, tcp, or a local unix socket.
  5. How Dozzle Deployments work

    master

    Dozzle Deployments allow you to manage Docker Compose projects on hosts connected to Dozzle Cloud. Each project is treated as a standalone git-backed repository on disk, providing version control for your infrastructure.

    Workflow:

    1. Dozzle creates a directory at ./data/stacks/{project}.
    2. It writes your compose.yaml and commits it to a local git repository.
    3. It executes Docker Compose to start the project.
    4. Subsequent updates commit new versions, allowing you to view history and roll back to any previous revision.

    Constraints:

    • Project names must follow the pattern [a-z0-9][a-z0-9_-]* (lowercase letters, digits, dashes, and underscores).
    • Deployments require a local Docker daemon; they are not supported in Kubernetes mode.
  6. How Dozzle Alerts work: Container and Trigger Expressions

    master

    An alert in Dozzle consists of two parts: a container expression (which containers to watch) and a trigger expression (the condition that fires the alert).

    Container Expressions

    Used to select target containers. Supported properties:

    • name (string): e.g., name contains "api"
    • image (string): e.g., image == "nginx:latest"
    • state (string): e.g., state == "running"
    • health (string): e.g., health == "unhealthy"
    • hostName (string): e.g., hostName == "prod-host"
    • labels (map): e.g., labels["env"] == "production"

    Logical operators: && (AND), || (OR), and ! (NOT). Example: name contains "api" && labels["env"] == "production"

    Alert Types

    1. Log Alerts: Triggers on log messages matching a pattern.
    2. Metric Alerts: Triggers when CPU or memory crosses a threshold (uses a smoothed average over a sample window).
    3. Event Alerts: Triggers on Docker container lifecycle events (e.g., die, oom, start).
  7. Configure Reverse Proxy Requirements for Dozzle

    master

    Dozzle relies on Server-Sent Events (SSE) for log streaming and WebSockets for container shells. To ensure these features work correctly, your reverse proxy must meet these three requirements:

    1. Disable response buffering: SSE requires events to be delivered immediately. Buffering will cause logs to arrive in bursts or not at all. While Dozzle sends X-Accel-Buffering: no, some proxies may ignore this and require manual configuration.
    2. Forward WebSocket upgrade headers: Necessary for the shell and attach features to function.
    3. Avoid compressing text/event-stream: Compression middleware often breaks the SSE stream.
  8. How Swarm Mode works in Dozzle

    master

    Dozzle supports Docker Swarm Mode (starting from version 8) to automatically discover services and custom groups.

    Key Concepts:

    • Grouping Logic: Dozzle does not use the Swarm API directly due to limitations. Instead, it implements its own grouping using swarm labels:
      • com.docker.stack.namespace and com.docker.compose.project are used for grouping containers into stacks/projects.
      • com.docker.swarm.service.name is used to group containers by service name.
    • Mesh Network: When deployed in Swarm Mode, Dozzle creates a secured mesh network between all nodes using mTLS with a private TLS certificate. This allows Dozzle instances to communicate securely and encrypted.
    • Stats Merging: Dozzle merges stats for containers within the same group, allowing you to view logs and stats for an entire group in a single view.
    • Deployment Requirement: Because of how grouping and communication work, every host in the swarm must be set up with a Dozzle instance.
  9. Configure hostnames for Multi-Host and Agents

    master

    In a multi-host or agent-based setup, each agent advertises its own name. To ensure agents are distinguishable in the multi-host menu, you must set a unique DOZZLE_HOSTNAME (or use the --hostname flag) on each individual agent.

    In Swarm Mode, where each node runs its own agent, providing a distinct hostname to each node is required to tell them apart in the UI.

  10. How UI, Agent, and User filters interact

    master

    Dozzle applies filters at three different levels. When multiple filters are defined across these levels, they are combined (intersected) to restrict the visible containers. For example, if a UI filter requires label=color and an Agent filter requires label=type, Dozzle will only show containers that possess both labels.

    Filter Levels

    1. UI Filters: Applied to the Dozzle UI instance. These affect all agents and users unless the user has their own specific filters defined.
    2. Agent Filters: Set at the agent level to limit the containers exposed by that specific agent. These work in conjunction with UI filters.
    3. User Filters: Set at the user level to determine which containers a specific user can see. If no user filters are defined, the user defaults to the UI filters.
  11. Understand what data is collected by Dozzle analytics

    master

    Dozzle's analytics collection is designed to be anonymous and lightweight.

    Collected Data includes:

    • Dozzle version
    • Deployment mode (e.g., server, swarm, k8s, agent)
    • Enabled authentication providers
    • Feature flags
    • Docker Engine version
    • Small counts (number of hosts, containers, filters)
    • A random per-install ID for deduplication

    Data NOT collected:

    • Log contents
    • Container names
    • Image names
    • IP addresses
    • User identifiers

    Events are sent to https://b.dozzle.dev/event.

  12. How Dozzle Profile Loading Works

    master

    Dozzle follows a specific hierarchy when loading user preferences:

    1. Authenticated Users: Dozzle reads /data/<username>/profile.json.
    2. Anonymous/Unauthenticated Users: Dozzle reads /data/__default__/profile.json.

    Persistence Behavior:

    • When a user changes a setting in the UI, the value is saved to their specific username profile.
    • In unauthenticated deployments, changes made by anonymous users are saved back into the __default__ profile.

    Tip for Seeding Defaults: If you want to provide a template but prevent anonymous users from permanently modifying the __default__ profile, mount the /data/__default__/profile.json file as read-only. The UI will still function, but Dozzle will be unable to persist changes to that file.