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

Uploaded Python 3

File details

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

File metadata

  • Download URL: kb_dashboard_lint-0.2.0.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.2

File hashes

Hashes for kb_dashboard_lint-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5788b893e5fb6b77961f949cb62b5cec97561ad9711a42608bcad491aae1d70f
MD5 dd548ef649209dcaa477be567e43415b
BLAKE2b-256 c8157cfdf556f09bcb2bc5ad4ff6e7232fd810482f7cc5e07e9f4ef8754b821c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kb_dashboard_lint-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f6b4262e906187986083b5fefad641bcb12913d2f16d096e0411dc596161b7e
MD5 7bc65d16ccc87c8deedad8ea30a1f2d3
BLAKE2b-256 95fef536d08004d2aa9fe1520d663cccfcc3379c956a8623eda9076c5e659449

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