奶爸 e61772e858 feat(v2.0.0): tsdb (#1162)
* feat: tsdb

* fix(ci): remove --parseGoList=false from swag init to fix dependency resolution

* fix(ci): fix swag init directory and temporary remove s390x support due to cgo issues

* fix(ci): fix swag init output directory to cmd/dashboard/docs

* fix(ci): set GOTOOLCHAIN=auto for gosec

* feat: add system storage maintenance for SQLite and TSDB

* shit

* feat: add s390x support and improve service monitoring

* ci: upgrade goreleaser-cross image to v1.25

* ci: add libzstd-dev:s390x for cross-compilation

* ci: build libzstd for s390x from source

* ci: add libzstd_linux_s390x.go for gozstd linking

* ci: use vendor mode for s390x gozstd build

* ci: clone zstd source for s390x build

* refactor(tsdb): rename MaxDiskUsageGB to MinFreeDiskSpaceGB and optimize queries

- Rename config to accurately reflect VictoriaMetrics behavior: minimum free disk space threshold
- Add QueryServiceHistoryByServerID for batch query optimization
- Fix hasStatus to avoid false status counting when only delay data exists
- Fix service aggregation boundary: use successCount*2 >= count
- Fix serviceID parsing with strconv.ParseUint error handling
- Add TagFiltersCacheSize for better query performance

* feat(api): add server metrics endpoint and simplify service history response

- Add /server/:id/metrics API for querying TSDB server metrics
- Simplify getServiceHistory by removing redundant data conversion
- Change AvgDelay type from float32 to float64
- Remove generated swagger docs (to be regenerated)
- Update TSDB query, writer and tests

* chore: 临时禁用不支持前端

* ci: cache zstd build for s390x to speed up CI

* fix(tsdb): fix race conditions, data correctness and optimize performance

- Fix TOCTOU race between IsClosed() and write/query by holding RLock
- Fix delay=0 excluded from stats by using hasDelay flag instead of value > 0
- Fix fmt.Sscanf -> strconv.ParseUint for server_id parsing with error logging
- Fix buffer unbounded growth by flushing inside lock when over maxSize
- Split makeMetricRow into makeServerMetricRow/makeServiceMetricRow
- Extract InitGlobalSettings() from Open() for VictoriaMetrics globals
- Remove redundant instance/GetInstance/SetInstance singleton
- Add error logging for silently skipped block decode errors
- Optimize WriteBatch* to build all rows in single write call
- Optimize downsample to use linear scan instead of map for sorted data
- Optimize query slice reuse across block iterations

* 服务添加DisplayIndex (#1166)

* 服务添加DisplayIndex

* 根据ai建议修改

---------

Co-authored-by: huYang <306061454@qq.com>

* fix(tsdb): restore SQLite fallback and monthly status reload on restart

- Restore ServiceHistory model and SQLite write fallback when TSDB is disabled
- Reload monthlyStatus (30-day) and serviceStatusToday from TSDB/SQLite on startup
- Add SQLite fallback query for /service/:id/history and /server/:id/service
- Remove breaking GET /service/:id endpoint, keep /service/:id/history only
- Add QueryServiceDailyStats to TSDB for per-day aggregation
- Add tests for monthly status and today stats loading from both TSDB and SQLite
- Migrate ServiceHistory table only when TSDB is disabled

* ci: exclude false-positive gosec rules G117, G703, G704

* feat(api): expose tsdb_enabled in setting response

* ci: restore G115 exclusion accidentally dropped in previous commit

* fix: update version numbers for OfficialAdmin and Official templates

* chore: upgrade frontend

* chore: upgrade frontend

---------

Co-authored-by: 胡说丷刂 <34758853+laosan-xx@users.noreply.github.com>
Co-authored-by: huYang <306061454@qq.com>
2026-02-15 13:13:33 +08:00
2025-02-28 22:19:57 +08:00
2026-02-15 13:13:33 +08:00
2026-02-15 13:13:33 +08:00
2026-02-15 13:13:33 +08:00
2026-02-15 13:13:33 +08:00
2025-02-09 14:39:12 +08:00
2025-03-22 22:44:25 +08:00
2026-02-15 13:13:33 +08:00
2021-01-30 11:22:59 +08:00
2026-02-15 13:13:33 +08:00
2026-02-15 13:13:33 +08:00
2026-02-15 13:13:33 +08:00
2021-03-22 17:41:38 +08:00
2026-01-02 22:05:02 +08:00
2022-04-18 10:47:29 +08:00



LOGO designed by 熊大 .

GitHub release (with filter)   Translation status

:trollface: Nezha Monitoring: Self-hostable, lightweight, servers and websites monitoring and O&M tool.

Supports monitoring system status, HTTP (SSL certificate change, upcoming expiration, expired), TCP, Ping and supports push alerts, run scheduled tasks and web terminal.

>> Telegram Channel: 哪吒监控(中文通知频道)
>> Telegram Group: Nezha Monitoring Global (English Only), 哪吒监控(中文群组)

>> Use Cases | 我们的用户 (Google)

User Guide

Contributing

Translation

Translation status

Is Nezha not in your language, or the translation is incorrect or incomplete? Get involved in the translations on Hosted Weblate.

Screenshots

用户前台 @hamster1963 管理后台 @nezhahq
user admin
hamster1963/nezha-dash nezhahq/admin-frontend

add your theme to service/singleton/frontend-templates.yaml

Contributors

奶爸

UUBulb Akkia 卖女孩的小火柴 nap0o 黑歌 xykt MikoyChinese Weblate (bot) JackieSung4ev Kris Lemoe spiritlhl 刘颜溪 CosmosZ-code Ko no dio Kris Mmx233 rootmelo92118 Moraxyc Xu 1ridic 仓鼠 zhucaidan Sean lyj fscarmen windingFlame JSker9 Hsukqi Lee Darc Z. Creling Core F adminsama Acgpiano eya46 guoyongchang hiDandelion honeok IYUANWEIZE igophper lvyaoting quanljh unclezs 缘生 严浩 凌 榆木 93 Tony TomyJan Tater Li Tao Chen Spetrum Nanjing Hopefun Network Technology Co. Ltd. Mingzhuo Yin Martijn Lindeman Leon KorenKrita Ian Li YiPing Zhang Esdese :D Coming

Special Thanks

  • IPInfo for providing an accurate GeoIP Database.

Star History

Star History Chart

S
Description
No description provided
Readme Apache-2.0 50 MiB
Languages
Go 97.3%
Shell 2.4%
HTML 0.2%
Dockerfile 0.1%