Skip to content

YAML ➤ Lens Dashboard Compiler

Convert human-friendly YAML dashboard definitions into Kibana NDJSON format.

The Chameleon mascot

This tool simplifies the process of creating and managing Kibana dashboards by allowing you to define them in a clean, maintainable YAML format instead of hand-crafting complex JSON.

Getting Started

Best for interactive development - Live preview, visual editing, built-in snippets

No Python installation required! The extension includes a bundled LSP server binary.

Installation:

  1. Install the extension:
  2. Open VSX Registry (Cursor, VS Code forks): Search "Kibana Dashboard Compiler"
  3. Manual: Download .vsix from releases

  4. Create your first dashboard:

Create a new file called my-dashboard.yaml and add the following content:

dashboards:
- name: My First Dashboard
  description: A simple dashboard with markdown
  panels:
    - title: Hello Panel
      markdown:
        content: |
          # Hello, Kibana!

          This is my first markdown panel.
      size: {w: 24, h: 15}

Or use snippets: type dashboard and press Tab to insert a template.

  1. Preview your dashboard:
  2. Save the file (Ctrl+S) to auto-compile
  3. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  4. Run "YAML Dashboard: Preview Dashboard"

  5. Upload to Kibana:

  6. Configure Kibana URL in VS Code settings
  7. Run "YAML Dashboard: Open in Kibana"

Full guide: VS Code Extension Documentation


CLI (For Automation & Scripting)

Best for: CI/CD pipelines, batch processing, programmatic usage

Requirements: uv (recommended) or Python 3.12+

Installation: No clone or setup required! Run directly with uvx:

uvx kb-dashboard-cli compile --help

Your First Dashboard:

  1. Create inputs/my-dashboard.yaml:
dashboards:
- name: My First Dashboard
  description: A simple dashboard
  panels:
    - title: Welcome
      size: {w: 24, h: 15}
      markdown:
        content: |
          # Welcome to Kibana!
  1. Compile:
uvx kb-dashboard-cli compile --input-file inputs/my-dashboard.yaml
  1. Upload to Kibana:
uvx kb-dashboard-cli compile --input-file inputs/my-dashboard.yaml --upload --kibana-url http://localhost:5601

Full guide: CLI Documentation


Features

  • YAML-based Definition – Define dashboards, panels, filters, and queries in simple, readable YAML.
  • Kibana Integration – Compile to NDJSON format compatible with Kibana 8+.
  • Rich Panel Support – Support for Lens (metric, pie, XY charts), Markdown, Links, Image, and Search panels.
  • Color Palettes – Choose from color-blind safe, brand, and other built-in color palettes.
  • Interactive Controls – Add options lists, range sliders, and time sliders with chaining support.
  • Flexible Filtering – Use a comprehensive filter DSL (exists, phrase, range) or raw KQL/Lucene/ESQL queries.
  • Direct Upload – Compile and upload to Kibana in one step, with support for authentication and API keys.
  • Screenshot Export – Generate high-quality PNG screenshots of your dashboards programmatically.

More Examples

Lens Metric Panel

Here's a dashboard with a Lens metric panel displaying a count:

dashboards:
- name: Metric Dashboard
  description: A dashboard with a single metric panel
  panels:
    - title: Document Count
      type: lens
      size: {w: 24, h: 15}
      data_view: your-index-pattern-*
      chart:
        type: metric
        metrics:
          - type: count
            label: Total Documents

Programmatic Alternative

While this guide focuses on YAML, you can also create dashboards entirely in Python code. This approach offers:

  • Dynamic dashboard generation based on runtime data
  • Type safety with Pydantic models
  • Reusable dashboard templates and components
  • Integration with existing Python workflows

See the Programmatic Usage Guide for examples and patterns.

Next Steps

Enhance Your Workflow

User Guide

Reference documentation for YAML dashboard syntax:

Developer Guide

Advanced documentation for contributors and programmatic usage:

How It Works

graph TB
    YAML[YAML Definition]
    KIBANA[Kibana]

    subgraph "Interactive Development"
        EXT[VS Code Extension]
        EXT --> PREVIEW[Live Preview]
    end

    subgraph "Automation/CI"
        CLI[CLI Compiler]
        CLI --> NDJSON[NDJSON Files]
    end

    YAML --> EXT
    YAML --> CLI
    EXT --> KIBANA
    NDJSON --> KIBANA

License

MIT

Third-Party Content

Some example dashboards in packages/kb-dashboard-docs/content/examples/ are derived from the Elastic integrations repository and are licensed under the Elastic License 2.0. Specifically:

  • packages/kb-dashboard-docs/content/examples/system_otel/ - System monitoring dashboards for OpenTelemetry
  • packages/kb-dashboard-docs/content/examples/docker_otel/ - Docker container monitoring dashboards for OpenTelemetry

See licenses/README.md for the complete list of affected files.

Support

For issues and feature requests, please refer to the repository's issue tracker.