mirror of
https://gitverse.ru/kpa39l/monitoring.git
synced 2026-09-29 09:55:09 +00:00
OpenSpec: разнести openspec по проектам
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
schema: spec-driven
|
||||
created: 2026-09-08
|
||||
@@ -0,0 +1,62 @@
|
||||
# Design: Fix Vinograd WAN dashboard annotations
|
||||
|
||||
## Файл
|
||||
|
||||
| Файл | Действие |
|
||||
|---|---|
|
||||
| `/opt/monitoring/grafana/dashboards/vinograd-wan.json` | убрать `annotations.list` (ссылка на `__grafana__`) → `"list": []` |
|
||||
|
||||
## Изменение
|
||||
|
||||
Было:
|
||||
|
||||
```json
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {"type": "grafana", "uid": "__grafana__"},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Стало:
|
||||
|
||||
```json
|
||||
"annotations": {
|
||||
"list": []
|
||||
}
|
||||
```
|
||||
|
||||
## Почему так
|
||||
|
||||
- `__grafana__` — встроенный datasource (аннотации/алерты), не существует в
|
||||
БД этой инсталляции (в `data_source` только Prometheus и Loki).
|
||||
- Панели дашборда не ссылаются на аннотации; секция добавлена автоматически
|
||||
при создании JSON (скопирована из шаблона) и бесполезна.
|
||||
- Рабочий garage-cluster.json имеет `"list": []` — дашборд открывается.
|
||||
|
||||
## Применение и проверка
|
||||
|
||||
```bash
|
||||
cd /opt/monitoring
|
||||
# правка файла (руками или jq)
|
||||
jq '.annotations.list = []' grafana/dashboards/vinograd-wan.json > /tmp/vw.json && mv /tmp/vw.json grafana/dashboards/vinograd-wan.json
|
||||
# провайдер перечитает файл за ≤30с (updateIntervalSeconds: 30); рестарт не нужен
|
||||
sleep 35
|
||||
# проверка: дашборд без ошибки __grafana__
|
||||
curl -s -u 'estorozhenko:...' 'http://127.0.0.1:3001/api/dashboards/uid/vinograd-wan' | jq '.dashboard.annotations'
|
||||
# и главное — открытие страницы без ошибки в браузере
|
||||
```
|
||||
|
||||
## Риски
|
||||
|
||||
- Минимальные. Изменение декоративное (удаление неиспользуемой секции).
|
||||
- Если Grafana всё же нужна встроенная аннотация — она добавится автоматически
|
||||
в рантайме (built-in annotation не зависит от дашборд-JSON).
|
||||
@@ -0,0 +1,31 @@
|
||||
# Proposal: Fix Vinograd WAN dashboard — Datasource __grafana__ not found
|
||||
|
||||
## Why
|
||||
|
||||
При открытии `https://grafana.nixg.ru/d/vinograd-wan/vinograd-wan` Grafana
|
||||
показывает ошибку:
|
||||
|
||||
```
|
||||
Failed to retrieve datasource
|
||||
Datasource __grafana__ was not found
|
||||
```
|
||||
|
||||
Панели дашборда (availability, RTT) ссылаются на Prometheus (`uid: Prometheus`)
|
||||
и работают. Ошибку вызывает секция `annotations` в JSON дашборда, которая
|
||||
ссылается на встроенный датасорс `__grafana__` (аннотации/алерты). Такого
|
||||
датасорса нет в БД Grafana 11 OSS (там только Prometheus и Loki), поэтому
|
||||
Grafana не может его найти и показывает ошибку при открытии.
|
||||
|
||||
## What Changes
|
||||
|
||||
- В `/opt/monitoring/grafana/dashboards/vinograd-wan.json` секция
|
||||
`annotations.list` заменяется с массива с элементом `{datasource: {type:
|
||||
grafana, uid: __grafana__}}` на пустой список `[]` — как в рабочем
|
||||
`garage-cluster.json`.
|
||||
- Панели не используют аннотации, поэтому удаление секции безвредно.
|
||||
- Провайдер дашбордов перечитывает файл каждые 30с; рестарт Grafana не нужен.
|
||||
|
||||
## Rollback
|
||||
|
||||
1. Вернуть файл из git: `git checkout grafana/dashboards/vinograd-wan.json`
|
||||
2. Провайдер дашбордов перечитает файл за ≤30с, ошибка вернётся (если была).
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
# Spec delta: Fix Vinograd WAN dashboard annotations
|
||||
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Vinograd WAN dashboard opens without datasource errors
|
||||
|
||||
The Vinograd WAN dashboard (`/d/vinograd-wan/vinograd-wan`) MUST open and render
|
||||
all panels WITHOUT the error "Datasource __grafana__ was not found".
|
||||
|
||||
- The dashboard JSON MUST NOT reference the built-in `__grafana__` datasource in
|
||||
its `annotations.list` (it is not registered in this Grafana's database).
|
||||
- `annotations.list` MUST be empty (`[]`), matching the working
|
||||
`garage-cluster.json` dashboard.
|
||||
|
||||
#### Scenario: Dashboard renders without datasource error
|
||||
|
||||
- **WHEN** a user opens `https://grafana.nixg.ru/d/vinograd-wan/vinograd-wan`
|
||||
- **THEN** the dashboard loads without the error "Datasource __grafana__ was not found"
|
||||
- **AND** all panels render metric data from Prometheus (`uid: Prometheus`)
|
||||
|
||||
#### Scenario: Dashboard file stores no __grafana__ reference
|
||||
|
||||
- **WHEN** the file `grafana/dashboards/vinograd-wan.json` is parsed
|
||||
- **THEN** `annotations.list` is `[]` OR contains no item whose
|
||||
`datasource.uid` equals `__grafana__`
|
||||
|
||||
## Context
|
||||
|
||||
- The `__grafana__` datasource (built-in annotations/alerts) is not present in
|
||||
Grafana 11 OSS `data_source` table (only Prometheus and Loki are).
|
||||
- Panels reference `uid: Prometheus` and are unaffected.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Tasks
|
||||
|
||||
## 1. Диагностика
|
||||
- [x] 1.1 Найти источник ошибки: секция `annotations.list` в vinograd-wan.json
|
||||
ссылается на `datasource {type: grafana, uid: __grafana__}`
|
||||
- [x] 1.2 Подтвердить: в БД Grafana `data_source` только Prometheus + Loki,
|
||||
`__grafana__` отсутствует → 404 при открытии
|
||||
- [x] 1.3 Сравнить с рабочим garage-cluster.json: `annotations.list = []` →
|
||||
ошибки нет
|
||||
|
||||
## 2. Фикс
|
||||
- [x] 2.1 Заменить `annotations.list` в vinograd-wan.json на `[]` (jq)
|
||||
- [x] 2.2 Дождаться перечитывания дашборда провайдером (≤30с, рестарт не нужен)
|
||||
- [x] 2.3 Проверить через API: `/api/dashboards/uid/vinograd-wan` →
|
||||
`annotations.list = []` (в БД: `{"list": []}`, version 2)
|
||||
- [x] 2.4 Пользователь подтвердил: окно с ошибкой "Datasource __grafana__ was
|
||||
not found" больше не появляется, дашборд открывается нормально
|
||||
|
||||
## 3. Документация и git
|
||||
- [ ] 3.1 Запись в EXPERIENCE.md (грабли: `__grafana__` в annotations дашборда —
|
||||
ошибка; убирать как в garage-cluster.json)
|
||||
- [ ] 3.2 git add + commit + push (мониторинг, ветка master)
|
||||
- [ ] 3.3 openspec validate + archive + STATUS/WALKTHROUGH
|
||||
- [ ] 3.4 git commit + push (openspec-lab, ветка main)
|
||||
Reference in New Issue
Block a user