sync-dashboards

Installation
SKILL.md

You maintain the consistency between the MegaLinter observability payload and the provider dashboards.

The contract

  • Producer: megalinter/reporters/ApiReporter.py builds the v2 payload (run-level KPIs incl. qualityGateStatus and the 0-100 healthScore, per-linter records, SARIF-derived rulesBreakdown/filesBreakdown); megalinter/api_providers/ApiProvider.py defines the metric fields (run_metric_fields, linter_metric_fields) and each ApiProvider* subclass maps them to its backend (Prometheus/Loki, Datadog, Elastic, New Relic).
  • Contract file: .automation/dashboard_builders/contract.py lists the same fields, labels (base + run-level megalinterVersion/megalinterFlavor), record types and metric name prefixes.
  • Consumers: the DashboardBuilder* classes in .automation/dashboard_builders/ generate docs/dashboards/ (Grafana JSON, Datadog JSON, New Relic JSON, Kibana ndjson + manifest.json).

Dashboard design invariants (keep them when editing)

  • Fleet-to-detail navigation: Grafana org table/charts carry data links to the Repository dashboard (var-repo), which links to Linter Detail (var-linter); Datadog uses the git_repo_name/git_branch_name template variables + __SELF_URL__ custom links (substituted by the uploader); New Relic has Repository/Branch NRQL variables, a "Repository detail" page and facet links (__REPOSITORY_DETAIL_PAGE_GUID__, substituted by the uploader's second pass); Kibana relies on native click-to-filter.
  • Branch filtering must stay available on every platform (Grafana $branch, Datadog $git_branch_name, New Relic {{gitBranchName}} with % default, Kibana filter bar).
  • Rating drill-down: every rating (A-E) tile leads to a "Why this rating?" explanation — Grafana dedicated dashboard (uid megalinter-rating, linked from the rating stats), New Relic dedicated page (facet-linkable via the __RATING_PAGE_GUID__ marker), Datadog group widget, Elastic markdown + breakdown panels. It must always show: the formula, linters success/warning/error counts, and the linters dragging the score down.
  • Derived KPIs: the A-E rating is a dashboard-side range mapping of healthScore (A>=90, B>=80, C>=65, D>=50, else E); "time saved" is totalErrorsFixed * 5 minutes — keep formulas consistent across providers and documented in docs/observability.md.
  • Agnostic dashboards: no account ids, datasource uids, or instance URLs hardcoded in generated files — placeholders are resolved by mega-linter-runner/lib/upload-dashboards.js at upload time so anyone can provision them on their own account.
  • Value-conditional styling: KPIs are colored by value on every platform — Grafana thresholds/background stat tiles/color-background table cells/threshold-zone areas, Datadog conditional_formats + semantic timeseries palettes (warm=errors, cool=health, purple=duration), New Relic billboard thresholds + fixed series colors (Blocking=red, Non-blocking=yellow), Kibana Lens custom palettes on metric panels. Keep the semantics: green=good, yellow=warning, red=blocking, blue=neutral/informative.
  • Cardinality: runId, jobUrl, rule ids and file paths never become metric tags or Loki stream labels.

Process

Installs
1
GitHub Stars
2.6K
First Seen
11 days ago