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.5.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.5-py3-none-any.whl (62.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kb_dashboard_lint-0.2.5.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.5.tar.gz
Algorithm Hash digest
SHA256 7e66cc022891a5291918cd14eaacaab9feb0372cce244eda6b37a4c2743743b3
MD5 f924358e329c4503e147acce13586d21
BLAKE2b-256 c400cf7a7681ea2de1f6931fb72152cbae448de55f89c819edaf9b452ef4125a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kb_dashboard_lint-0.2.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f94929a61f7fd932bbe0e89c029a8b32b5a4a930f364dc4c669ceec140c20937
MD5 d58b8e4992cff57dc9f7f16be58f8692
BLAKE2b-256 655cef940de3240f209664a0c596b58b31b17bb245cf40ec712873ea3059c67a

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