Skip to main content

Linting rules for dashboard YAML configurations

Project description

kb-dashboard-lint

Linting rules for Kibana dashboard YAML configurations.

Overview

This package provides a configurable linting system that flags potentially problematic dashboard configurations based on best practices and style guidelines. It works with validated Pydantic models from kb-dashboard-core.

Installation

pip install kb-dashboard-lint

Or with uv:

uv add kb-dashboard-lint

Usage

CLI

# Check dashboards in a directory
kb-dashboard-lint check --input-dir ./inputs

# Check a single file
kb-dashboard-lint check --input-file dashboard.yaml

# Use custom configuration
kb-dashboard-lint check --config .dashboard-lint.yaml

# Only fail on errors (not warnings)
kb-dashboard-lint check --severity-threshold error

Programmatic API

from kb_dashboard_lint import check_dashboards
from kb_dashboard_core import load

# Load dashboards
dashboards = load('inputs/')

# Run linting
violations = check_dashboards(dashboards)

for violation in violations:
    print(f"{violation.severity}: {violation.rule_id} - {violation.message}")

Built-in Rules

Rule ID Description Default
dashboard-dataset-filter Dashboard should have a data_stream.dataset filter warning
datatable-row-density Large datatables should consider compact density info
dimension-missing-label Dimensions should have explicit labels info
esql-where-clause ES|QL queries should include a WHERE clause info
gauge-goal-without-max Gauges with goals should define maximum values warning
markdown-header-height Markdown panels with headers must have height >= 3 warning
metric-multiple-metrics-width Multi-metric panels need adequate width warning
metric-redundant-label Metric primary label matching title should use hide_title: true warning
panel-description-recommended Panels should have descriptions for accessibility info
panel-height-for-content Chart types have appropriate minimum heights warning
panel-min-width Panels should have minimum width for readability warning
pie-chart-dimension-count Multi-level pie charts may be hard to read info

Configuration

Create a .dashboard-lint.yaml file:

extends: default

rules:
  markdown-header-height:
    severity: error
  esql-where-clause:
    enabled: false

Development

# Install dependencies
make install

# Run CI checks
make ci

# Run tests
make test

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kb_dashboard_lint-0.2.3.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kb_dashboard_lint-0.2.3-py3-none-any.whl (62.4 kB view details)

Uploaded Python 3

File details

Details for the file kb_dashboard_lint-0.2.3.tar.gz.

File metadata

  • Download URL: kb_dashboard_lint-0.2.3.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for kb_dashboard_lint-0.2.3.tar.gz
Algorithm Hash digest
SHA256 84b5dd3e087e11c69cf2f9b5822420069302bf23c6c3b78d3b46767ba0124a11
MD5 dbe67b180e6ab57c49e0d5bc3d0656b6
BLAKE2b-256 5148c54e3b07ea21f0b9066d836f95a0f427da5f97bbab107378ee12778f1cbf

See more details on using hashes here.

File details

Details for the file kb_dashboard_lint-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: kb_dashboard_lint-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 62.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for kb_dashboard_lint-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 158acdda3fac9eeebb8c040e60ebca186a0cb6c3eda3002e1cb3af6cf7cbadba
MD5 551c4d43d5aace67caf308952d7bd5d9
BLAKE2b-256 168eb3d9c9fc43b674f0710c763c70cfeff74b9533acd2539f51655a59988fb1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page