Private
Public Access
1
0
Commit Graph

12 Commits

Author SHA1 Message Date
c9481d12c6 feat(db): migrate from MySQL to PostgreSQL
All checks were successful
continuous-integration/drone/push Build is passing
Replace MySQL driver with pgx/v5 and pgxpool:
- Update sqlc to use postgresql engine
- Convert query.sql to PostgreSQL syntax ($1 params, CASE WHEN,
  ANY() arrays)
- Replace sql.DB with pgxpool.Pool throughout
- Change nullable types from sql.Null* to pgtype.*
- Update ID types from uint32 to int64 for PostgreSQL compatibility
- Delete MySQL-specific dynamic_connect.go
- Add opentelemetry.gowrap template for tracing
2025-11-29 10:59:15 -08:00
3e6a0f9e63 fix(api): include deleted monitors in name-based lookups
Remove status filter from GetMonitorByNameAndIPVersion query to allow
historical score data for deleted monitors to be accessible when
querying by monitor name/TLS name, making behavior consistent with
ID-based queries.
2025-08-03 14:53:21 -07:00
9c6b8d1867 fix(api): handle score monitors in name-based lookups
Score monitors have type='score' and ip_version=NULL, but the
GetMonitorByNameAndIPVersion query required ip_version to match.
This broke monitor lookups by name for score monitors.

Modified query to match either:
- Regular monitors with specified ip_version
- Score monitors with NULL ip_version

Fixes issue reported by Ben Harris at:
https://community.ntppool.org/t/monitor-recentmedian-no-longer-works/4002
2025-08-04 20:43:53 -07:00
eb5459abf3 fix(api): protocol-aware monitor filtering for multi-protocol monitors
All checks were successful
continuous-integration/drone/push Build is passing
Servers with monitor filtering returned incorrect results when monitors
have same names but different protocols (v4/v6). Monitor lookup now
considers both name and IP version to match the correct protocol.

- Add GetMonitorByNameAndIPVersion SQL query with protocol matching
- Update history parameter parsing to use server IP version context
- Fix both /scores/{ip}/log and Grafana endpoints
- Remove unused GetMonitorByName query

Fixes abh/ntppool#264
Reported-by: Anssi Johansson <https://github.com/avijc>
2025-07-27 00:37:49 -07:00
087d253d90 Update schema for monitors v4; use go tool
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-06-21 03:49:02 -07:00
47b96cd598 zones: per zone server counts API migrated
All checks were successful
continuous-integration/drone/push Build is passing
2023-12-23 01:54:21 -08:00
6553b4711b scores: allow specifying the monitor by name
All checks were successful
continuous-integration/drone/push Build is passing
2023-12-22 08:59:13 -08:00
f6b0f96a34 scores: json handler
Some checks failed
continuous-integration/drone/push Build was killed
2023-12-10 21:42:15 -08:00
61245cc77c scores: csv handler 2023-12-10 21:02:04 -08:00
e824274998 Add png graph handler
All checks were successful
continuous-integration/drone/push Build is passing
2023-12-09 13:54:13 -08:00
27c8bc4776 Calculate netspeed points, too
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-16 02:40:50 -07:00
18185090d1 wip 2023-05-07 00:01:00 -07:00