Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 267c279f3d | |||
| eb5459abf3 | |||
| 8262b1442f | |||
| d4bf8d9e16 | |||
| 6c5b762a57 | |||
| fd6e87cf2d | |||
| a22d5ebc7e | |||
| 42ce22e83e | |||
| 087d253d90 | |||
| ae7acb4111 | |||
| bd4e52a73b | |||
| 118e596098 | |||
| e6f39f201c | |||
| 962839ed89 |
@@ -21,7 +21,7 @@ steps:
|
|||||||
memory: 100MiB
|
memory: 100MiB
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
image: golang:1.23
|
image: golang:1.24
|
||||||
pull: always
|
pull: always
|
||||||
volumes:
|
volumes:
|
||||||
- name: go
|
- name: go
|
||||||
@@ -33,7 +33,7 @@ steps:
|
|||||||
- go build ./...
|
- go build ./...
|
||||||
|
|
||||||
- name: goreleaser
|
- name: goreleaser
|
||||||
image: golang:1.23
|
image: golang:1.24
|
||||||
pull: always
|
pull: always
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
@@ -83,6 +83,6 @@ volumes:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: c3cf7118bd6e9a6310b792f9cb9a3a146416123528cf41d2e5ccb9c23786d02b
|
hmac: 616f5b902e42082a427162929ba5ac45d9331a8ade25c923f185ebb71dd8aef4
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|||||||
10
Makefile
10
Makefile
@@ -2,12 +2,10 @@ generate: sqlc
|
|||||||
go generate ./...
|
go generate ./...
|
||||||
|
|
||||||
sqlc:
|
sqlc:
|
||||||
@which gowrap >& /dev/null || (echo "Run 'go install github.com/hexdigest/gowrap/cmd/gowrap@v1.4.1'" && exit 1)
|
go tool sqlc compile
|
||||||
@which mockery >& /dev/null || (echo "Run 'go install github.com/vektra/mockery/v2@v2.35.4'" && exit 1)
|
go tool sqlc generate
|
||||||
sqlc compile
|
go tool gowrap gen -t opentelemetry -i QuerierTx -p ./ntpdb -o ./ntpdb/otel.go
|
||||||
sqlc generate
|
#go tool mockery --dir ntpdb --name QuerierTx --config /dev/null
|
||||||
gowrap gen -t opentelemetry -i QuerierTx -p ./ntpdb -o ./ntpdb/otel.go
|
|
||||||
mockery --dir ntpdb --name QuerierTx --config /dev/null
|
|
||||||
|
|
||||||
sign:
|
sign:
|
||||||
drone sign --save ntppool/data-api
|
drone sign --save ntppool/data-api
|
||||||
|
|||||||
@@ -24,9 +24,11 @@ type UserCountry []flatAPI
|
|||||||
func (s UserCountry) Len() int {
|
func (s UserCountry) Len() int {
|
||||||
return len(s)
|
return len(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s UserCountry) Swap(i, j int) {
|
func (s UserCountry) Swap(i, j int) {
|
||||||
s[i], s[j] = s[j], s[i]
|
s[i], s[j] = s[j], s[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s UserCountry) Less(i, j int) bool {
|
func (s UserCountry) Less(i, j int) bool {
|
||||||
return s[i].IPv4 > s[j].IPv4
|
return s[i].IPv4 > s[j].IPv4
|
||||||
}
|
}
|
||||||
@@ -183,3 +185,55 @@ func (d *ClickHouse) UserCountryData(ctx context.Context) (*UserCountry, error)
|
|||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DNSQueryCounts struct {
|
||||||
|
T uint32 `json:"t"`
|
||||||
|
Avg float64 `json:"avg"`
|
||||||
|
Max uint64 `json:"max"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d *ClickHouse) DNSQueries(ctx context.Context) ([]DNSQueryCounts, error) {
|
||||||
|
log := logger.Setup()
|
||||||
|
ctx, span := tracing.Tracer().Start(ctx, "DNSQueries")
|
||||||
|
defer span.End()
|
||||||
|
|
||||||
|
startUnix := time.Now().Add(2 * time.Hour * -1).Unix()
|
||||||
|
startUnix -= startUnix % (60 * 5)
|
||||||
|
|
||||||
|
log.InfoContext(ctx, "start time", "start", startUnix)
|
||||||
|
|
||||||
|
rows, err := d.Logs.Query(clickhouse.Context(ctx, clickhouse.WithSpan(span.SpanContext())),
|
||||||
|
`
|
||||||
|
select toUnixTimestamp(toStartOfFiveMinute(t)) as t,
|
||||||
|
sum(q)/300 as avg, max(q) as max
|
||||||
|
from (
|
||||||
|
select window as t, sumSimpleState(queries) as q
|
||||||
|
from geodns.by_origin_1s
|
||||||
|
where
|
||||||
|
window > FROM_UNIXTIME(?)
|
||||||
|
and Origin IN ('pool.ntp.org', 'g.ntpns.org')
|
||||||
|
group by t order by t
|
||||||
|
)
|
||||||
|
group by t order by t
|
||||||
|
`, startUnix)
|
||||||
|
if err != nil {
|
||||||
|
log.ErrorContext(ctx, "query error", "err", err)
|
||||||
|
return nil, fmt.Errorf("database error")
|
||||||
|
}
|
||||||
|
|
||||||
|
var t uint32
|
||||||
|
var avg float64
|
||||||
|
var max uint64
|
||||||
|
|
||||||
|
r := []DNSQueryCounts{}
|
||||||
|
|
||||||
|
for rows.Next() {
|
||||||
|
if err := rows.Scan(&t, &avg, &max); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
log.InfoContext(ctx, "data", "t", t, "avg", avg, "max", max)
|
||||||
|
r = append(r, DNSQueryCounts{t, avg, max})
|
||||||
|
}
|
||||||
|
|
||||||
|
return r, nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package chdb
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ClickHouse/clickhouse-go/v2"
|
"github.com/ClickHouse/clickhouse-go/v2"
|
||||||
@@ -105,3 +106,127 @@ func (d *ClickHouse) Logscores(ctx context.Context, serverID, monitorID int, sin
|
|||||||
|
|
||||||
return rv, nil
|
return rv, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LogscoresTimeRange queries log scores within a specific time range for Grafana integration
|
||||||
|
func (d *ClickHouse) LogscoresTimeRange(ctx context.Context, serverID, monitorID int, from, to time.Time, limit int) ([]ntpdb.LogScore, error) {
|
||||||
|
log := logger.Setup()
|
||||||
|
ctx, span := tracing.Tracer().Start(ctx, "CH LogscoresTimeRange")
|
||||||
|
defer span.End()
|
||||||
|
|
||||||
|
args := []interface{}{serverID, from, to}
|
||||||
|
|
||||||
|
query := `select id,monitor_id,server_id,ts,
|
||||||
|
toFloat64(score),toFloat64(step),offset,
|
||||||
|
rtt,leap,warning,error
|
||||||
|
from log_scores
|
||||||
|
where
|
||||||
|
server_id = ?
|
||||||
|
and ts >= ?
|
||||||
|
and ts <= ?`
|
||||||
|
|
||||||
|
if monitorID > 0 {
|
||||||
|
query += " and monitor_id = ?"
|
||||||
|
args = append(args, monitorID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Always order by timestamp ASC for Grafana convention
|
||||||
|
query += " order by ts ASC"
|
||||||
|
|
||||||
|
// Apply limit to prevent memory issues
|
||||||
|
if limit > 0 {
|
||||||
|
query += " limit ?"
|
||||||
|
args = append(args, limit)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.DebugContext(ctx, "clickhouse time range query",
|
||||||
|
"query", query,
|
||||||
|
"args", args,
|
||||||
|
"server_id", serverID,
|
||||||
|
"monitor_id", monitorID,
|
||||||
|
"from", from.Format(time.RFC3339),
|
||||||
|
"to", to.Format(time.RFC3339),
|
||||||
|
"limit", limit,
|
||||||
|
"full_sql_with_params", func() string {
|
||||||
|
// Build a readable SQL query with parameters substituted for debugging
|
||||||
|
sqlDebug := query
|
||||||
|
paramIndex := 0
|
||||||
|
for strings.Contains(sqlDebug, "?") && paramIndex < len(args) {
|
||||||
|
var replacement string
|
||||||
|
switch v := args[paramIndex].(type) {
|
||||||
|
case int:
|
||||||
|
replacement = fmt.Sprintf("%d", v)
|
||||||
|
case time.Time:
|
||||||
|
replacement = fmt.Sprintf("'%s'", v.Format("2006-01-02 15:04:05"))
|
||||||
|
default:
|
||||||
|
replacement = fmt.Sprintf("'%v'", v)
|
||||||
|
}
|
||||||
|
sqlDebug = strings.Replace(sqlDebug, "?", replacement, 1)
|
||||||
|
paramIndex++
|
||||||
|
}
|
||||||
|
return sqlDebug
|
||||||
|
}(),
|
||||||
|
)
|
||||||
|
|
||||||
|
rows, err := d.Scores.Query(
|
||||||
|
clickhouse.Context(
|
||||||
|
ctx, clickhouse.WithSpan(span.SpanContext()),
|
||||||
|
),
|
||||||
|
query, args...,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
log.ErrorContext(ctx, "time range query error", "err", err)
|
||||||
|
return nil, fmt.Errorf("database error")
|
||||||
|
}
|
||||||
|
|
||||||
|
rv := []ntpdb.LogScore{}
|
||||||
|
|
||||||
|
for rows.Next() {
|
||||||
|
row := ntpdb.LogScore{}
|
||||||
|
var leap uint8
|
||||||
|
|
||||||
|
if err := rows.Scan(
|
||||||
|
&row.ID,
|
||||||
|
&row.MonitorID,
|
||||||
|
&row.ServerID,
|
||||||
|
&row.Ts,
|
||||||
|
&row.Score,
|
||||||
|
&row.Step,
|
||||||
|
&row.Offset,
|
||||||
|
&row.Rtt,
|
||||||
|
&leap,
|
||||||
|
&row.Attributes.Warning,
|
||||||
|
&row.Attributes.Error,
|
||||||
|
); err != nil {
|
||||||
|
log.Error("could not parse row", "err", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
row.Attributes.Leap = int8(leap)
|
||||||
|
rv = append(rv, row)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.InfoContext(ctx, "time range query results",
|
||||||
|
"rows_returned", len(rv),
|
||||||
|
"server_id", serverID,
|
||||||
|
"monitor_id", monitorID,
|
||||||
|
"time_range", fmt.Sprintf("%s to %s", from.Format(time.RFC3339), to.Format(time.RFC3339)),
|
||||||
|
"limit", limit,
|
||||||
|
"sample_rows", func() []map[string]interface{} {
|
||||||
|
samples := make([]map[string]interface{}, 0, 3)
|
||||||
|
for i, row := range rv {
|
||||||
|
if i >= 3 { break }
|
||||||
|
samples = append(samples, map[string]interface{}{
|
||||||
|
"id": row.ID,
|
||||||
|
"monitor_id": row.MonitorID,
|
||||||
|
"ts": row.Ts.Format(time.RFC3339),
|
||||||
|
"score": row.Score,
|
||||||
|
"rtt_valid": row.Rtt.Valid,
|
||||||
|
"offset_valid": row.Offset.Valid,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return samples
|
||||||
|
}(),
|
||||||
|
)
|
||||||
|
|
||||||
|
return rv, nil
|
||||||
|
}
|
||||||
|
|||||||
176
go.mod
176
go.mod
@@ -1,100 +1,148 @@
|
|||||||
module go.ntppool.org/data-api
|
module go.ntppool.org/data-api
|
||||||
|
|
||||||
go 1.23.5
|
go 1.24
|
||||||
|
|
||||||
toolchain go1.24.0
|
|
||||||
|
|
||||||
// replace github.com/samber/slog-echo => github.com/abh/slog-echo v0.0.0-20231024051244-af740639893e
|
// replace github.com/samber/slog-echo => github.com/abh/slog-echo v0.0.0-20231024051244-af740639893e
|
||||||
|
|
||||||
|
replace go.opentelemetry.io/otel/exporters/prometheus v0.59.1 => go.opentelemetry.io/otel/exporters/prometheus v0.59.0
|
||||||
|
|
||||||
|
tool (
|
||||||
|
github.com/hexdigest/gowrap/cmd/gowrap
|
||||||
|
github.com/sqlc-dev/sqlc/cmd/sqlc
|
||||||
|
// github.com/vektra/mockery/v3
|
||||||
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
dario.cat/mergo v1.0.1
|
dario.cat/mergo v1.0.2
|
||||||
github.com/ClickHouse/clickhouse-go/v2 v2.32.2
|
github.com/ClickHouse/clickhouse-go/v2 v2.40.1
|
||||||
github.com/go-sql-driver/mysql v1.9.0
|
github.com/go-sql-driver/mysql v1.9.3
|
||||||
github.com/hashicorp/go-retryablehttp v0.7.7
|
github.com/hashicorp/go-retryablehttp v0.7.8
|
||||||
github.com/labstack/echo-contrib v0.17.2
|
github.com/labstack/echo-contrib v0.17.4
|
||||||
github.com/labstack/echo/v4 v4.13.3
|
github.com/labstack/echo/v4 v4.13.4
|
||||||
github.com/samber/slog-echo v1.15.1
|
github.com/samber/slog-echo v1.16.1
|
||||||
github.com/spf13/cobra v1.9.1
|
github.com/spf13/cobra v1.9.1
|
||||||
github.com/stretchr/testify v1.10.0
|
|
||||||
go.ntppool.org/api v0.3.4
|
go.ntppool.org/api v0.3.4
|
||||||
go.ntppool.org/common v0.3.2-0.20250126190844-e5836a8b97f6
|
go.ntppool.org/common v0.5.1
|
||||||
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.59.0
|
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.62.0
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.59.0
|
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.62.0
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0
|
||||||
go.opentelemetry.io/otel v1.34.0
|
go.opentelemetry.io/otel v1.37.0
|
||||||
go.opentelemetry.io/otel/trace v1.34.0
|
go.opentelemetry.io/otel/trace v1.37.0
|
||||||
golang.org/x/sync v0.11.0
|
golang.org/x/sync v0.16.0
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
cel.dev/expr v0.24.0 // indirect
|
||||||
filippo.io/edwards25519 v1.1.0 // indirect
|
filippo.io/edwards25519 v1.1.0 // indirect
|
||||||
github.com/ClickHouse/ch-go v0.65.1 // indirect
|
github.com/ClickHouse/ch-go v0.67.0 // indirect
|
||||||
github.com/andybalholm/brotli v1.1.1 // indirect
|
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||||
|
github.com/Masterminds/semver/v3 v3.1.1 // indirect
|
||||||
|
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
|
||||||
|
github.com/andybalholm/brotli v1.2.0 // indirect
|
||||||
|
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/cubicdaiya/gonp v1.0.4 // indirect
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
|
github.com/fatih/structtag v1.2.0 // indirect
|
||||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||||
github.com/go-faster/city v1.0.1 // indirect
|
github.com/go-faster/city v1.0.1 // indirect
|
||||||
github.com/go-faster/errors v0.7.1 // indirect
|
github.com/go-faster/errors v0.7.1 // indirect
|
||||||
github.com/go-logr/logr v1.4.2 // indirect
|
github.com/go-logr/logr v1.4.3 // indirect
|
||||||
github.com/go-logr/stdr v1.2.2 // indirect
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
|
github.com/google/cel-go v0.24.1 // indirect
|
||||||
github.com/google/uuid v1.6.0 // indirect
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 // indirect
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 // indirect
|
||||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||||
|
github.com/hexdigest/gowrap v1.4.2 // indirect
|
||||||
|
github.com/huandu/xstrings v1.5.0 // indirect
|
||||||
|
github.com/imdario/mergo v0.3.12 // indirect
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||||
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||||
|
github.com/jackc/pgx/v5 v5.7.4 // indirect
|
||||||
|
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
||||||
|
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||||
github.com/klauspost/compress v1.18.0 // indirect
|
github.com/klauspost/compress v1.18.0 // indirect
|
||||||
github.com/labstack/gommon v0.4.2 // indirect
|
github.com/labstack/gommon v0.4.2 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
|
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||||
|
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||||
|
github.com/ncruces/go-strftime v0.1.9 // indirect
|
||||||
github.com/paulmach/orb v0.11.1 // indirect
|
github.com/paulmach/orb v0.11.1 // indirect
|
||||||
|
github.com/pganalyze/pg_query_go/v6 v6.1.0 // indirect
|
||||||
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
||||||
|
github.com/pingcap/errors v0.11.5-0.20240311024730-e056997136bb // indirect
|
||||||
|
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86 // indirect
|
||||||
|
github.com/pingcap/log v1.1.0 // indirect
|
||||||
|
github.com/pingcap/tidb/pkg/parser v0.0.0-20250324122243-d51e00e5bbf0 // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||||
github.com/prometheus/client_golang v1.21.0 // indirect
|
github.com/prometheus/client_golang v1.23.0 // indirect
|
||||||
github.com/prometheus/client_model v0.6.1 // indirect
|
github.com/prometheus/client_model v0.6.2 // indirect
|
||||||
github.com/prometheus/common v0.62.0 // indirect
|
github.com/prometheus/common v0.65.0 // indirect
|
||||||
github.com/prometheus/procfs v0.15.1 // indirect
|
github.com/prometheus/procfs v0.17.0 // indirect
|
||||||
github.com/remychantenay/slog-otel v1.3.3 // indirect
|
github.com/remychantenay/slog-otel v1.3.4 // indirect
|
||||||
github.com/samber/lo v1.49.1 // indirect
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||||
github.com/samber/slog-multi v1.4.0 // indirect
|
github.com/riza-io/grpc-go v0.2.0 // indirect
|
||||||
|
github.com/samber/lo v1.51.0 // indirect
|
||||||
|
github.com/samber/slog-common v0.19.0 // indirect
|
||||||
|
github.com/samber/slog-multi v1.4.1 // indirect
|
||||||
github.com/segmentio/asm v1.2.0 // indirect
|
github.com/segmentio/asm v1.2.0 // indirect
|
||||||
github.com/shopspring/decimal v1.4.0 // indirect
|
github.com/shopspring/decimal v1.4.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.6 // indirect
|
github.com/spf13/cast v1.4.1 // indirect
|
||||||
github.com/stretchr/objx v0.5.2 // indirect
|
github.com/spf13/pflag v1.0.7 // indirect
|
||||||
|
github.com/sqlc-dev/sqlc v1.29.0 // indirect
|
||||||
|
github.com/stoewer/go-strcase v1.2.0 // indirect
|
||||||
|
github.com/tetratelabs/wazero v1.9.0 // indirect
|
||||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
github.com/valyala/fasttemplate v1.2.2 // indirect
|
github.com/valyala/fasttemplate v1.2.2 // indirect
|
||||||
|
github.com/wasilibs/go-pgquery v0.0.0-20250409022910-10ac41983c07 // indirect
|
||||||
|
github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52 // indirect
|
||||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||||
go.opentelemetry.io/contrib/bridges/otelslog v0.9.0 // indirect
|
go.opentelemetry.io/contrib/bridges/otelslog v0.12.0 // indirect
|
||||||
go.opentelemetry.io/contrib/bridges/prometheus v0.59.0 // indirect
|
go.opentelemetry.io/contrib/bridges/prometheus v0.62.0 // indirect
|
||||||
go.opentelemetry.io/contrib/exporters/autoexport v0.59.0 // indirect
|
go.opentelemetry.io/contrib/exporters/autoexport v0.62.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.10.0 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.13.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.10.0 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.13.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.37.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.34.0 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.37.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.37.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.37.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/prometheus v0.56.0 // indirect
|
go.opentelemetry.io/otel/exporters/prometheus v0.59.1 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.10.0 // indirect
|
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.34.0 // indirect
|
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.37.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.34.0 // indirect
|
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.37.0 // indirect
|
||||||
go.opentelemetry.io/otel/log v0.10.0 // indirect
|
go.opentelemetry.io/otel/log v0.13.0 // indirect
|
||||||
go.opentelemetry.io/otel/metric v1.34.0 // indirect
|
go.opentelemetry.io/otel/metric v1.37.0 // indirect
|
||||||
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
|
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
|
||||||
go.opentelemetry.io/otel/sdk/log v0.10.0 // indirect
|
go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect
|
||||||
go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect
|
go.opentelemetry.io/otel/sdk/metric v1.37.0 // indirect
|
||||||
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
|
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
|
||||||
golang.org/x/crypto v0.34.0 // indirect
|
go.uber.org/atomic v1.11.0 // indirect
|
||||||
golang.org/x/mod v0.23.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
golang.org/x/net v0.35.0 // indirect
|
go.uber.org/zap v1.27.0 // indirect
|
||||||
golang.org/x/sys v0.30.0 // indirect
|
golang.org/x/crypto v0.40.0 // indirect
|
||||||
golang.org/x/text v0.22.0 // indirect
|
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
|
||||||
golang.org/x/time v0.10.0 // indirect
|
golang.org/x/mod v0.26.0 // indirect
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20250219182151-9fdb1cabc7b2 // indirect
|
golang.org/x/net v0.42.0 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect
|
golang.org/x/sys v0.34.0 // indirect
|
||||||
google.golang.org/grpc v1.70.0 // indirect
|
golang.org/x/text v0.27.0 // indirect
|
||||||
google.golang.org/protobuf v1.36.5 // indirect
|
golang.org/x/time v0.12.0 // indirect
|
||||||
|
golang.org/x/tools v0.34.0 // indirect
|
||||||
|
google.golang.org/genproto/googleapis/api v0.0.0-20250728155136-f173205681a0 // indirect
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 // indirect
|
||||||
|
google.golang.org/grpc v1.74.2 // indirect
|
||||||
|
google.golang.org/protobuf v1.36.6 // indirect
|
||||||
|
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
||||||
|
modernc.org/libc v1.62.1 // indirect
|
||||||
|
modernc.org/mathutil v1.7.1 // indirect
|
||||||
|
modernc.org/memory v1.9.1 // indirect
|
||||||
|
modernc.org/sqlite v1.37.0 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
390
go.sum
390
go.sum
@@ -1,25 +1,44 @@
|
|||||||
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
|
cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY=
|
||||||
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
|
cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw=
|
||||||
|
dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8=
|
||||||
|
dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
|
||||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||||
github.com/ClickHouse/ch-go v0.65.1 h1:SLuxmLl5Mjj44/XbINsK2HFvzqup0s6rwKLFH347ZhU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/ClickHouse/ch-go v0.65.1/go.mod h1:bsodgURwmrkvkBe5jw1qnGDgyITsYErfONKAHn05nv4=
|
github.com/ClickHouse/ch-go v0.67.0 h1:18MQF6vZHj+4/hTRaK7JbS/TIzn4I55wC+QzO24uiqc=
|
||||||
github.com/ClickHouse/clickhouse-go/v2 v2.32.2 h1:Y8fAXt0CpLhqNXMLlSddg+cMfAr7zHBWqXLpih6ozCY=
|
github.com/ClickHouse/ch-go v0.67.0/go.mod h1:2MSAeyVmgt+9a2k2SQPPG1b4qbTPzdGDpf1+bcHh+18=
|
||||||
github.com/ClickHouse/clickhouse-go/v2 v2.32.2/go.mod h1:/vE8N/+9pozLkIiTMWbNUGviccDv/czEGS1KACvpXIk=
|
github.com/ClickHouse/clickhouse-go/v2 v2.40.1 h1:PbwsHBgqXRydU7jKULD1C8CHmifczffvQqmFvltM2W4=
|
||||||
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
|
github.com/ClickHouse/clickhouse-go/v2 v2.40.1/go.mod h1:GDzSBLVhladVm8V01aEB36IoBOVLLICfyeuiIp/8Ezc=
|
||||||
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
|
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
|
||||||
|
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
|
||||||
|
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
|
||||||
|
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
|
||||||
|
github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8=
|
||||||
|
github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk=
|
||||||
|
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
|
||||||
|
github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||||
|
github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=
|
||||||
|
github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=
|
||||||
|
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||||
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
|
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
|
||||||
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
||||||
|
github.com/cubicdaiya/gonp v1.0.4 h1:ky2uIAJh81WiLcGKBVD5R7KsM/36W6IqqTy6Bo6rGws=
|
||||||
|
github.com/cubicdaiya/gonp v1.0.4/go.mod h1:iWGuP/7+JVTn02OWhRemVbMmG1DOUnmrGTYYACpOI0I=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||||
|
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||||
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||||
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||||
|
github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4=
|
||||||
|
github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
|
||||||
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||||
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||||
github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw=
|
github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw=
|
||||||
@@ -27,33 +46,58 @@ github.com/go-faster/city v1.0.1/go.mod h1:jKcUJId49qdW3L1qKHH/3wPeUstCVpVSXTM6v
|
|||||||
github.com/go-faster/errors v0.7.1 h1:MkJTnDoEdi9pDabt1dpWf7AA8/BaSYZqibYyhZ20AYg=
|
github.com/go-faster/errors v0.7.1 h1:MkJTnDoEdi9pDabt1dpWf7AA8/BaSYZqibYyhZ20AYg=
|
||||||
github.com/go-faster/errors v0.7.1/go.mod h1:5ySTjWFiphBs07IKuiL69nxdfd5+fzh1u7FPGZP2quo=
|
github.com/go-faster/errors v0.7.1/go.mod h1:5ySTjWFiphBs07IKuiL69nxdfd5+fzh1u7FPGZP2quo=
|
||||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||||
github.com/go-sql-driver/mysql v1.9.0 h1:Y0zIbQXhQKmQgTp44Y1dp3wTXcn804QoTptLZT1vtvo=
|
github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=
|
||||||
github.com/go-sql-driver/mysql v1.9.0/go.mod h1:pDetrLJeA3oMujJuvXc8RJoasr589B6A9fwzD3QMrqw=
|
github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
|
||||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||||
|
github.com/gojuno/minimock/v3 v3.0.10 h1:0UbfgdLHaNRPHWF/RFYPkwxV2KI+SE4tR0dDSFMD7+A=
|
||||||
|
github.com/gojuno/minimock/v3 v3.0.10/go.mod h1:CFXcUJYnBe+1QuNzm+WmdPYtvi/+7zQcPcyQGsbcIXg=
|
||||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||||
|
github.com/google/cel-go v0.24.1 h1:jsBCtxG8mM5wiUJDSGUqU0K7Mtr3w7Eyv00rw4DiZxI=
|
||||||
|
github.com/google/cel-go v0.24.1/go.mod h1:Hdf9TqOaTNSFQA1ybQaRqATVoK7m/zcf7IMhGXP5zI8=
|
||||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||||
|
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs=
|
||||||
|
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
||||||
|
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 h1:X5VWvz21y3gzm9Nw/kaUeku/1+uBhcekkmy4IkffJww=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1/go.mod h1:Zanoh4+gvIgluNqcfMVTJueD4wSS5hT7zTt4Mrutd90=
|
||||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||||
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
|
github.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVUrx/c8Unxc48=
|
||||||
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
|
github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw=
|
||||||
|
github.com/hexdigest/gowrap v1.4.2 h1:crtk5lGwHCROa77mKcP/iQ50eh7z6mBjXsg4U492gfc=
|
||||||
|
github.com/hexdigest/gowrap v1.4.2/go.mod h1:s+1hE6qakgdaaLqgdwPAj5qKYVBCSbPJhEbx+I1ef/Q=
|
||||||
|
github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
|
||||||
|
github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI=
|
||||||
|
github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
|
||||||
|
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
|
||||||
|
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
|
||||||
|
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||||
|
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||||
|
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
||||||
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
|
||||||
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
|
||||||
|
github.com/jackc/pgx/v5 v5.7.4 h1:9wKznZrhWa2QiHL+NjTSPP6yjl3451BX3imWDnokYlg=
|
||||||
|
github.com/jackc/pgx/v5 v5.7.4/go.mod h1:ncY89UGWxg82EykZUwSpUKEfccBGGYq1xjrOpsbsfGQ=
|
||||||
|
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
|
||||||
|
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
|
||||||
|
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||||
|
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||||
@@ -68,66 +112,111 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
|||||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||||
github.com/labstack/echo-contrib v0.17.2 h1:K1zivqmtcC70X9VdBFdLomjPDEVHlrcAObqmuFj1c6w=
|
github.com/labstack/echo-contrib v0.17.4 h1:g5mfsrJfJTKv+F5uNKCyrjLK7js+ZW6HTjg4FnDxxgk=
|
||||||
github.com/labstack/echo-contrib v0.17.2/go.mod h1:NeDh3PX7j/u+jR4iuDt1zHmWZSCz9c/p9mxXcDpyS8E=
|
github.com/labstack/echo-contrib v0.17.4/go.mod h1:9O7ZPAHUeMGTOAfg80YqQduHzt0CzLak36PZRldYrZ0=
|
||||||
github.com/labstack/echo/v4 v4.13.3 h1:pwhpCPrTl5qry5HRdM5FwdXnhXSLSY+WE+YQSeCaafY=
|
github.com/labstack/echo/v4 v4.13.4 h1:oTZZW+T3s9gAu5L8vmzihV7/lkXGZuITzTQkTEhcXEA=
|
||||||
github.com/labstack/echo/v4 v4.13.3/go.mod h1:o90YNEeQWjDozo584l7AwhJMHN0bOC4tAfg+Xox9q5g=
|
github.com/labstack/echo/v4 v4.13.4/go.mod h1:g63b33BZ5vZzcIUF8AtRH40DrTlXnx4UMC8rBdndmjQ=
|
||||||
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
|
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
|
||||||
github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
|
github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
|
||||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
|
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
|
||||||
|
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
|
||||||
|
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
|
||||||
|
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
|
||||||
|
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
|
||||||
|
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
|
||||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||||
|
github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
|
||||||
|
github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
||||||
github.com/paulmach/orb v0.11.1 h1:3koVegMC4X/WeiXYz9iswopaTwMem53NzTJuTF20JzU=
|
github.com/paulmach/orb v0.11.1 h1:3koVegMC4X/WeiXYz9iswopaTwMem53NzTJuTF20JzU=
|
||||||
github.com/paulmach/orb v0.11.1/go.mod h1:5mULz1xQfs3bmQm63QEJA6lNGujuRafwA5S/EnuLaLU=
|
github.com/paulmach/orb v0.11.1/go.mod h1:5mULz1xQfs3bmQm63QEJA6lNGujuRafwA5S/EnuLaLU=
|
||||||
github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY=
|
github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY=
|
||||||
|
github.com/pganalyze/pg_query_go/v6 v6.1.0 h1:jG5ZLhcVgL1FAw4C/0VNQaVmX1SUJx71wBGdtTtBvls=
|
||||||
|
github.com/pganalyze/pg_query_go/v6 v6.1.0/go.mod h1:nvTHIuoud6e1SfrUaFwHqT0i4b5Nr+1rPWVds3B5+50=
|
||||||
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=
|
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=
|
||||||
github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||||
|
github.com/pingcap/errors v0.11.0/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
|
||||||
|
github.com/pingcap/errors v0.11.5-0.20240311024730-e056997136bb h1:3pSi4EDG6hg0orE1ndHkXvX6Qdq2cZn8gAPir8ymKZk=
|
||||||
|
github.com/pingcap/errors v0.11.5-0.20240311024730-e056997136bb/go.mod h1:X2r9ueLEUZgtx2cIogM0v4Zj5uvvzhuuiu7Pn8HzMPg=
|
||||||
|
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86 h1:tdMsjOqUR7YXHoBitzdebTvOjs/swniBTOLy5XiMtuE=
|
||||||
|
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86/go.mod h1:exzhVYca3WRtd6gclGNErRWb1qEgff3LYta0LvRmON4=
|
||||||
|
github.com/pingcap/log v1.1.0 h1:ELiPxACz7vdo1qAvvaWJg1NrYFoY6gqAh/+Uo6aXdD8=
|
||||||
|
github.com/pingcap/log v1.1.0/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4=
|
||||||
|
github.com/pingcap/tidb/pkg/parser v0.0.0-20250324122243-d51e00e5bbf0 h1:W3rpAI3bubR6VWOcwxDIG0Gz9G5rl5b3SL116T0vBt0=
|
||||||
|
github.com/pingcap/tidb/pkg/parser v0.0.0-20250324122243-d51e00e5bbf0/go.mod h1:+8feuexTKcXHZF/dkDfvCwEyBAmgb4paFc3/WeYV2eE=
|
||||||
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/prometheus/client_golang v1.21.0 h1:DIsaGmiaBkSangBgMtWdNfxbMNdku5IK6iNhrEqWvdA=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
github.com/prometheus/client_golang v1.21.0/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
|
github.com/prometheus/client_golang v1.23.0 h1:ust4zpdl9r4trLY/gSjlm07PuiBq2ynaXXlptpfy8Uc=
|
||||||
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
|
github.com/prometheus/client_golang v1.23.0/go.mod h1:i/o0R9ByOnHX0McrTMTyhYvKE4haaf2mW08I+jGAjEE=
|
||||||
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
|
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
|
||||||
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
|
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
|
||||||
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
|
github.com/prometheus/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE=
|
||||||
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
github.com/prometheus/common v0.65.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8=
|
||||||
github.com/remychantenay/slog-otel v1.3.3 h1:Atk1p630QPgYFW4/YEyBuObNmwrYpx5Tglnl1sdhSVA=
|
github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=
|
||||||
github.com/remychantenay/slog-otel v1.3.3/go.mod h1:OMdQAB/S2341nbz2Ramh3+RH2yYGLJLspTaghiCToTU=
|
github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=
|
||||||
|
github.com/remychantenay/slog-otel v1.3.4 h1:xoM41ayLff2U8zlK5PH31XwD7Lk3W9wKfl4+RcmKom4=
|
||||||
|
github.com/remychantenay/slog-otel v1.3.4/go.mod h1:ZkazuFMICKGDrO0r1njxKRdjTt/YcXKn6v2+0q/b0+U=
|
||||||
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
||||||
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||||
|
github.com/riza-io/grpc-go v0.2.0 h1:2HxQKFVE7VuYstcJ8zqpN84VnAoJ4dCL6YFhJewNcHQ=
|
||||||
|
github.com/riza-io/grpc-go v0.2.0/go.mod h1:2bDvR9KkKC3KhtlSHfR3dAXjUMT86kg4UfWFyVGWqi8=
|
||||||
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
||||||
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/samber/lo v1.49.1 h1:4BIFyVfuQSEpluc7Fua+j1NolZHiEHEpaSEKdsH0tew=
|
github.com/samber/lo v1.51.0 h1:kysRYLbHy/MB7kQZf5DSN50JHmMsNEdeY24VzJFu7wI=
|
||||||
github.com/samber/lo v1.49.1/go.mod h1:dO6KHFzUKXgP8LDhU0oI8d2hekjXnGOu0DB8Jecxd6o=
|
github.com/samber/lo v1.51.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
|
||||||
github.com/samber/slog-echo v1.15.1 h1:mzeQNPYPxmpehIRtgQJRgJMVvrRbZHp5D2maxSljTBw=
|
github.com/samber/slog-common v0.19.0 h1:fNcZb8B2uOLooeYwFpAlKjkQTUafdjfqKcwcC89G9YI=
|
||||||
github.com/samber/slog-echo v1.15.1/go.mod h1:K21nbusPmai/MYm8PFactmZoFctkMmkeaTdXXyvhY1c=
|
github.com/samber/slog-common v0.19.0/go.mod h1:dTz+YOU76aH007YUU0DffsXNsGFQRQllPQh9XyNoA3M=
|
||||||
github.com/samber/slog-multi v1.4.0 h1:pwlPMIE7PrbTHQyKWDU+RIoxP1+HKTNOujk3/kdkbdg=
|
github.com/samber/slog-echo v1.16.1 h1:5Q5IUROkFqKcu/qJM/13AP1d3gd1RS+Q/4EvKQU1fuo=
|
||||||
github.com/samber/slog-multi v1.4.0/go.mod h1:FsQ4Uv2L+E/8TZt+/BVgYZ1LoDWCbfCU21wVIoMMrO8=
|
github.com/samber/slog-echo v1.16.1/go.mod h1:f+B3WR06saRXcaGRZ/I/UPCECDPqTUqadRIf7TmyRhI=
|
||||||
|
github.com/samber/slog-multi v1.4.1 h1:OVBxOKcorBcGQVKjwlraA41JKWwHQyB/3KfzL3IJAYg=
|
||||||
|
github.com/samber/slog-multi v1.4.1/go.mod h1:im2Zi3mH/ivSY5XDj6LFcKToRIWPw1OcjSVSdXt+2d0=
|
||||||
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
|
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
|
||||||
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
|
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
|
||||||
|
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
||||||
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
|
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
|
||||||
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
|
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
|
||||||
|
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||||
|
github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA=
|
||||||
|
github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||||
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
|
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
|
||||||
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
|
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
|
||||||
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
|
|
||||||
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M=
|
||||||
|
github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
github.com/sqlc-dev/sqlc v1.29.0 h1:HQctoD7y/i29Bao53qXO7CZ/BV9NcvpGpsJWvz9nKWs=
|
||||||
|
github.com/sqlc-dev/sqlc v1.29.0/go.mod h1:BavmYw11px5AdPOjAVHmb9fctP5A8GTziC38wBF9tp0=
|
||||||
|
github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU=
|
||||||
|
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
|
github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I=
|
||||||
|
github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM=
|
||||||
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||||
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
|
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
|
||||||
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||||
|
github.com/wasilibs/go-pgquery v0.0.0-20250409022910-10ac41983c07 h1:mJdDDPblDfPe7z7go8Dvv1AJQDI3eQ/5xith3q2mFlo=
|
||||||
|
github.com/wasilibs/go-pgquery v0.0.0-20250409022910-10ac41983c07/go.mod h1:Ak17IJ037caFp4jpCw/iQQ7/W74Sqpb1YuKJU6HTKfM=
|
||||||
|
github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52 h1:OvLBa8SqJnZ6P+mjlzc2K7PM22rRUPE1x32G9DTPrC4=
|
||||||
|
github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52/go.mod h1:jMeV4Vpbi8osrE/pKUxRZkVaA0EX7NZN0A9/oRzgpgY=
|
||||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||||
github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
|
github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
|
||||||
github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
|
github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
|
||||||
@@ -139,87 +228,107 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
|
|||||||
go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g=
|
go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g=
|
||||||
go.ntppool.org/api v0.3.4 h1:KeRyFhIRkjJwZif7hkpqEDEBmukyYGiOi2Fd6j3UzQ0=
|
go.ntppool.org/api v0.3.4 h1:KeRyFhIRkjJwZif7hkpqEDEBmukyYGiOi2Fd6j3UzQ0=
|
||||||
go.ntppool.org/api v0.3.4/go.mod h1:LFLAwnrc/JyjzKnjgf8tCOJhps6oFIjuledS3PCx7xc=
|
go.ntppool.org/api v0.3.4/go.mod h1:LFLAwnrc/JyjzKnjgf8tCOJhps6oFIjuledS3PCx7xc=
|
||||||
go.ntppool.org/common v0.3.2-0.20250126190844-e5836a8b97f6 h1:Lef+V8gAGHMYj/oc91A384d7wzIVPk6k3VNbNlRsSEc=
|
go.ntppool.org/common v0.5.1 h1:MSkfNGLBosqmbnYJxX/fCAE9kaAgUWeOZ4zQNWWrs6o=
|
||||||
go.ntppool.org/common v0.3.2-0.20250126190844-e5836a8b97f6/go.mod h1:8ILmR3KxpUSNofcw9EBG42HNf81Z9iu9Fg1Cj0f/WP0=
|
go.ntppool.org/common v0.5.1/go.mod h1:e5ohROK9LdZZTI1neNiSlmgmWC23F779qzLvSi4JzyI=
|
||||||
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
||||||
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
||||||
go.opentelemetry.io/contrib/bridges/otelslog v0.9.0 h1:N+78eXSlu09kii5nkiM+01YbtWe01oZLPPLhNlEKhus=
|
go.opentelemetry.io/contrib/bridges/otelslog v0.12.0 h1:lFM7SZo8Ce01RzRfnUFQZEYeWRf/MtOA3A5MobOqk2g=
|
||||||
go.opentelemetry.io/contrib/bridges/otelslog v0.9.0/go.mod h1:/2KhfLAhtQpgnhIk1f+dftA3fuuMcZjiz//Dc9yfaEs=
|
go.opentelemetry.io/contrib/bridges/otelslog v0.12.0/go.mod h1:Dw05mhFtrKAYu72Tkb3YBYeQpRUJ4quDgo2DQw3No5A=
|
||||||
go.opentelemetry.io/contrib/bridges/prometheus v0.59.0 h1:HY2hJ7yn3KuEBBBsKxvF3ViSmzLwsgeNvD+0utRMgzc=
|
go.opentelemetry.io/contrib/bridges/prometheus v0.62.0 h1:0mfk3D3068LMGpIhxwc0BqRlBOBHVgTP9CygmnJM/TI=
|
||||||
go.opentelemetry.io/contrib/bridges/prometheus v0.59.0/go.mod h1:H4H7vs8766kwFnOZVEGMJFVF+phpBSmTckvvNRdJeDI=
|
go.opentelemetry.io/contrib/bridges/prometheus v0.62.0/go.mod h1:hStk98NJy1wvlrXIqWsli+uELxRRseBMld+gfm2xPR4=
|
||||||
go.opentelemetry.io/contrib/exporters/autoexport v0.59.0 h1:dKhAFwh7SSoOw+gwMtSv+XLkUGTFAwAGMT3X3XSE4FA=
|
go.opentelemetry.io/contrib/exporters/autoexport v0.62.0 h1:aCpZ6vvmOj5GHg1eUygjS/05mlQaEBsQDdTw5yT8EsE=
|
||||||
go.opentelemetry.io/contrib/exporters/autoexport v0.59.0/go.mod h1:fPl+qlrhRdRntIpPs9JoQ0iBKAsnH5VkgppU1f9kyF4=
|
go.opentelemetry.io/contrib/exporters/autoexport v0.62.0/go.mod h1:1xHkmmL3bQm8m86HVoZTdgK/LIY5JpxdAWjog6cdtUs=
|
||||||
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.59.0 h1:I8k9HW4yl8SRYNmECKKtjhcOvq9lAP9riqYPixBU3qw=
|
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.62.0 h1:b3/7WwVpLaIBTXHz6vp04idQOu02K0MFrkhF2ls7DbQ=
|
||||||
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.59.0/go.mod h1:/vTiuiSKBQAerQeMB3CsVJbXd+cvTbhcdOk5AV5Z5R0=
|
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.62.0/go.mod h1:aHqs9aFRWZBvil6ClpaKd/+bZ+o30+Q7xjcgMaSvuRw=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.59.0 h1:iQZYNQ7WwIcYXzOPR46FQv9O0dS1PW16RjvR0TjDOe8=
|
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.62.0 h1:wCeciVlAfb5DC8MQl/DlmAv/FVPNpQgFvI/71+hatuc=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.59.0/go.mod h1:54CaSNqYEXvpzDh8KPjiMVoWm60t5R0dZRt0leEPgAs=
|
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.62.0/go.mod h1:WfEApdZDMlLUAev/0QQpr8EJ/z0VWDKYZ5tF5RH5T1U=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 h1:CV7UdSGJt/Ao6Gp4CXckLxVRRsRgDHoI8XjbL3PDl8s=
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 h1:Hf9xI/XLML9ElpiHVDNwvqI0hIFlzV8dgIr35kV1kRU=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0/go.mod h1:FRmFuRJfag1IZ2dPkHnEoSFVgTVPUd2qf5Vi69hLb8I=
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0/go.mod h1:NfchwuyNoMcZ5MLHwPrODwUF1HWCXWrL31s8gSAdIKY=
|
||||||
go.opentelemetry.io/contrib/propagators/b3 v1.34.0 h1:9pQdCEvV/6RWQmag94D6rhU+A4rzUhYBEJ8bpscx5p8=
|
go.opentelemetry.io/contrib/propagators/b3 v1.37.0 h1:0aGKdIuVhy5l4GClAjl72ntkZJhijf2wg1S7b5oLoYA=
|
||||||
go.opentelemetry.io/contrib/propagators/b3 v1.34.0/go.mod h1:FwM71WS8i1/mAK4n48t0KU6qUS/OZRBgDrHZv3RlJ+w=
|
go.opentelemetry.io/contrib/propagators/b3 v1.37.0/go.mod h1:nhyrxEJEOQdwR15zXrCKI6+cJK60PXAkJ/jRyfhr2mg=
|
||||||
go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
|
go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
|
||||||
go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
|
go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.10.0 h1:5dTKu4I5Dn4P2hxyW3l3jTaZx9ACgg0ECos1eAVrheY=
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.13.0 h1:z6lNIajgEBVtQZHjfw2hAccPEBDs+nx58VemmXWa2ec=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.10.0/go.mod h1:P5HcUI8obLrCCmM3sbVBohZFH34iszk/+CPWuakZWL8=
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.13.0/go.mod h1:+kyc3bRx/Qkq05P6OCu3mTEIOxYRYzoIg+JsUp5X+PM=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.10.0 h1:q/heq5Zh8xV1+7GoMGJpTxM2Lhq5+bFxB29tshuRuw0=
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.13.0 h1:zUfYw8cscHHLwaY8Xz3fiJu+R59xBnkgq2Zr1lwmK/0=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.10.0/go.mod h1:leO2CSTg0Y+LyvmR7Wm4pUxE8KAmaM2GCVx7O+RATLA=
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.13.0/go.mod h1:514JLMCcFLQFS8cnTepOk6I09cKWJ5nGHBxHrMJ8Yfg=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 h1:ajl4QczuJVA2TU9W9AGw++86Xga/RKt//16z/yxPgdk=
|
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.37.0 h1:zG8GlgXCJQd5BU98C0hZnBbElszTmUgCNCfYneaDL0A=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0/go.mod h1:Vn3/rlOJ3ntf/Q3zAI0V5lDnTbHGaUsNUeF6nZmm7pA=
|
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.37.0/go.mod h1:hOfBCz8kv/wuq73Mx2H2QnWokh/kHZxkh6SNF2bdKtw=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.34.0 h1:opwv08VbCZ8iecIWs+McMdHRcAXzjAeda3uG2kI/hcA=
|
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.37.0 h1:9PgnL3QNlj10uGxExowIDIZu66aVBwWhXmbOp1pa6RA=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.34.0/go.mod h1:oOP3ABpW7vFHulLpE8aYtNBodrHhMTrvfxUXGvqm7Ac=
|
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.37.0/go.mod h1:0ineDcLELf6JmKfuo0wvvhAVMuxWFYvkTin2iV4ydPQ=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 h1:Ahq7pZmv87yiyn3jeFz/LekZmPLLdKejuO3NcK9MssM=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0/go.mod h1:MJTqhM0im3mRLw1i8uGHnCvUEeS7VwRyxlLC78PA18M=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.37.0 h1:EtFWSnwW9hGObjkIdmlnWSydO+Qs8OwzfzXLUPg4xOc=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.37.0/go.mod h1:QjUEoiGCPkvFZ/MjK6ZZfNOS6mfVEVKYE99dFhuN2LI=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 h1:BEj3SPM81McUZHYjRS5pEgNgnmzGJ5tRpU5krWnV8Bs=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.37.0 h1:bDMKF3RUSxshZ5OjOTi8rsHGaPKsAt76FaqgvIUySLc=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0/go.mod h1:9cKLGBDzI/F3NoHLQGm4ZrYdIHsvGt6ej6hUowxY0J4=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.37.0/go.mod h1:dDT67G/IkA46Mr2l9Uj7HsQVwsjASyV9SjGofsiUZDA=
|
||||||
go.opentelemetry.io/otel/exporters/prometheus v0.56.0 h1:GnCIi0QyG0yy2MrJLzVrIM7laaJstj//flf1zEJCG+E=
|
go.opentelemetry.io/otel/exporters/prometheus v0.59.0 h1:HHf+wKS6o5++XZhS98wvILrLVgHxjA/AMjqHKes+uzo=
|
||||||
go.opentelemetry.io/otel/exporters/prometheus v0.56.0/go.mod h1:JQcVZtbIIPM+7SWBB+T6FK+xunlyidwLp++fN0sUaOk=
|
go.opentelemetry.io/otel/exporters/prometheus v0.59.0/go.mod h1:R8GpRXTZrqvXHDEGVH5bF6+JqAZcK8PjJcZ5nGhEWiE=
|
||||||
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.10.0 h1:GKCEAZLEpEf78cUvudQdTg0aET2ObOZRB2HtXA0qPAI=
|
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 h1:yEX3aC9KDgvYPhuKECHbOlr5GLwH6KTjLJ1sBSkkxkc=
|
||||||
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.10.0/go.mod h1:9/zqSWLCmHT/9Jo6fYeUDRRogOLL60ABLsHWS99lF8s=
|
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0/go.mod h1:/GXR0tBmmkxDaCUGahvksvp66mx4yh5+cFXgSlhg0vQ=
|
||||||
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.34.0 h1:czJDQwFrMbOr9Kk+BPo1y8WZIIFIK58SA1kykuVeiOU=
|
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.37.0 h1:6VjV6Et+1Hd2iLZEPtdV7vie80Yyqf7oikJLjQ/myi0=
|
||||||
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.34.0/go.mod h1:lT7bmsxOe58Tq+JIOkTQMCGXdu47oA+VJKLZHbaBKbs=
|
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.37.0/go.mod h1:u8hcp8ji5gaM/RfcOo8z9NMnf1pVLfVY7lBY2VOGuUU=
|
||||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.34.0 h1:jBpDk4HAUsrnVO1FsfCfCOTEc/MkInJmvfCHYLFiT80=
|
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.37.0 h1:SNhVp/9q4Go/XHBkQ1/d5u9P/U+L1yaGPoi0x+mStaI=
|
||||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.34.0/go.mod h1:H9LUIM1daaeZaz91vZcfeM0fejXPmgCYE8ZhzqfJuiU=
|
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.37.0/go.mod h1:tx8OOlGH6R4kLV67YaYO44GFXloEjGPZuMjEkaaqIp4=
|
||||||
go.opentelemetry.io/otel/log v0.10.0 h1:1CXmspaRITvFcjA4kyVszuG4HjA61fPDxMb7q3BuyF0=
|
go.opentelemetry.io/otel/log v0.13.0 h1:yoxRoIZcohB6Xf0lNv9QIyCzQvrtGZklVbdCoyb7dls=
|
||||||
go.opentelemetry.io/otel/log v0.10.0/go.mod h1:PbVdm9bXKku/gL0oFfUF4wwsQsOPlpo4VEqjvxih+FM=
|
go.opentelemetry.io/otel/log v0.13.0/go.mod h1:INKfG4k1O9CL25BaM1qLe0zIedOpvlS5Z7XgSbmN83E=
|
||||||
go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
|
go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
|
||||||
go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
|
go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
|
||||||
go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
|
go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
|
||||||
go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
|
go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg=
|
||||||
go.opentelemetry.io/otel/sdk/log v0.10.0 h1:lR4teQGWfeDVGoute6l0Ou+RpFqQ9vaPdrNJlST0bvw=
|
go.opentelemetry.io/otel/sdk/log v0.13.0 h1:I3CGUszjM926OphK8ZdzF+kLqFvfRY/IIoFq/TjwfaQ=
|
||||||
go.opentelemetry.io/otel/sdk/log v0.10.0/go.mod h1:A+V1UTWREhWAittaQEG4bYm4gAZa6xnvVu+xKrIRkzo=
|
go.opentelemetry.io/otel/sdk/log v0.13.0/go.mod h1:lOrQyCCXmpZdN7NchXb6DOZZa1N5G1R2tm5GMMTpDBw=
|
||||||
go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
|
go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLlHNxurno5BreMtIA=
|
||||||
go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
|
go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168=
|
||||||
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
|
go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc=
|
||||||
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
|
go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps=
|
||||||
go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
|
go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
|
||||||
go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
|
go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
|
||||||
|
go.opentelemetry.io/proto/otlp v1.7.1 h1:gTOMpGDb0WTBOP8JaO72iL3auEZhVmAQg4ipjOVAtj4=
|
||||||
|
go.opentelemetry.io/proto/otlp v1.7.1/go.mod h1:b2rVh6rfI/s2pHWNlB7ILJcRALpcNDzKhACevjI+ZnE=
|
||||||
|
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||||
|
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||||
|
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||||
|
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
|
||||||
|
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
|
||||||
|
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
|
||||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||||
|
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
||||||
|
go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak=
|
||||||
|
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||||
|
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||||
|
go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=
|
||||||
|
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||||
|
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
golang.org/x/crypto v0.34.0 h1:+/C6tk6rf/+t5DhUketUbD1aNGqiSX3j15Z6xuIDlBA=
|
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
|
||||||
golang.org/x/crypto v0.34.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
|
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
|
||||||
|
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw=
|
||||||
|
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM=
|
||||||
|
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
|
golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg=
|
||||||
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ=
|
||||||
|
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
|
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
|
||||||
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
|
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
|
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
|
||||||
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
@@ -227,39 +336,78 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
|
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
|
||||||
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
|
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
|
||||||
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
|
||||||
golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4=
|
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
|
||||||
golang.org/x/time v0.10.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
|
||||||
|
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20250219182151-9fdb1cabc7b2 h1:35ZFtrCgaAjF7AFAK0+lRSf+4AyYnWRbH7og13p7rZ4=
|
google.golang.org/genproto/googleapis/api v0.0.0-20250728155136-f173205681a0 h1:0UOBWO4dC+e51ui0NFKSPbkHHiQ4TmrEfEZMLDyRmY8=
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20250219182151-9fdb1cabc7b2/go.mod h1:W9ynFDP/shebLB1Hl/ESTOap2jHd6pmLXPNZC7SVDbA=
|
google.golang.org/genproto/googleapis/api v0.0.0-20250728155136-f173205681a0/go.mod h1:8ytArBbtOy2xfht+y2fqKd5DRDJRUQhqbyEnQ4bDChs=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 h1:DMTIbak9GhdaSxEjvVzAeNZvyc03I61duqNbnm3SU0M=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 h1:MAKi5q709QWfnkkpNQ0M12hYJ1+e8qYVDyowc4U1XZM=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
|
||||||
google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ=
|
google.golang.org/grpc v1.74.2 h1:WoosgB65DlWVC9FqI82dGsZhWFNBSLjQ84bjROOpMu4=
|
||||||
google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw=
|
google.golang.org/grpc v1.74.2/go.mod h1:CtQ+BGjaAIXHs/5YS3i473GqwBBa1zGQNevxdeBEXrM=
|
||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
|
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||||
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||||
|
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
|
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
|
||||||
|
gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
|
||||||
|
gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
|
||||||
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
modernc.org/cc/v4 v4.25.2 h1:T2oH7sZdGvTaie0BRNFbIYsabzCxUQg8nLqCdQ2i0ic=
|
||||||
|
modernc.org/cc/v4 v4.25.2/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=
|
||||||
|
modernc.org/ccgo/v4 v4.25.1 h1:TFSzPrAGmDsdnhT9X2UrcPMI3N/mJ9/X9ykKXwLhDsU=
|
||||||
|
modernc.org/ccgo/v4 v4.25.1/go.mod h1:njjuAYiPflywOOrm3B7kCB444ONP5pAVr8PIEoE0uDw=
|
||||||
|
modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE=
|
||||||
|
modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ=
|
||||||
|
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
|
||||||
|
modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito=
|
||||||
|
modernc.org/libc v1.62.1 h1:s0+fv5E3FymN8eJVmnk0llBe6rOxCu/DEU+XygRbS8s=
|
||||||
|
modernc.org/libc v1.62.1/go.mod h1:iXhATfJQLjG3NWy56a6WVU73lWOcdYVxsvwCgoPljuo=
|
||||||
|
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
||||||
|
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
||||||
|
modernc.org/memory v1.9.1 h1:V/Z1solwAVmMW1yttq3nDdZPJqV1rM05Ccq6KMSZ34g=
|
||||||
|
modernc.org/memory v1.9.1/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
|
||||||
|
modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8=
|
||||||
|
modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
|
||||||
|
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
|
||||||
|
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
|
||||||
|
modernc.org/sqlite v1.37.0 h1:s1TMe7T3Q3ovQiK2Ouz4Jwh7dw4ZDqbebSDTlSJdfjI=
|
||||||
|
modernc.org/sqlite v1.37.0/go.mod h1:5YiWv+YviqGMuGw4V+PNplcyaJ5v+vQd7TQOgkACoJM=
|
||||||
|
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
|
||||||
|
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
|
||||||
|
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
|
||||||
|
modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
||||||
|
|||||||
105
mocks/Querier.go
105
mocks/Querier.go
@@ -1,105 +0,0 @@
|
|||||||
// Code generated by mockery v2.35.4. DO NOT EDIT.
|
|
||||||
|
|
||||||
package mocks
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
|
|
||||||
mock "github.com/stretchr/testify/mock"
|
|
||||||
ntpdb "go.ntppool.org/data-api/ntpdb"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Querier is an autogenerated mock type for the Querier type
|
|
||||||
type Querier struct {
|
|
||||||
mock.Mock
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetServerNetspeed provides a mock function with given fields: ctx, ip
|
|
||||||
func (_m *Querier) GetServerNetspeed(ctx context.Context, ip string) (uint32, error) {
|
|
||||||
ret := _m.Called(ctx, ip)
|
|
||||||
|
|
||||||
var r0 uint32
|
|
||||||
var r1 error
|
|
||||||
if rf, ok := ret.Get(0).(func(context.Context, string) (uint32, error)); ok {
|
|
||||||
return rf(ctx, ip)
|
|
||||||
}
|
|
||||||
if rf, ok := ret.Get(0).(func(context.Context, string) uint32); ok {
|
|
||||||
r0 = rf(ctx, ip)
|
|
||||||
} else {
|
|
||||||
r0 = ret.Get(0).(uint32)
|
|
||||||
}
|
|
||||||
|
|
||||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
||||||
r1 = rf(ctx, ip)
|
|
||||||
} else {
|
|
||||||
r1 = ret.Error(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
return r0, r1
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetZoneStatsData provides a mock function with given fields: ctx
|
|
||||||
func (_m *Querier) GetZoneStatsData(ctx context.Context) ([]ntpdb.GetZoneStatsDataRow, error) {
|
|
||||||
ret := _m.Called(ctx)
|
|
||||||
|
|
||||||
var r0 []ntpdb.GetZoneStatsDataRow
|
|
||||||
var r1 error
|
|
||||||
if rf, ok := ret.Get(0).(func(context.Context) ([]ntpdb.GetZoneStatsDataRow, error)); ok {
|
|
||||||
return rf(ctx)
|
|
||||||
}
|
|
||||||
if rf, ok := ret.Get(0).(func(context.Context) []ntpdb.GetZoneStatsDataRow); ok {
|
|
||||||
r0 = rf(ctx)
|
|
||||||
} else {
|
|
||||||
if ret.Get(0) != nil {
|
|
||||||
r0 = ret.Get(0).([]ntpdb.GetZoneStatsDataRow)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
|
||||||
r1 = rf(ctx)
|
|
||||||
} else {
|
|
||||||
r1 = ret.Error(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
return r0, r1
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetZoneStatsV2 provides a mock function with given fields: ctx, ip
|
|
||||||
func (_m *Querier) GetZoneStatsV2(ctx context.Context, ip string) ([]ntpdb.GetZoneStatsV2Row, error) {
|
|
||||||
ret := _m.Called(ctx, ip)
|
|
||||||
|
|
||||||
var r0 []ntpdb.GetZoneStatsV2Row
|
|
||||||
var r1 error
|
|
||||||
if rf, ok := ret.Get(0).(func(context.Context, string) ([]ntpdb.GetZoneStatsV2Row, error)); ok {
|
|
||||||
return rf(ctx, ip)
|
|
||||||
}
|
|
||||||
if rf, ok := ret.Get(0).(func(context.Context, string) []ntpdb.GetZoneStatsV2Row); ok {
|
|
||||||
r0 = rf(ctx, ip)
|
|
||||||
} else {
|
|
||||||
if ret.Get(0) != nil {
|
|
||||||
r0 = ret.Get(0).([]ntpdb.GetZoneStatsV2Row)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
||||||
r1 = rf(ctx, ip)
|
|
||||||
} else {
|
|
||||||
r1 = ret.Error(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
return r0, r1
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewQuerier creates a new instance of Querier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
||||||
// The first argument is typically a *testing.T value.
|
|
||||||
func NewQuerier(t interface {
|
|
||||||
mock.TestingT
|
|
||||||
Cleanup(func())
|
|
||||||
}) *Querier {
|
|
||||||
mock := &Querier{}
|
|
||||||
mock.Mock.Test(t)
|
|
||||||
|
|
||||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
||||||
|
|
||||||
return mock
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by sqlc. DO NOT EDIT.
|
// Code generated by sqlc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// sqlc v1.28.0
|
// sqlc v1.29.0
|
||||||
|
|
||||||
package ntpdb
|
package ntpdb
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by sqlc. DO NOT EDIT.
|
// Code generated by sqlc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// sqlc v1.28.0
|
// sqlc v1.29.0
|
||||||
|
|
||||||
package ntpdb
|
package ntpdb
|
||||||
|
|
||||||
@@ -146,6 +146,7 @@ type ServerScoresStatus string
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
ServerScoresStatusNew ServerScoresStatus = "new"
|
ServerScoresStatusNew ServerScoresStatus = "new"
|
||||||
|
ServerScoresStatusCandidate ServerScoresStatus = "candidate"
|
||||||
ServerScoresStatusTesting ServerScoresStatus = "testing"
|
ServerScoresStatusTesting ServerScoresStatus = "testing"
|
||||||
ServerScoresStatusActive ServerScoresStatus = "active"
|
ServerScoresStatusActive ServerScoresStatus = "active"
|
||||||
)
|
)
|
||||||
@@ -283,10 +284,11 @@ type LogScore struct {
|
|||||||
|
|
||||||
type Monitor struct {
|
type Monitor struct {
|
||||||
ID uint32 `db:"id" json:"id"`
|
ID uint32 `db:"id" json:"id"`
|
||||||
|
IDToken sql.NullString `db:"id_token" json:"id_token"`
|
||||||
Type MonitorsType `db:"type" json:"type"`
|
Type MonitorsType `db:"type" json:"type"`
|
||||||
UserID sql.NullInt32 `db:"user_id" json:"user_id"`
|
UserID sql.NullInt32 `db:"user_id" json:"user_id"`
|
||||||
AccountID sql.NullInt32 `db:"account_id" json:"account_id"`
|
AccountID sql.NullInt32 `db:"account_id" json:"account_id"`
|
||||||
Name string `db:"name" json:"name"`
|
Hostname string `db:"hostname" json:"hostname"`
|
||||||
Location string `db:"location" json:"location"`
|
Location string `db:"location" json:"location"`
|
||||||
Ip sql.NullString `db:"ip" json:"ip"`
|
Ip sql.NullString `db:"ip" json:"ip"`
|
||||||
IpVersion NullMonitorsIpVersion `db:"ip_version" json:"ip_version"`
|
IpVersion NullMonitorsIpVersion `db:"ip_version" json:"ip_version"`
|
||||||
@@ -298,6 +300,8 @@ type Monitor struct {
|
|||||||
LastSeen sql.NullTime `db:"last_seen" json:"last_seen"`
|
LastSeen sql.NullTime `db:"last_seen" json:"last_seen"`
|
||||||
LastSubmit sql.NullTime `db:"last_submit" json:"last_submit"`
|
LastSubmit sql.NullTime `db:"last_submit" json:"last_submit"`
|
||||||
CreatedOn time.Time `db:"created_on" json:"created_on"`
|
CreatedOn time.Time `db:"created_on" json:"created_on"`
|
||||||
|
DeletedOn sql.NullTime `db:"deleted_on" json:"deleted_on"`
|
||||||
|
IsCurrent sql.NullBool `db:"is_current" json:"is_current"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Server struct {
|
type Server struct {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
|
|
||||||
func (m *Monitor) DisplayName() string {
|
func (m *Monitor) DisplayName() string {
|
||||||
switch {
|
switch {
|
||||||
case len(m.Name) > 0:
|
// case len(m.Hostname) > 0:
|
||||||
return m.Name
|
// return m.Hostname
|
||||||
case m.TlsName.Valid && len(m.TlsName.String) > 0:
|
case m.TlsName.Valid && len(m.TlsName.String) > 0:
|
||||||
name := m.TlsName.String
|
name := m.TlsName.String
|
||||||
if idx := strings.Index(name, "."); idx > 0 {
|
if idx := strings.Index(name, "."); idx > 0 {
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
// Code generated by gowrap. DO NOT EDIT.
|
// Code generated by gowrap. DO NOT EDIT.
|
||||||
// template: https://raw.githubusercontent.com/hexdigest/gowrap/6c8f05695fec23df85903a8da0af66ac414e2a63/templates/opentelemetry
|
// template: https://raw.githubusercontent.com/hexdigest/gowrap/6bd1bc023b4d2a619f30020924f258b8ff665a7a/templates/opentelemetry
|
||||||
// gowrap: http://github.com/hexdigest/gowrap
|
// gowrap: http://github.com/hexdigest/gowrap
|
||||||
|
|
||||||
package ntpdb
|
package ntpdb
|
||||||
|
|
||||||
//go:generate gowrap gen -p go.ntppool.org/data-api/ntpdb -i QuerierTx -t https://raw.githubusercontent.com/hexdigest/gowrap/6c8f05695fec23df85903a8da0af66ac414e2a63/templates/opentelemetry -o otel.go -l ""
|
//go:generate gowrap gen -p go.ntppool.org/data-api/ntpdb -i QuerierTx -t https://raw.githubusercontent.com/hexdigest/gowrap/6bd1bc023b4d2a619f30020924f258b8ff665a7a/templates/opentelemetry -o otel.go -l ""
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
|
||||||
|
|
||||||
"go.opentelemetry.io/otel"
|
"go.opentelemetry.io/otel"
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
|
_codes "go.opentelemetry.io/otel/codes"
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
)
|
)
|
||||||
|
|
||||||
// QuerierTxWithTracing implements QuerierTx interface instrumented with opentracing spans
|
// QuerierTxWithTracing implements QuerierTx interface instrumented with open telemetry spans
|
||||||
type QuerierTxWithTracing struct {
|
type QuerierTxWithTracing struct {
|
||||||
QuerierTx
|
QuerierTx
|
||||||
_instance string
|
_instance string
|
||||||
@@ -47,6 +47,7 @@ func (_d QuerierTxWithTracing) Begin(ctx context.Context) (q1 QuerierTx, err err
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -68,6 +69,7 @@ func (_d QuerierTxWithTracing) Commit(ctx context.Context) (err error) {
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -79,18 +81,19 @@ func (_d QuerierTxWithTracing) Commit(ctx context.Context) (err error) {
|
|||||||
return _d.QuerierTx.Commit(ctx)
|
return _d.QuerierTx.Commit(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetMonitorByName implements QuerierTx
|
// GetMonitorByNameAndIPVersion implements QuerierTx
|
||||||
func (_d QuerierTxWithTracing) GetMonitorByName(ctx context.Context, tlsName sql.NullString) (m1 Monitor, err error) {
|
func (_d QuerierTxWithTracing) GetMonitorByNameAndIPVersion(ctx context.Context, arg GetMonitorByNameAndIPVersionParams) (m1 Monitor, err error) {
|
||||||
ctx, _span := otel.Tracer(_d._instance).Start(ctx, "QuerierTx.GetMonitorByName")
|
ctx, _span := otel.Tracer(_d._instance).Start(ctx, "QuerierTx.GetMonitorByNameAndIPVersion")
|
||||||
defer func() {
|
defer func() {
|
||||||
if _d._spanDecorator != nil {
|
if _d._spanDecorator != nil {
|
||||||
_d._spanDecorator(_span, map[string]interface{}{
|
_d._spanDecorator(_span, map[string]interface{}{
|
||||||
"ctx": ctx,
|
"ctx": ctx,
|
||||||
"tlsName": tlsName}, map[string]interface{}{
|
"arg": arg}, map[string]interface{}{
|
||||||
"m1": m1,
|
"m1": m1,
|
||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -99,7 +102,7 @@ func (_d QuerierTxWithTracing) GetMonitorByName(ctx context.Context, tlsName sql
|
|||||||
|
|
||||||
_span.End()
|
_span.End()
|
||||||
}()
|
}()
|
||||||
return _d.QuerierTx.GetMonitorByName(ctx, tlsName)
|
return _d.QuerierTx.GetMonitorByNameAndIPVersion(ctx, arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetMonitorsByID implements QuerierTx
|
// GetMonitorsByID implements QuerierTx
|
||||||
@@ -114,6 +117,7 @@ func (_d QuerierTxWithTracing) GetMonitorsByID(ctx context.Context, monitorids [
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -137,6 +141,7 @@ func (_d QuerierTxWithTracing) GetServerByID(ctx context.Context, id uint32) (s1
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -160,6 +165,7 @@ func (_d QuerierTxWithTracing) GetServerByIP(ctx context.Context, ip string) (s1
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -183,6 +189,7 @@ func (_d QuerierTxWithTracing) GetServerLogScores(ctx context.Context, arg GetSe
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -206,6 +213,7 @@ func (_d QuerierTxWithTracing) GetServerLogScoresByMonitorID(ctx context.Context
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -229,6 +237,7 @@ func (_d QuerierTxWithTracing) GetServerNetspeed(ctx context.Context, ip string)
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -252,6 +261,7 @@ func (_d QuerierTxWithTracing) GetServerScores(ctx context.Context, arg GetServe
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -275,6 +285,7 @@ func (_d QuerierTxWithTracing) GetZoneByName(ctx context.Context, name string) (
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -298,6 +309,7 @@ func (_d QuerierTxWithTracing) GetZoneCounts(ctx context.Context, zoneID uint32)
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -320,6 +332,7 @@ func (_d QuerierTxWithTracing) GetZoneStatsData(ctx context.Context) (ga1 []GetZ
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -343,6 +356,7 @@ func (_d QuerierTxWithTracing) GetZoneStatsV2(ctx context.Context, ip string) (g
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
@@ -364,6 +378,7 @@ func (_d QuerierTxWithTracing) Rollback(ctx context.Context) (err error) {
|
|||||||
"err": err})
|
"err": err})
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
_span.RecordError(err)
|
_span.RecordError(err)
|
||||||
|
_span.SetStatus(_codes.Error, err.Error())
|
||||||
_span.SetAttributes(
|
_span.SetAttributes(
|
||||||
attribute.String("event", "error"),
|
attribute.String("event", "error"),
|
||||||
attribute.String("message", err.Error()),
|
attribute.String("message", err.Error()),
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
// Code generated by sqlc. DO NOT EDIT.
|
// Code generated by sqlc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// sqlc v1.28.0
|
// sqlc v1.29.0
|
||||||
|
|
||||||
package ntpdb
|
package ntpdb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Querier interface {
|
type Querier interface {
|
||||||
GetMonitorByName(ctx context.Context, tlsName sql.NullString) (Monitor, error)
|
GetMonitorByNameAndIPVersion(ctx context.Context, arg GetMonitorByNameAndIPVersionParams) (Monitor, error)
|
||||||
GetMonitorsByID(ctx context.Context, monitorids []uint32) ([]Monitor, error)
|
GetMonitorsByID(ctx context.Context, monitorids []uint32) ([]Monitor, error)
|
||||||
GetServerByID(ctx context.Context, id uint32) (Server, error)
|
GetServerByID(ctx context.Context, id uint32) (Server, error)
|
||||||
GetServerByIP(ctx context.Context, ip string) (Server, error)
|
GetServerByIP(ctx context.Context, ip string) (Server, error)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by sqlc. DO NOT EDIT.
|
// Code generated by sqlc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// sqlc v1.28.0
|
// sqlc v1.29.0
|
||||||
// source: query.sql
|
// source: query.sql
|
||||||
|
|
||||||
package ntpdb
|
package ntpdb
|
||||||
@@ -12,23 +12,32 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
const getMonitorByName = `-- name: GetMonitorByName :one
|
const getMonitorByNameAndIPVersion = `-- name: GetMonitorByNameAndIPVersion :one
|
||||||
select id, type, user_id, account_id, name, location, ip, ip_version, tls_name, api_key, status, config, client_version, last_seen, last_submit, created_on from monitors
|
select id, id_token, type, user_id, account_id, hostname, location, ip, ip_version, tls_name, api_key, status, config, client_version, last_seen, last_submit, created_on, deleted_on, is_current from monitors
|
||||||
where
|
where
|
||||||
tls_name like ?
|
tls_name like ? AND
|
||||||
|
ip_version = ? AND
|
||||||
|
is_current = 1 AND
|
||||||
|
status != 'deleted'
|
||||||
order by id
|
order by id
|
||||||
limit 1
|
limit 1
|
||||||
`
|
`
|
||||||
|
|
||||||
func (q *Queries) GetMonitorByName(ctx context.Context, tlsName sql.NullString) (Monitor, error) {
|
type GetMonitorByNameAndIPVersionParams struct {
|
||||||
row := q.db.QueryRowContext(ctx, getMonitorByName, tlsName)
|
TlsName sql.NullString `db:"tls_name" json:"tls_name"`
|
||||||
|
IpVersion NullMonitorsIpVersion `db:"ip_version" json:"ip_version"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (q *Queries) GetMonitorByNameAndIPVersion(ctx context.Context, arg GetMonitorByNameAndIPVersionParams) (Monitor, error) {
|
||||||
|
row := q.db.QueryRowContext(ctx, getMonitorByNameAndIPVersion, arg.TlsName, arg.IpVersion)
|
||||||
var i Monitor
|
var i Monitor
|
||||||
err := row.Scan(
|
err := row.Scan(
|
||||||
&i.ID,
|
&i.ID,
|
||||||
|
&i.IDToken,
|
||||||
&i.Type,
|
&i.Type,
|
||||||
&i.UserID,
|
&i.UserID,
|
||||||
&i.AccountID,
|
&i.AccountID,
|
||||||
&i.Name,
|
&i.Hostname,
|
||||||
&i.Location,
|
&i.Location,
|
||||||
&i.Ip,
|
&i.Ip,
|
||||||
&i.IpVersion,
|
&i.IpVersion,
|
||||||
@@ -40,12 +49,14 @@ func (q *Queries) GetMonitorByName(ctx context.Context, tlsName sql.NullString)
|
|||||||
&i.LastSeen,
|
&i.LastSeen,
|
||||||
&i.LastSubmit,
|
&i.LastSubmit,
|
||||||
&i.CreatedOn,
|
&i.CreatedOn,
|
||||||
|
&i.DeletedOn,
|
||||||
|
&i.IsCurrent,
|
||||||
)
|
)
|
||||||
return i, err
|
return i, err
|
||||||
}
|
}
|
||||||
|
|
||||||
const getMonitorsByID = `-- name: GetMonitorsByID :many
|
const getMonitorsByID = `-- name: GetMonitorsByID :many
|
||||||
select id, type, user_id, account_id, name, location, ip, ip_version, tls_name, api_key, status, config, client_version, last_seen, last_submit, created_on from monitors
|
select id, id_token, type, user_id, account_id, hostname, location, ip, ip_version, tls_name, api_key, status, config, client_version, last_seen, last_submit, created_on, deleted_on, is_current from monitors
|
||||||
where id in (/*SLICE:MonitorIDs*/?)
|
where id in (/*SLICE:MonitorIDs*/?)
|
||||||
`
|
`
|
||||||
|
|
||||||
@@ -70,10 +81,11 @@ func (q *Queries) GetMonitorsByID(ctx context.Context, monitorids []uint32) ([]M
|
|||||||
var i Monitor
|
var i Monitor
|
||||||
if err := rows.Scan(
|
if err := rows.Scan(
|
||||||
&i.ID,
|
&i.ID,
|
||||||
|
&i.IDToken,
|
||||||
&i.Type,
|
&i.Type,
|
||||||
&i.UserID,
|
&i.UserID,
|
||||||
&i.AccountID,
|
&i.AccountID,
|
||||||
&i.Name,
|
&i.Hostname,
|
||||||
&i.Location,
|
&i.Location,
|
||||||
&i.Ip,
|
&i.Ip,
|
||||||
&i.IpVersion,
|
&i.IpVersion,
|
||||||
@@ -85,6 +97,8 @@ func (q *Queries) GetMonitorsByID(ctx context.Context, monitorids []uint32) ([]M
|
|||||||
&i.LastSeen,
|
&i.LastSeen,
|
||||||
&i.LastSubmit,
|
&i.LastSubmit,
|
||||||
&i.CreatedOn,
|
&i.CreatedOn,
|
||||||
|
&i.DeletedOn,
|
||||||
|
&i.IsCurrent,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -268,7 +282,7 @@ func (q *Queries) GetServerNetspeed(ctx context.Context, ip string) (uint32, err
|
|||||||
|
|
||||||
const getServerScores = `-- name: GetServerScores :many
|
const getServerScores = `-- name: GetServerScores :many
|
||||||
select
|
select
|
||||||
m.id, m.name, m.tls_name, m.location, m.type,
|
m.id, m.hostname, m.tls_name, m.location, m.type,
|
||||||
ss.score_raw, ss.score_ts, ss.status
|
ss.score_raw, ss.score_ts, ss.status
|
||||||
from server_scores ss
|
from server_scores ss
|
||||||
inner join monitors m
|
inner join monitors m
|
||||||
@@ -285,7 +299,7 @@ type GetServerScoresParams struct {
|
|||||||
|
|
||||||
type GetServerScoresRow struct {
|
type GetServerScoresRow struct {
|
||||||
ID uint32 `db:"id" json:"id"`
|
ID uint32 `db:"id" json:"id"`
|
||||||
Name string `db:"name" json:"name"`
|
Hostname string `db:"hostname" json:"hostname"`
|
||||||
TlsName sql.NullString `db:"tls_name" json:"tls_name"`
|
TlsName sql.NullString `db:"tls_name" json:"tls_name"`
|
||||||
Location string `db:"location" json:"location"`
|
Location string `db:"location" json:"location"`
|
||||||
Type MonitorsType `db:"type" json:"type"`
|
Type MonitorsType `db:"type" json:"type"`
|
||||||
@@ -316,7 +330,7 @@ func (q *Queries) GetServerScores(ctx context.Context, arg GetServerScoresParams
|
|||||||
var i GetServerScoresRow
|
var i GetServerScoresRow
|
||||||
if err := rows.Scan(
|
if err := rows.Scan(
|
||||||
&i.ID,
|
&i.ID,
|
||||||
&i.Name,
|
&i.Hostname,
|
||||||
&i.TlsName,
|
&i.TlsName,
|
||||||
&i.Location,
|
&i.Location,
|
||||||
&i.Type,
|
&i.Type,
|
||||||
|
|||||||
389
plans/grafana-time-range-api.md
Normal file
389
plans/grafana-time-range-api.md
Normal file
@@ -0,0 +1,389 @@
|
|||||||
|
# DETAILED IMPLEMENTATION PLAN: Grafana Time Range API with Future Downsampling Support
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
Implement a new Grafana-compatible API endpoint `/api/v2/server/scores/{server}/{mode}` that returns time series data in Grafana format with time range support and future downsampling capabilities.
|
||||||
|
|
||||||
|
## API Specification
|
||||||
|
|
||||||
|
### Endpoint
|
||||||
|
- **URL**: `/api/v2/server/scores/{server}/{mode}`
|
||||||
|
- **Method**: GET
|
||||||
|
- **Path Parameters**:
|
||||||
|
- `server`: Server IP address or ID (same validation as existing API)
|
||||||
|
- `mode`: Only `json` supported initially
|
||||||
|
|
||||||
|
### Query Parameters (following Grafana conventions)
|
||||||
|
- `from`: Unix timestamp in seconds (required)
|
||||||
|
- `to`: Unix timestamp in seconds (required)
|
||||||
|
- `maxDataPoints`: Integer, default 50000, max 50000 (for future downsampling)
|
||||||
|
- `monitor`: Monitor ID, name prefix, or "*" for all (optional, same as existing)
|
||||||
|
- `interval`: Future downsampling interval like "1m", "5m", "1h" (optional, not implemented initially)
|
||||||
|
|
||||||
|
### Response Format
|
||||||
|
Grafana table format JSON array (more efficient than separate series):
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"target": "monitor{name=zakim1-yfhw4a}",
|
||||||
|
"tags": {
|
||||||
|
"monitor_id": "126",
|
||||||
|
"monitor_name": "zakim1-yfhw4a",
|
||||||
|
"type": "monitor",
|
||||||
|
"status": "active"
|
||||||
|
},
|
||||||
|
"columns": [
|
||||||
|
{"text": "time", "type": "time"},
|
||||||
|
{"text": "score", "type": "number"},
|
||||||
|
{"text": "rtt", "type": "number", "unit": "ms"},
|
||||||
|
{"text": "offset", "type": "number", "unit": "s"}
|
||||||
|
],
|
||||||
|
"values": [
|
||||||
|
[1753431667000, 20.0, 18.865, -0.000267],
|
||||||
|
[1753431419000, 20.0, 18.96, -0.000390],
|
||||||
|
[1753431151000, 20.0, 18.073, -0.000768],
|
||||||
|
[1753430063000, 20.0, 18.209, null]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Implementation Details
|
||||||
|
|
||||||
|
### 1. Server Routing (`server/server.go`)
|
||||||
|
Add new route after existing scores routes:
|
||||||
|
```go
|
||||||
|
e.GET("/api/v2/server/scores/:server/:mode", srv.scoresTimeRange)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note**: Initially attempted `:server.:mode` pattern, but Echo router cannot properly parse IP addresses with dots using this pattern. Changed to `:server/:mode` to match existing API pattern and ensure compatibility with IP addresses like `23.155.40.38`.
|
||||||
|
|
||||||
|
## Key Implementation Clarifications
|
||||||
|
|
||||||
|
### Monitor Filtering Behavior
|
||||||
|
- **monitor=\***: Return ALL monitors (no monitor count limit)
|
||||||
|
- **50k datapoint limit**: Applied in database query (LIMIT clause)
|
||||||
|
- Return whatever data we get from database to user (no post-processing truncation)
|
||||||
|
|
||||||
|
### Null Value Handling Strategy
|
||||||
|
- **Score**: Always include (should never be null)
|
||||||
|
- **RTT**: Skip datapoints where RTT is null
|
||||||
|
- **Offset**: Skip datapoints where offset is null
|
||||||
|
|
||||||
|
### Time Range Validation Rules
|
||||||
|
- **Zero duration**: Return 400 Bad Request
|
||||||
|
- **Future timestamps**: Allow for now
|
||||||
|
- **Minimum range**: 1 second
|
||||||
|
- **Maximum range**: 90 days
|
||||||
|
|
||||||
|
### 2. New Handler Function (`server/grafana.go`)
|
||||||
|
|
||||||
|
#### Function Signature
|
||||||
|
```go
|
||||||
|
func (srv *Server) scoresTimeRange(c echo.Context) error
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Parameter Parsing & Validation
|
||||||
|
```go
|
||||||
|
// Extend existing historyParameters struct for time range support
|
||||||
|
type timeRangeParams struct {
|
||||||
|
historyParameters // embed existing struct
|
||||||
|
from time.Time
|
||||||
|
to time.Time
|
||||||
|
maxDataPoints int
|
||||||
|
interval string // for future downsampling
|
||||||
|
}
|
||||||
|
|
||||||
|
func (srv *Server) parseTimeRangeParams(ctx context.Context, c echo.Context) (timeRangeParams, error) {
|
||||||
|
// Start with existing parameter parsing logic
|
||||||
|
baseParams, err := srv.getHistoryParameters(ctx, c)
|
||||||
|
if err != nil {
|
||||||
|
return timeRangeParams{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse and validate from/to second timestamps
|
||||||
|
// Validate time range (max 90 days, min 1 second)
|
||||||
|
// Parse maxDataPoints (default 50000, max 50000)
|
||||||
|
// Return extended parameters
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Response Structure
|
||||||
|
```go
|
||||||
|
type ColumnDef struct {
|
||||||
|
Text string `json:"text"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
Unit string `json:"unit,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GrafanaTableSeries struct {
|
||||||
|
Target string `json:"target"`
|
||||||
|
Tags map[string]string `json:"tags"`
|
||||||
|
Columns []ColumnDef `json:"columns"`
|
||||||
|
Values [][]interface{} `json:"values"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GrafanaTimeSeriesResponse []GrafanaTableSeries
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Cache Control
|
||||||
|
```go
|
||||||
|
// Reuse existing setHistoryCacheControl function for consistency
|
||||||
|
// Logic based on data recency and entry count:
|
||||||
|
// - Empty or >8h old data: "s-maxage=260,max-age=360"
|
||||||
|
// - Single entry: "s-maxage=60,max-age=35"
|
||||||
|
// - Multiple entries: "s-maxage=90,max-age=120"
|
||||||
|
setHistoryCacheControl(c, history)
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. ClickHouse Data Access (`chdb/logscores.go`)
|
||||||
|
|
||||||
|
#### New Method
|
||||||
|
```go
|
||||||
|
func (d *ClickHouse) LogscoresTimeRange(ctx context.Context, serverID, monitorID int, from, to time.Time, limit int) ([]ntpdb.LogScore, error) {
|
||||||
|
// Build query with time range WHERE clause
|
||||||
|
// Always order by ts ASC (Grafana convention)
|
||||||
|
// Apply limit to prevent memory issues
|
||||||
|
// Use same row scanning logic as existing Logscores method
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Query Structure
|
||||||
|
```sql
|
||||||
|
SELECT id, monitor_id, server_id, ts,
|
||||||
|
toFloat64(score), toFloat64(step), offset,
|
||||||
|
rtt, leap, warning, error
|
||||||
|
FROM log_scores
|
||||||
|
WHERE server_id = ?
|
||||||
|
AND ts >= ?
|
||||||
|
AND ts <= ?
|
||||||
|
[AND monitor_id = ?] -- if specific monitor requested
|
||||||
|
ORDER BY ts ASC
|
||||||
|
LIMIT ?
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Data Transformation Logic (`server/grafana.go`)
|
||||||
|
|
||||||
|
#### Core Transformation Function
|
||||||
|
```go
|
||||||
|
func transformToGrafanaTableFormat(history *logscores.LogScoreHistory, monitors []ntpdb.Monitor) GrafanaTimeSeriesResponse {
|
||||||
|
// Group data by monitor_id (one series per monitor)
|
||||||
|
// Create table format with columns: time, score, rtt, offset
|
||||||
|
// Convert timestamps to milliseconds
|
||||||
|
// Build proper target names and tags
|
||||||
|
// Handle null values appropriately in table values
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Grouping Strategy
|
||||||
|
1. **Group by Monitor**: One table series per monitor
|
||||||
|
2. **Table Columns**: time, score, rtt, offset (all metrics in one table)
|
||||||
|
3. **Target Naming**: `monitor{name={sanitized_monitor_name}}`
|
||||||
|
4. **Tag Structure**: Include monitor metadata (no metric type needed)
|
||||||
|
5. **Monitor Status**: Query real monitor data using `q.GetServerScores()` like existing API
|
||||||
|
6. **Series Ordering**: No guaranteed order (standard Grafana behavior)
|
||||||
|
7. **Efficiency**: More efficient than separate series - less JSON overhead
|
||||||
|
|
||||||
|
#### Timestamp Conversion
|
||||||
|
```go
|
||||||
|
timestampMs := logScore.Ts.Unix() * 1000
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5. Error Handling
|
||||||
|
|
||||||
|
#### Validation Errors (400 Bad Request)
|
||||||
|
- Invalid timestamp format
|
||||||
|
- from >= to (including zero duration)
|
||||||
|
- Time range too large (> 90 days)
|
||||||
|
- Time range too small (< 1 second minimum)
|
||||||
|
- maxDataPoints > 50000
|
||||||
|
- Invalid mode (not "json")
|
||||||
|
|
||||||
|
#### Not Found Errors (404)
|
||||||
|
- Server not found
|
||||||
|
- Monitor not found
|
||||||
|
- Server deleted
|
||||||
|
|
||||||
|
#### Server Errors (500)
|
||||||
|
- ClickHouse connection issues
|
||||||
|
- Database query errors
|
||||||
|
|
||||||
|
### 6. Future Downsampling Design
|
||||||
|
|
||||||
|
#### API Extension Points
|
||||||
|
- `interval` parameter parsing ready
|
||||||
|
- `maxDataPoints` limit already enforced
|
||||||
|
- Response format supports downsampled data seamlessly
|
||||||
|
|
||||||
|
#### Downsampling Algorithm (Future Implementation)
|
||||||
|
```go
|
||||||
|
// When datapoints > maxDataPoints:
|
||||||
|
// 1. Calculate downsample interval: (to - from) / maxDataPoints
|
||||||
|
// 2. Group data into time buckets
|
||||||
|
// 3. Aggregate per bucket: avg for score/rtt, last for offset
|
||||||
|
// 4. Return aggregated datapoints
|
||||||
|
```
|
||||||
|
|
||||||
|
## Testing Strategy
|
||||||
|
|
||||||
|
### Unit Tests
|
||||||
|
- Parameter parsing and validation
|
||||||
|
- Data transformation logic
|
||||||
|
- Error handling scenarios
|
||||||
|
- Timestamp conversion accuracy
|
||||||
|
|
||||||
|
### Integration Tests
|
||||||
|
- End-to-end API requests
|
||||||
|
- ClickHouse query execution
|
||||||
|
- Multiple monitor scenarios
|
||||||
|
- Large time range handling
|
||||||
|
|
||||||
|
### Manual Testing
|
||||||
|
- Grafana integration testing
|
||||||
|
- Performance with various time ranges
|
||||||
|
- Cache behavior validation
|
||||||
|
|
||||||
|
## Performance Considerations
|
||||||
|
|
||||||
|
### Current Implementation
|
||||||
|
- 50k datapoint limit applied in database query (LIMIT clause) (covers ~few weeks of data)
|
||||||
|
- ClickHouse-only for better range query performance
|
||||||
|
- Proper indexing on (server_id, ts) assumed
|
||||||
|
- Table format more efficient than separate time series (less JSON overhead)
|
||||||
|
|
||||||
|
### Future Optimizations (Critical for Production)
|
||||||
|
- **Downsampling for large ranges**: Essential for 90-day queries with reasonable performance
|
||||||
|
- Query optimization based on range size
|
||||||
|
- Potential parallel monitor queries
|
||||||
|
- Adaptive sampling rates based on time range duration
|
||||||
|
|
||||||
|
## Documentation Updates
|
||||||
|
|
||||||
|
### API.md Addition
|
||||||
|
```markdown
|
||||||
|
### 7. Server Scores Time Range (v2)
|
||||||
|
|
||||||
|
**GET** `/api/v2/server/scores/{server}/{mode}`
|
||||||
|
|
||||||
|
Grafana-compatible time series endpoint for NTP server scoring data.
|
||||||
|
|
||||||
|
#### Path Parameters
|
||||||
|
- `server`: Server IP address or ID
|
||||||
|
- `mode`: Response format (`json` only)
|
||||||
|
|
||||||
|
#### Query Parameters
|
||||||
|
- `from`: Start time as Unix timestamp in seconds (required)
|
||||||
|
- `to`: End time as Unix timestamp in seconds (required)
|
||||||
|
- `maxDataPoints`: Maximum data points to return (default: 50000, max: 50000)
|
||||||
|
- `monitor`: Monitor filter (ID, name prefix, or "*" for all)
|
||||||
|
|
||||||
|
#### Response Format
|
||||||
|
Grafana table format array with one series per monitor containing all metrics as columns.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Key Research Findings
|
||||||
|
|
||||||
|
### Grafana Error Format Requirements
|
||||||
|
- **HTTP Status Codes**: Standard 400/404/500 work fine
|
||||||
|
- **Response Body**: JSON preferred with `Content-Type: application/json`
|
||||||
|
- **Structure**: Simple `{"error": "message", "status": code}` is sufficient
|
||||||
|
- **Compatibility**: Existing Echo error patterns are Grafana-compatible
|
||||||
|
|
||||||
|
### Data Volume Considerations
|
||||||
|
- **50k Datapoint Limit**: Only covers ~few weeks of data, not sufficient for 90-day ranges
|
||||||
|
- **Downsampling Critical**: Required for production use with 90-day time ranges
|
||||||
|
- **Current Approach**: Acceptable for MVP, downsampling essential for full utility
|
||||||
|
|
||||||
|
## Implementation Checklist
|
||||||
|
|
||||||
|
### Phase 0: Grafana Table Format Validation ✅ **COMPLETED**
|
||||||
|
- [x] Add test endpoint `/api/v2/test/grafana-table` returning sample table format
|
||||||
|
- [x] Implement Grafana table format response structures in `server/grafana.go`
|
||||||
|
- [x] Add structured logging and OpenTelemetry tracing to test endpoint
|
||||||
|
- [x] Verify endpoint compiles and serves correct JSON format
|
||||||
|
- [x] Test endpoint response format and headers (CORS, Content-Type, Cache-Control)
|
||||||
|
- [ ] Test with actual Grafana instance to validate table format compatibility
|
||||||
|
- [ ] Confirm time series panels render table format correctly
|
||||||
|
- [ ] Validate column types and units display properly
|
||||||
|
|
||||||
|
#### Phase 0 Implementation Details
|
||||||
|
**Files Created/Modified:**
|
||||||
|
- `server/grafana.go`: New file containing Grafana table format structures and test endpoint
|
||||||
|
- `server/server.go`: Added route `e.GET("/api/v2/test/grafana-table", srv.testGrafanaTable)`
|
||||||
|
|
||||||
|
**Test Endpoint Features:**
|
||||||
|
- **URL**: `http://localhost:8030/api/v2/test/grafana-table`
|
||||||
|
- **Response Format**: Grafana table format with realistic NTP Pool data
|
||||||
|
- **Sample Data**: Two monitor series (zakim1-yfhw4a, nj2-mon01) with time-based values
|
||||||
|
- **Columns**: time, score, rtt (ms), offset (s) with proper units
|
||||||
|
- **Null Handling**: Demonstrates null offset values
|
||||||
|
- **Headers**: CORS, JSON content-type, cache control
|
||||||
|
- **Observability**: Structured logging with context, OpenTelemetry tracing
|
||||||
|
|
||||||
|
**Recommended Grafana Data Source**: JSON API plugin (`marcusolsson-json-datasource`) - ideal for REST APIs returning table format JSON
|
||||||
|
|
||||||
|
### Phase 1: Core Implementation ✅ **COMPLETED**
|
||||||
|
- [x] Add route in server.go (fixed routing pattern from `:server.:mode` to `:server/:mode`)
|
||||||
|
- [x] Implement parseTimeRangeParams function for parameter validation
|
||||||
|
- [x] Add LogscoresTimeRange method to ClickHouse with time range filtering
|
||||||
|
- [x] Implement transformToGrafanaTableFormat function with monitor grouping
|
||||||
|
- [x] Add scoresTimeRange handler with full error handling
|
||||||
|
- [x] Error handling and validation (reuse existing Echo patterns)
|
||||||
|
- [x] Cache control headers (reuse setHistoryCacheControl)
|
||||||
|
|
||||||
|
#### Phase 1 Implementation Details
|
||||||
|
**Key Components Built:**
|
||||||
|
- **Route Pattern**: `/api/v2/server/scores/:server/:mode` (matches existing API consistency)
|
||||||
|
- **Parameter Validation**: Full validation of `from`/`to` timestamps, `maxDataPoints`, time ranges
|
||||||
|
- **ClickHouse Integration**: `LogscoresTimeRange()` with time-based WHERE clauses and ASC ordering
|
||||||
|
- **Data Transformation**: Grafana table format with monitor grouping and null value handling
|
||||||
|
- **Complete Handler**: `scoresTimeRange()` with server validation, error handling, caching, and CORS
|
||||||
|
|
||||||
|
**Routing Fix**: Changed from `:server.:mode` to `:server/:mode` to resolve Echo router issue with IP addresses containing dots (e.g., `23.155.40.38`).
|
||||||
|
|
||||||
|
**Files Created/Modified in Phase 1:**
|
||||||
|
- `server/grafana.go`: Complete implementation with all structures and functions
|
||||||
|
- `timeRangeParams` struct and `parseTimeRangeParams()` function
|
||||||
|
- `transformToGrafanaTableFormat()` function with monitor grouping
|
||||||
|
- `scoresTimeRange()` handler with full error handling
|
||||||
|
- `sanitizeMonitorName()` utility function
|
||||||
|
- `server/server.go`: Added route `e.GET("/api/v2/server/scores/:server/:mode", srv.scoresTimeRange)`
|
||||||
|
- `chdb/logscores.go`: Added `LogscoresTimeRange()` method for time-based queries
|
||||||
|
|
||||||
|
**Production Testing Results** (July 25, 2025):
|
||||||
|
- ✅ **Real Data Verification**: Successfully tested with server `102.64.112.164` over 12-hour time range
|
||||||
|
- ✅ **Multiple Monitor Support**: Returns data for multiple monitors (`defra1-210hw9t`, `recentmedian`)
|
||||||
|
- ✅ **Data Quality Validation**:
|
||||||
|
- RTT conversion (microseconds → milliseconds): ✅ Working
|
||||||
|
- Timestamp conversion (seconds → milliseconds): ✅ Working
|
||||||
|
- Null value handling: ✅ Working (recentmedian has null RTT/offset as expected)
|
||||||
|
- Monitor grouping: ✅ Working (one series per monitor)
|
||||||
|
- ✅ **API Parameter Changes**: Successfully changed from milliseconds to seconds for user-friendliness
|
||||||
|
- ✅ **Volume Testing**: Handles 100+ data points per monitor efficiently
|
||||||
|
- ✅ **Error Handling**: All validation working (400 for invalid params, 404 for missing servers)
|
||||||
|
- ✅ **Performance**: Sub-second response times for 12-hour ranges
|
||||||
|
|
||||||
|
**Sample Working Request:**
|
||||||
|
```bash
|
||||||
|
curl 'http://localhost:8030/api/v2/server/scores/102.64.112.164/json?from=1753457764&to=1753500964&monitor=*'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Phase 2: Testing & Polish
|
||||||
|
- [ ] Unit tests for all functions
|
||||||
|
- [ ] Integration tests
|
||||||
|
- [ ] Manual Grafana testing with real data
|
||||||
|
- [ ] Performance testing with large ranges (up to 50k points)
|
||||||
|
- [ ] API documentation updates
|
||||||
|
|
||||||
|
### Phase 3: Future Enhancement Ready
|
||||||
|
- [ ] Interval parameter parsing (no-op initially)
|
||||||
|
- [ ] Downsampling framework hooks (critical for 90-day ranges)
|
||||||
|
- [ ] Monitoring and metrics for new endpoint
|
||||||
|
|
||||||
|
This design provides a solid foundation for immediate Grafana integration while being fully prepared for future downsampling capabilities without breaking changes.
|
||||||
|
|
||||||
|
## Critical Notes for Production
|
||||||
|
|
||||||
|
- **Downsampling Required**: 50k datapoint limit means 90-day ranges will hit limits quickly
|
||||||
|
- **Table Format Validation**: Phase 0 testing ensures Grafana compatibility before full implementation
|
||||||
|
- **Error Handling**: Existing Echo patterns are sufficient for Grafana requirements
|
||||||
|
- **Scalability**: Current design handles weeks of data well, downsampling needed for months
|
||||||
@@ -47,10 +47,13 @@ select * from servers
|
|||||||
where
|
where
|
||||||
ip = sqlc.arg(ip);
|
ip = sqlc.arg(ip);
|
||||||
|
|
||||||
-- name: GetMonitorByName :one
|
-- name: GetMonitorByNameAndIPVersion :one
|
||||||
select * from monitors
|
select * from monitors
|
||||||
where
|
where
|
||||||
tls_name like sqlc.arg('tls_name')
|
tls_name like sqlc.arg('tls_name') AND
|
||||||
|
ip_version = sqlc.arg('ip_version') AND
|
||||||
|
is_current = 1 AND
|
||||||
|
status != 'deleted'
|
||||||
order by id
|
order by id
|
||||||
limit 1;
|
limit 1;
|
||||||
|
|
||||||
@@ -60,7 +63,7 @@ where id in (sqlc.slice('MonitorIDs'));
|
|||||||
|
|
||||||
-- name: GetServerScores :many
|
-- name: GetServerScores :many
|
||||||
select
|
select
|
||||||
m.id, m.name, m.tls_name, m.location, m.type,
|
m.id, m.hostname, m.tls_name, m.location, m.type,
|
||||||
ss.score_raw, ss.score_ts, ss.status
|
ss.score_raw, ss.score_ts, ss.status
|
||||||
from server_scores ss
|
from server_scores ss
|
||||||
inner join monitors m
|
inner join monitors m
|
||||||
|
|||||||
155
schema.sql
155
schema.sql
@@ -1,9 +1,9 @@
|
|||||||
/*M!999999\- enable the sandbox mode */
|
/*M!999999\- enable the sandbox mode */
|
||||||
-- MariaDB dump 10.19-11.4.4-MariaDB, for Linux (x86_64)
|
-- MariaDB dump 10.19-11.4.5-MariaDB, for Linux (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: ntpdb-haproxy.ntpdb.svc.cluster.local Database: askntp
|
-- Host: ntpdb-haproxy.ntpdb.svc.cluster.local Database: askntp
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
-- Server version 8.0.40-31
|
-- Server version 8.0.42-33
|
||||||
|
|
||||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `account_invites`;
|
DROP TABLE IF EXISTS `account_invites`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `account_invites` (
|
CREATE TABLE `account_invites` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`account_id` int unsigned NOT NULL,
|
`account_id` int unsigned NOT NULL,
|
||||||
@@ -51,7 +51,7 @@ CREATE TABLE `account_invites` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `account_subscriptions`;
|
DROP TABLE IF EXISTS `account_subscriptions`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `account_subscriptions` (
|
CREATE TABLE `account_subscriptions` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`account_id` int unsigned NOT NULL,
|
`account_id` int unsigned NOT NULL,
|
||||||
@@ -76,7 +76,7 @@ CREATE TABLE `account_subscriptions` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `account_users`;
|
DROP TABLE IF EXISTS `account_users`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `account_users` (
|
CREATE TABLE `account_users` (
|
||||||
`account_id` int unsigned NOT NULL,
|
`account_id` int unsigned NOT NULL,
|
||||||
`user_id` int unsigned NOT NULL,
|
`user_id` int unsigned NOT NULL,
|
||||||
@@ -93,21 +93,23 @@ CREATE TABLE `account_users` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `accounts`;
|
DROP TABLE IF EXISTS `accounts`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `accounts` (
|
CREATE TABLE `accounts` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`id_token` varchar(36) DEFAULT NULL,
|
||||||
`name` varchar(255) DEFAULT NULL,
|
`name` varchar(255) DEFAULT NULL,
|
||||||
`organization_name` varchar(150) DEFAULT NULL,
|
`organization_name` varchar(150) DEFAULT NULL,
|
||||||
`organization_url` varchar(150) DEFAULT NULL,
|
`organization_url` varchar(150) DEFAULT NULL,
|
||||||
`public_profile` tinyint(1) NOT NULL DEFAULT '0',
|
`public_profile` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
`url_slug` varchar(150) DEFAULT NULL,
|
`url_slug` varchar(150) DEFAULT NULL,
|
||||||
`flags` varchar(4096) NOT NULL DEFAULT '{}',
|
`flags` json DEFAULT NULL,
|
||||||
`created_on` datetime NOT NULL,
|
`created_on` datetime NOT NULL,
|
||||||
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
`stripe_customer_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
|
`stripe_customer_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `url_slug_idx` (`url_slug`),
|
UNIQUE KEY `url_slug_idx` (`url_slug`),
|
||||||
UNIQUE KEY `stripe_customer_id` (`stripe_customer_id`)
|
UNIQUE KEY `stripe_customer_id` (`stripe_customer_id`),
|
||||||
|
UNIQUE KEY `id_token` (`id_token`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
@@ -117,7 +119,7 @@ CREATE TABLE `accounts` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `api_keys`;
|
DROP TABLE IF EXISTS `api_keys`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `api_keys` (
|
CREATE TABLE `api_keys` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`account_id` int unsigned DEFAULT NULL,
|
`account_id` int unsigned DEFAULT NULL,
|
||||||
@@ -131,17 +133,38 @@ CREATE TABLE `api_keys` (
|
|||||||
`created_on` datetime NOT NULL,
|
`created_on` datetime NOT NULL,
|
||||||
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `api_key` (`api_key`)
|
UNIQUE KEY `api_key` (`api_key`),
|
||||||
|
KEY `api_keys_account_fk` (`account_id`),
|
||||||
|
KEY `api_keys_user_fk` (`user_id`),
|
||||||
|
CONSTRAINT `api_keys_account_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
|
||||||
|
CONSTRAINT `api_keys_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `api_keys_monitors`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `api_keys_monitors`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
|
CREATE TABLE `api_keys_monitors` (
|
||||||
|
`api_key_id` int unsigned NOT NULL,
|
||||||
|
`monitor_id` int unsigned NOT NULL,
|
||||||
|
PRIMARY KEY (`api_key_id`,`monitor_id`),
|
||||||
|
KEY `api_keys_monitors_monitors_fk` (`monitor_id`),
|
||||||
|
CONSTRAINT `api_keys_monitors_api_keys_fk` FOREIGN KEY (`api_key_id`) REFERENCES `api_keys` (`id`) ON DELETE CASCADE,
|
||||||
|
CONSTRAINT `api_keys_monitors_monitors_fk` FOREIGN KEY (`monitor_id`) REFERENCES `monitors` (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `combust_cache`
|
-- Table structure for table `combust_cache`
|
||||||
--
|
--
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `combust_cache`;
|
DROP TABLE IF EXISTS `combust_cache`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `combust_cache` (
|
CREATE TABLE `combust_cache` (
|
||||||
`id` varchar(64) NOT NULL,
|
`id` varchar(64) NOT NULL,
|
||||||
`type` varchar(20) NOT NULL DEFAULT '',
|
`type` varchar(20) NOT NULL DEFAULT '',
|
||||||
@@ -163,7 +186,7 @@ CREATE TABLE `combust_cache` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `combust_secrets`;
|
DROP TABLE IF EXISTS `combust_secrets`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `combust_secrets` (
|
CREATE TABLE `combust_secrets` (
|
||||||
`secret_ts` int unsigned NOT NULL,
|
`secret_ts` int unsigned NOT NULL,
|
||||||
`expires_ts` int unsigned NOT NULL,
|
`expires_ts` int unsigned NOT NULL,
|
||||||
@@ -180,7 +203,7 @@ CREATE TABLE `combust_secrets` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `dns_roots`;
|
DROP TABLE IF EXISTS `dns_roots`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `dns_roots` (
|
CREATE TABLE `dns_roots` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`origin` varchar(255) NOT NULL,
|
`origin` varchar(255) NOT NULL,
|
||||||
@@ -198,7 +221,7 @@ CREATE TABLE `dns_roots` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `log_scores`;
|
DROP TABLE IF EXISTS `log_scores`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `log_scores` (
|
CREATE TABLE `log_scores` (
|
||||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`monitor_id` int unsigned DEFAULT NULL,
|
`monitor_id` int unsigned DEFAULT NULL,
|
||||||
@@ -224,7 +247,7 @@ CREATE TABLE `log_scores` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `log_scores_archive_status`;
|
DROP TABLE IF EXISTS `log_scores_archive_status`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `log_scores_archive_status` (
|
CREATE TABLE `log_scores_archive_status` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`archiver` varchar(255) NOT NULL,
|
`archiver` varchar(255) NOT NULL,
|
||||||
@@ -243,7 +266,7 @@ CREATE TABLE `log_scores_archive_status` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `logs`;
|
DROP TABLE IF EXISTS `logs`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `logs` (
|
CREATE TABLE `logs` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`account_id` int unsigned DEFAULT NULL,
|
`account_id` int unsigned DEFAULT NULL,
|
||||||
@@ -272,7 +295,7 @@ CREATE TABLE `logs` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `monitor_registrations`;
|
DROP TABLE IF EXISTS `monitor_registrations`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `monitor_registrations` (
|
CREATE TABLE `monitor_registrations` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`monitor_id` int unsigned DEFAULT NULL,
|
`monitor_id` int unsigned DEFAULT NULL,
|
||||||
@@ -280,7 +303,8 @@ CREATE TABLE `monitor_registrations` (
|
|||||||
`verification_token` varchar(32) NOT NULL,
|
`verification_token` varchar(32) NOT NULL,
|
||||||
`ip4` varchar(15) NOT NULL DEFAULT '',
|
`ip4` varchar(15) NOT NULL DEFAULT '',
|
||||||
`ip6` varchar(39) NOT NULL DEFAULT '',
|
`ip6` varchar(39) NOT NULL DEFAULT '',
|
||||||
`name` varchar(256) NOT NULL DEFAULT '',
|
`tls_name` varchar(255) DEFAULT '',
|
||||||
|
`hostname` varchar(256) NOT NULL DEFAULT '',
|
||||||
`location_code` varchar(5) NOT NULL DEFAULT '',
|
`location_code` varchar(5) NOT NULL DEFAULT '',
|
||||||
`account_id` int unsigned DEFAULT NULL,
|
`account_id` int unsigned DEFAULT NULL,
|
||||||
`client` varchar(256) NOT NULL DEFAULT '',
|
`client` varchar(256) NOT NULL DEFAULT '',
|
||||||
@@ -303,13 +327,14 @@ CREATE TABLE `monitor_registrations` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `monitors`;
|
DROP TABLE IF EXISTS `monitors`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `monitors` (
|
CREATE TABLE `monitors` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`id_token` varchar(36) DEFAULT NULL,
|
||||||
`type` enum('monitor','score') NOT NULL DEFAULT 'monitor',
|
`type` enum('monitor','score') NOT NULL DEFAULT 'monitor',
|
||||||
`user_id` int unsigned DEFAULT NULL,
|
`user_id` int unsigned DEFAULT NULL,
|
||||||
`account_id` int unsigned DEFAULT NULL,
|
`account_id` int unsigned DEFAULT NULL,
|
||||||
`name` varchar(30) NOT NULL,
|
`hostname` varchar(255) NOT NULL DEFAULT '',
|
||||||
`location` varchar(255) NOT NULL DEFAULT '',
|
`location` varchar(255) NOT NULL DEFAULT '',
|
||||||
`ip` varchar(40) DEFAULT NULL,
|
`ip` varchar(40) DEFAULT NULL,
|
||||||
`ip_version` enum('v4','v6') DEFAULT NULL,
|
`ip_version` enum('v4','v6') DEFAULT NULL,
|
||||||
@@ -321,10 +346,14 @@ CREATE TABLE `monitors` (
|
|||||||
`last_seen` datetime(6) DEFAULT NULL,
|
`last_seen` datetime(6) DEFAULT NULL,
|
||||||
`last_submit` datetime(6) DEFAULT NULL,
|
`last_submit` datetime(6) DEFAULT NULL,
|
||||||
`created_on` datetime NOT NULL,
|
`created_on` datetime NOT NULL,
|
||||||
|
`deleted_on` datetime DEFAULT NULL,
|
||||||
|
`is_current` tinyint(1) DEFAULT '1',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `ip` (`ip`,`ip_version`),
|
|
||||||
UNIQUE KEY `api_key` (`api_key`),
|
UNIQUE KEY `api_key` (`api_key`),
|
||||||
UNIQUE KEY `monitors_tls_name` (`tls_name`,`ip_version`),
|
UNIQUE KEY `monitors_tls_name` (`tls_name`,`ip_version`),
|
||||||
|
UNIQUE KEY `token_id` (`id_token`),
|
||||||
|
UNIQUE KEY `id_token` (`id_token`),
|
||||||
|
UNIQUE KEY `ip` (`ip`,`is_current`),
|
||||||
KEY `monitors_user_id` (`user_id`),
|
KEY `monitors_user_id` (`user_id`),
|
||||||
KEY `monitors_account_fk` (`account_id`),
|
KEY `monitors_account_fk` (`account_id`),
|
||||||
KEY `type_status` (`type`,`status`),
|
KEY `type_status` (`type`,`status`),
|
||||||
@@ -340,7 +369,7 @@ CREATE TABLE `monitors` (
|
|||||||
DROP TABLE IF EXISTS `monitors_data`;
|
DROP TABLE IF EXISTS `monitors_data`;
|
||||||
/*!50001 DROP VIEW IF EXISTS `monitors_data`*/;
|
/*!50001 DROP VIEW IF EXISTS `monitors_data`*/;
|
||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8mb4;
|
||||||
/*!50001 CREATE VIEW `monitors_data` AS SELECT
|
/*!50001 CREATE VIEW `monitors_data` AS SELECT
|
||||||
1 AS `id`,
|
1 AS `id`,
|
||||||
1 AS `account_id`,
|
1 AS `account_id`,
|
||||||
@@ -354,13 +383,35 @@ SET character_set_client = utf8;
|
|||||||
1 AS `last_submit` */;
|
1 AS `last_submit` */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `oidc_public_keys`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `oidc_public_keys`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
|
CREATE TABLE `oidc_public_keys` (
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT,
|
||||||
|
`kid` varchar(255) NOT NULL,
|
||||||
|
`public_key` text NOT NULL,
|
||||||
|
`algorithm` varchar(20) NOT NULL,
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`expires_at` timestamp NULL DEFAULT NULL,
|
||||||
|
`active` tinyint(1) NOT NULL DEFAULT '1',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `kid` (`kid`),
|
||||||
|
KEY `idx_kid` (`kid`),
|
||||||
|
KEY `idx_active_expires` (`active`,`expires_at`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `schema_revision`
|
-- Table structure for table `schema_revision`
|
||||||
--
|
--
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `schema_revision`;
|
DROP TABLE IF EXISTS `schema_revision`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `schema_revision` (
|
CREATE TABLE `schema_revision` (
|
||||||
`revision` smallint unsigned NOT NULL DEFAULT '0',
|
`revision` smallint unsigned NOT NULL DEFAULT '0',
|
||||||
`schema_name` varchar(30) NOT NULL,
|
`schema_name` varchar(30) NOT NULL,
|
||||||
@@ -374,7 +425,7 @@ CREATE TABLE `schema_revision` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `scorer_status`;
|
DROP TABLE IF EXISTS `scorer_status`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `scorer_status` (
|
CREATE TABLE `scorer_status` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`scorer_id` int unsigned NOT NULL,
|
`scorer_id` int unsigned NOT NULL,
|
||||||
@@ -394,7 +445,7 @@ CREATE TABLE `scorer_status` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `server_alerts`;
|
DROP TABLE IF EXISTS `server_alerts`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `server_alerts` (
|
CREATE TABLE `server_alerts` (
|
||||||
`server_id` int unsigned NOT NULL,
|
`server_id` int unsigned NOT NULL,
|
||||||
`last_score` double NOT NULL,
|
`last_score` double NOT NULL,
|
||||||
@@ -411,7 +462,7 @@ CREATE TABLE `server_alerts` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `server_notes`;
|
DROP TABLE IF EXISTS `server_notes`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `server_notes` (
|
CREATE TABLE `server_notes` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`server_id` int unsigned NOT NULL,
|
`server_id` int unsigned NOT NULL,
|
||||||
@@ -432,7 +483,7 @@ CREATE TABLE `server_notes` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `server_scores`;
|
DROP TABLE IF EXISTS `server_scores`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `server_scores` (
|
CREATE TABLE `server_scores` (
|
||||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`monitor_id` int unsigned NOT NULL,
|
`monitor_id` int unsigned NOT NULL,
|
||||||
@@ -440,14 +491,17 @@ CREATE TABLE `server_scores` (
|
|||||||
`score_ts` datetime DEFAULT NULL,
|
`score_ts` datetime DEFAULT NULL,
|
||||||
`score_raw` double NOT NULL DEFAULT '0',
|
`score_raw` double NOT NULL DEFAULT '0',
|
||||||
`stratum` tinyint unsigned DEFAULT NULL,
|
`stratum` tinyint unsigned DEFAULT NULL,
|
||||||
`status` enum('new','testing','active') NOT NULL DEFAULT 'new',
|
`status` enum('candidate','testing','active') NOT NULL DEFAULT 'candidate',
|
||||||
`queue_ts` datetime DEFAULT NULL,
|
`queue_ts` datetime DEFAULT NULL,
|
||||||
`created_on` datetime NOT NULL,
|
`created_on` datetime NOT NULL,
|
||||||
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
`modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
|
`constraint_violation_type` varchar(50) DEFAULT NULL,
|
||||||
|
`constraint_violation_since` datetime DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `server_id` (`server_id`,`monitor_id`),
|
UNIQUE KEY `server_id` (`server_id`,`monitor_id`),
|
||||||
KEY `monitor_id` (`monitor_id`,`server_id`),
|
KEY `monitor_id` (`monitor_id`,`server_id`),
|
||||||
KEY `monitor_id_2` (`monitor_id`,`score_ts`),
|
KEY `monitor_id_2` (`monitor_id`,`score_ts`),
|
||||||
|
KEY `idx_constraint_violation` (`constraint_violation_type`,`constraint_violation_since`),
|
||||||
CONSTRAINT `server_score_monitor_fk` FOREIGN KEY (`monitor_id`) REFERENCES `monitors` (`id`),
|
CONSTRAINT `server_score_monitor_fk` FOREIGN KEY (`monitor_id`) REFERENCES `monitors` (`id`),
|
||||||
CONSTRAINT `server_score_server_id` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE
|
CONSTRAINT `server_score_server_id` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
||||||
@@ -459,7 +513,7 @@ CREATE TABLE `server_scores` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `server_urls`;
|
DROP TABLE IF EXISTS `server_urls`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `server_urls` (
|
CREATE TABLE `server_urls` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`server_id` int unsigned NOT NULL,
|
`server_id` int unsigned NOT NULL,
|
||||||
@@ -476,7 +530,7 @@ CREATE TABLE `server_urls` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `server_verifications`;
|
DROP TABLE IF EXISTS `server_verifications`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `server_verifications` (
|
CREATE TABLE `server_verifications` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`server_id` int unsigned NOT NULL,
|
`server_id` int unsigned NOT NULL,
|
||||||
@@ -502,7 +556,7 @@ CREATE TABLE `server_verifications` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `server_verifications_history`;
|
DROP TABLE IF EXISTS `server_verifications_history`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `server_verifications_history` (
|
CREATE TABLE `server_verifications_history` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`server_id` int unsigned NOT NULL,
|
`server_id` int unsigned NOT NULL,
|
||||||
@@ -526,7 +580,7 @@ CREATE TABLE `server_verifications_history` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `server_zones`;
|
DROP TABLE IF EXISTS `server_zones`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `server_zones` (
|
CREATE TABLE `server_zones` (
|
||||||
`server_id` int unsigned NOT NULL,
|
`server_id` int unsigned NOT NULL,
|
||||||
`zone_id` int unsigned NOT NULL,
|
`zone_id` int unsigned NOT NULL,
|
||||||
@@ -543,7 +597,7 @@ CREATE TABLE `server_zones` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `servers`;
|
DROP TABLE IF EXISTS `servers`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `servers` (
|
CREATE TABLE `servers` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`ip` varchar(40) NOT NULL,
|
`ip` varchar(40) NOT NULL,
|
||||||
@@ -579,7 +633,7 @@ CREATE TABLE `servers` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `servers_monitor_review`;
|
DROP TABLE IF EXISTS `servers_monitor_review`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `servers_monitor_review` (
|
CREATE TABLE `servers_monitor_review` (
|
||||||
`server_id` int unsigned NOT NULL,
|
`server_id` int unsigned NOT NULL,
|
||||||
`last_review` datetime DEFAULT NULL,
|
`last_review` datetime DEFAULT NULL,
|
||||||
@@ -598,7 +652,7 @@ CREATE TABLE `servers_monitor_review` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `system_settings`;
|
DROP TABLE IF EXISTS `system_settings`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `system_settings` (
|
CREATE TABLE `system_settings` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`key` varchar(255) NOT NULL,
|
`key` varchar(255) NOT NULL,
|
||||||
@@ -616,7 +670,7 @@ CREATE TABLE `system_settings` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `user_equipment_applications`;
|
DROP TABLE IF EXISTS `user_equipment_applications`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `user_equipment_applications` (
|
CREATE TABLE `user_equipment_applications` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`user_id` int unsigned NOT NULL,
|
`user_id` int unsigned NOT NULL,
|
||||||
@@ -635,7 +689,7 @@ CREATE TABLE `user_equipment_applications` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `user_identities`;
|
DROP TABLE IF EXISTS `user_identities`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `user_identities` (
|
CREATE TABLE `user_identities` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`profile_id` varchar(255) NOT NULL,
|
`profile_id` varchar(255) NOT NULL,
|
||||||
@@ -658,13 +712,14 @@ CREATE TABLE `user_identities` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `user_privileges`;
|
DROP TABLE IF EXISTS `user_privileges`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `user_privileges` (
|
CREATE TABLE `user_privileges` (
|
||||||
`user_id` int unsigned NOT NULL,
|
`user_id` int unsigned NOT NULL,
|
||||||
`see_all_servers` tinyint(1) NOT NULL DEFAULT '0',
|
`see_all_servers` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
`vendor_admin` tinyint NOT NULL DEFAULT '0',
|
`vendor_admin` tinyint NOT NULL DEFAULT '0',
|
||||||
`equipment_admin` tinyint NOT NULL DEFAULT '0',
|
`equipment_admin` tinyint NOT NULL DEFAULT '0',
|
||||||
`support_staff` tinyint NOT NULL DEFAULT '0',
|
`support_staff` tinyint NOT NULL DEFAULT '0',
|
||||||
|
`monitor_admin` tinyint NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`user_id`),
|
PRIMARY KEY (`user_id`),
|
||||||
CONSTRAINT `user_privileges_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
CONSTRAINT `user_privileges_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
||||||
@@ -676,7 +731,7 @@ CREATE TABLE `user_privileges` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `user_sessions`;
|
DROP TABLE IF EXISTS `user_sessions`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `user_sessions` (
|
CREATE TABLE `user_sessions` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`user_id` int unsigned NOT NULL,
|
`user_id` int unsigned NOT NULL,
|
||||||
@@ -697,7 +752,7 @@ CREATE TABLE `user_sessions` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `user_tasks`;
|
DROP TABLE IF EXISTS `user_tasks`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `user_tasks` (
|
CREATE TABLE `user_tasks` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`user_id` int unsigned DEFAULT NULL,
|
`user_id` int unsigned DEFAULT NULL,
|
||||||
@@ -719,9 +774,10 @@ CREATE TABLE `user_tasks` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `users`;
|
DROP TABLE IF EXISTS `users`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `users` (
|
CREATE TABLE `users` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`id_token` varchar(36) DEFAULT NULL,
|
||||||
`email` varchar(255) NOT NULL,
|
`email` varchar(255) NOT NULL,
|
||||||
`name` varchar(255) DEFAULT NULL,
|
`name` varchar(255) DEFAULT NULL,
|
||||||
`username` varchar(40) DEFAULT NULL,
|
`username` varchar(40) DEFAULT NULL,
|
||||||
@@ -729,7 +785,8 @@ CREATE TABLE `users` (
|
|||||||
`deletion_on` datetime DEFAULT NULL,
|
`deletion_on` datetime DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `email` (`email`),
|
UNIQUE KEY `email` (`email`),
|
||||||
UNIQUE KEY `username` (`username`)
|
UNIQUE KEY `username` (`username`),
|
||||||
|
UNIQUE KEY `id_token` (`id_token`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
@@ -739,9 +796,10 @@ CREATE TABLE `users` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `vendor_zones`;
|
DROP TABLE IF EXISTS `vendor_zones`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `vendor_zones` (
|
CREATE TABLE `vendor_zones` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`id_token` varchar(36) DEFAULT NULL,
|
||||||
`zone_name` varchar(90) NOT NULL,
|
`zone_name` varchar(90) NOT NULL,
|
||||||
`status` enum('New','Pending','Approved','Rejected') NOT NULL DEFAULT 'New',
|
`status` enum('New','Pending','Approved','Rejected') NOT NULL DEFAULT 'New',
|
||||||
`user_id` int unsigned DEFAULT NULL,
|
`user_id` int unsigned DEFAULT NULL,
|
||||||
@@ -761,6 +819,7 @@ CREATE TABLE `vendor_zones` (
|
|||||||
`account_id` int unsigned DEFAULT NULL,
|
`account_id` int unsigned DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `zone_name` (`zone_name`,`dns_root_id`),
|
UNIQUE KEY `zone_name` (`zone_name`,`dns_root_id`),
|
||||||
|
UNIQUE KEY `id_token` (`id_token`),
|
||||||
KEY `vendor_zones_user_id` (`user_id`),
|
KEY `vendor_zones_user_id` (`user_id`),
|
||||||
KEY `dns_root_fk` (`dns_root_id`),
|
KEY `dns_root_fk` (`dns_root_id`),
|
||||||
KEY `vendor_zone_account_fk` (`account_id`),
|
KEY `vendor_zone_account_fk` (`account_id`),
|
||||||
@@ -776,7 +835,7 @@ CREATE TABLE `vendor_zones` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `zone_server_counts`;
|
DROP TABLE IF EXISTS `zone_server_counts`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `zone_server_counts` (
|
CREATE TABLE `zone_server_counts` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`zone_id` int unsigned NOT NULL,
|
`zone_id` int unsigned NOT NULL,
|
||||||
@@ -798,7 +857,7 @@ CREATE TABLE `zone_server_counts` (
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS `zones`;
|
DROP TABLE IF EXISTS `zones`;
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `zones` (
|
CREATE TABLE `zones` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`name` varchar(255) NOT NULL,
|
`name` varchar(255) NOT NULL,
|
||||||
@@ -824,8 +883,8 @@ CREATE TABLE `zones` (
|
|||||||
/*!50001 SET character_set_results = utf8mb4 */;
|
/*!50001 SET character_set_results = utf8mb4 */;
|
||||||
/*!50001 SET collation_connection = utf8mb4_general_ci */;
|
/*!50001 SET collation_connection = utf8mb4_general_ci */;
|
||||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||||
/*!50013 DEFINER=`v-root-ntp-askntp-JRFPjVcaH1HOoQ`@`10.%` SQL SECURITY DEFINER */
|
|
||||||
/*!50001 VIEW `monitors_data` AS select `monitors`.`id` AS `id`,`monitors`.`account_id` AS `account_id`,`monitors`.`type` AS `type`,if((`monitors`.`type` = 'score'),`monitors`.`name`,substring_index(`monitors`.`tls_name`,'.',1)) AS `name`,`monitors`.`ip` AS `ip`,`monitors`.`ip_version` AS `ip_version`,`monitors`.`status` AS `status`,`monitors`.`client_version` AS `client_version`,`monitors`.`last_seen` AS `last_seen`,`monitors`.`last_submit` AS `last_submit` from `monitors` where (not((`monitors`.`tls_name` like '%.system'))) */;
|
/*!50001 VIEW `monitors_data` AS select `monitors`.`id` AS `id`,`monitors`.`account_id` AS `account_id`,`monitors`.`type` AS `type`,if((`monitors`.`type` = 'score'),`monitors`.`hostname`,substring_index(`monitors`.`tls_name`,'.',1)) AS `name`,`monitors`.`ip` AS `ip`,`monitors`.`ip_version` AS `ip_version`,`monitors`.`status` AS `status`,`monitors`.`client_version` AS `client_version`,`monitors`.`last_seen` AS `last_seen`,`monitors`.`last_submit` AS `last_submit` from `monitors` where (not((`monitors`.`tls_name` like '%.system'))) */;
|
||||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||||
@@ -839,4 +898,4 @@ CREATE TABLE `zones` (
|
|||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
|
/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
|
||||||
|
|
||||||
-- Dump completed on 2025-01-18 4:31:13
|
-- Dump completed on 2025-08-03 0:43:29
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
go install github.com/goreleaser/goreleaser/v2@v2.5.1
|
go install github.com/goreleaser/goreleaser/v2@v2.10.2
|
||||||
|
|
||||||
if [ ! -z "${harbor_username:-}" ]; then
|
if [ ! -z "${harbor_username:-}" ]; then
|
||||||
DOCKER_FILE=~/.docker/config.json
|
DOCKER_FILE=~/.docker/config.json
|
||||||
|
|||||||
539
server/grafana.go
Normal file
539
server/grafana.go
Normal file
@@ -0,0 +1,539 @@
|
|||||||
|
package server
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/labstack/echo/v4"
|
||||||
|
"go.ntppool.org/common/logger"
|
||||||
|
"go.ntppool.org/common/tracing"
|
||||||
|
"go.ntppool.org/data-api/logscores"
|
||||||
|
"go.ntppool.org/data-api/ntpdb"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ColumnDef represents a Grafana table column definition
|
||||||
|
type ColumnDef struct {
|
||||||
|
Text string `json:"text"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
Unit string `json:"unit,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GrafanaTableSeries represents a single table series in Grafana format
|
||||||
|
type GrafanaTableSeries struct {
|
||||||
|
Target string `json:"target"`
|
||||||
|
Tags map[string]string `json:"tags"`
|
||||||
|
Columns []ColumnDef `json:"columns"`
|
||||||
|
Values [][]interface{} `json:"values"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GrafanaTimeSeriesResponse represents the complete Grafana table response
|
||||||
|
type GrafanaTimeSeriesResponse []GrafanaTableSeries
|
||||||
|
|
||||||
|
// timeRangeParams extends historyParameters with time range support
|
||||||
|
type timeRangeParams struct {
|
||||||
|
historyParameters // embed existing struct
|
||||||
|
from time.Time
|
||||||
|
to time.Time
|
||||||
|
maxDataPoints int
|
||||||
|
interval string // for future downsampling
|
||||||
|
}
|
||||||
|
|
||||||
|
// parseTimeRangeParams parses and validates time range parameters
|
||||||
|
func (srv *Server) parseTimeRangeParams(ctx context.Context, c echo.Context, server ntpdb.Server) (timeRangeParams, error) {
|
||||||
|
log := logger.FromContext(ctx)
|
||||||
|
|
||||||
|
// Start with existing parameter parsing logic
|
||||||
|
baseParams, err := srv.getHistoryParameters(ctx, c, server)
|
||||||
|
if err != nil {
|
||||||
|
return timeRangeParams{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
trParams := timeRangeParams{
|
||||||
|
historyParameters: baseParams,
|
||||||
|
maxDataPoints: 50000, // default
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse from timestamp (required)
|
||||||
|
fromParam := c.QueryParam("from")
|
||||||
|
if fromParam == "" {
|
||||||
|
return timeRangeParams{}, echo.NewHTTPError(http.StatusBadRequest, "from parameter is required")
|
||||||
|
}
|
||||||
|
|
||||||
|
fromSec, err := strconv.ParseInt(fromParam, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
return timeRangeParams{}, echo.NewHTTPError(http.StatusBadRequest, "invalid from timestamp format")
|
||||||
|
}
|
||||||
|
trParams.from = time.Unix(fromSec, 0)
|
||||||
|
|
||||||
|
// Parse to timestamp (required)
|
||||||
|
toParam := c.QueryParam("to")
|
||||||
|
if toParam == "" {
|
||||||
|
return timeRangeParams{}, echo.NewHTTPError(http.StatusBadRequest, "to parameter is required")
|
||||||
|
}
|
||||||
|
|
||||||
|
toSec, err := strconv.ParseInt(toParam, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
return timeRangeParams{}, echo.NewHTTPError(http.StatusBadRequest, "invalid to timestamp format")
|
||||||
|
}
|
||||||
|
trParams.to = time.Unix(toSec, 0)
|
||||||
|
|
||||||
|
// Validate time range
|
||||||
|
if trParams.from.Equal(trParams.to) || trParams.from.After(trParams.to) {
|
||||||
|
return timeRangeParams{}, echo.NewHTTPError(http.StatusBadRequest, "from must be before to")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check minimum range (1 second)
|
||||||
|
if trParams.to.Sub(trParams.from) < time.Second {
|
||||||
|
return timeRangeParams{}, echo.NewHTTPError(http.StatusBadRequest, "time range must be at least 1 second")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check maximum range (90 days)
|
||||||
|
if trParams.to.Sub(trParams.from) > 90*24*time.Hour {
|
||||||
|
return timeRangeParams{}, echo.NewHTTPError(http.StatusBadRequest, "time range cannot exceed 90 days")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse maxDataPoints (optional)
|
||||||
|
if maxDataPointsParam := c.QueryParam("maxDataPoints"); maxDataPointsParam != "" {
|
||||||
|
maxDP, err := strconv.Atoi(maxDataPointsParam)
|
||||||
|
if err != nil {
|
||||||
|
return timeRangeParams{}, echo.NewHTTPError(http.StatusBadRequest, "invalid maxDataPoints format")
|
||||||
|
}
|
||||||
|
if maxDP > 50000 {
|
||||||
|
return timeRangeParams{}, echo.NewHTTPError(http.StatusBadRequest, "maxDataPoints cannot exceed 50000")
|
||||||
|
}
|
||||||
|
if maxDP > 0 {
|
||||||
|
trParams.maxDataPoints = maxDP
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse interval (optional, for future downsampling)
|
||||||
|
trParams.interval = c.QueryParam("interval")
|
||||||
|
|
||||||
|
log.DebugContext(ctx, "parsed time range params",
|
||||||
|
"from", trParams.from,
|
||||||
|
"to", trParams.to,
|
||||||
|
"maxDataPoints", trParams.maxDataPoints,
|
||||||
|
"interval", trParams.interval,
|
||||||
|
"monitor", trParams.monitorID,
|
||||||
|
)
|
||||||
|
|
||||||
|
return trParams, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// sanitizeMonitorName sanitizes monitor names for Grafana target format
|
||||||
|
func sanitizeMonitorName(name string) string {
|
||||||
|
// Replace problematic characters for Grafana target format
|
||||||
|
result := strings.ReplaceAll(name, " ", "_")
|
||||||
|
result = strings.ReplaceAll(result, ".", "-")
|
||||||
|
result = strings.ReplaceAll(result, "/", "-")
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
// transformToGrafanaTableFormat converts LogScoreHistory to Grafana table format
|
||||||
|
func transformToGrafanaTableFormat(history *logscores.LogScoreHistory, monitors []ntpdb.Monitor) GrafanaTimeSeriesResponse {
|
||||||
|
// Group data by monitor_id (one series per monitor)
|
||||||
|
monitorData := make(map[int][]ntpdb.LogScore)
|
||||||
|
monitorInfo := make(map[int]ntpdb.Monitor)
|
||||||
|
|
||||||
|
// Group log scores by monitor ID
|
||||||
|
skippedInvalidMonitors := 0
|
||||||
|
for _, ls := range history.LogScores {
|
||||||
|
if !ls.MonitorID.Valid {
|
||||||
|
skippedInvalidMonitors++
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
monitorID := int(ls.MonitorID.Int32)
|
||||||
|
monitorData[monitorID] = append(monitorData[monitorID], ls)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Debug logging for transformation
|
||||||
|
logger.Setup().Info("transformation grouping debug",
|
||||||
|
"total_log_scores", len(history.LogScores),
|
||||||
|
"skipped_invalid_monitors", skippedInvalidMonitors,
|
||||||
|
"grouped_monitor_ids", func() []int {
|
||||||
|
keys := make([]int, 0, len(monitorData))
|
||||||
|
for k := range monitorData {
|
||||||
|
keys = append(keys, k)
|
||||||
|
}
|
||||||
|
return keys
|
||||||
|
}(),
|
||||||
|
"monitor_data_counts", func() map[int]int {
|
||||||
|
counts := make(map[int]int)
|
||||||
|
for k, v := range monitorData {
|
||||||
|
counts[k] = len(v)
|
||||||
|
}
|
||||||
|
return counts
|
||||||
|
}(),
|
||||||
|
)
|
||||||
|
|
||||||
|
// Index monitors by ID for quick lookup
|
||||||
|
for _, monitor := range monitors {
|
||||||
|
monitorInfo[int(monitor.ID)] = monitor
|
||||||
|
}
|
||||||
|
|
||||||
|
var response GrafanaTimeSeriesResponse
|
||||||
|
|
||||||
|
// Create one table series per monitor
|
||||||
|
logger.Setup().Info("creating grafana series",
|
||||||
|
"monitor_data_entries", len(monitorData),
|
||||||
|
)
|
||||||
|
|
||||||
|
for monitorID, logScores := range monitorData {
|
||||||
|
if len(logScores) == 0 {
|
||||||
|
logger.Setup().Info("skipping monitor with no data", "monitor_id", monitorID)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Setup().Info("processing monitor series",
|
||||||
|
"monitor_id", monitorID,
|
||||||
|
"log_scores_count", len(logScores),
|
||||||
|
)
|
||||||
|
|
||||||
|
// Get monitor name from history.Monitors map or from monitor info
|
||||||
|
monitorName := "unknown"
|
||||||
|
if name, exists := history.Monitors[monitorID]; exists && name != "" {
|
||||||
|
monitorName = name
|
||||||
|
} else if monitor, exists := monitorInfo[monitorID]; exists {
|
||||||
|
monitorName = monitor.DisplayName()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build target name and tags
|
||||||
|
sanitizedName := sanitizeMonitorName(monitorName)
|
||||||
|
target := "monitor{name=" + sanitizedName + "}"
|
||||||
|
|
||||||
|
tags := map[string]string{
|
||||||
|
"monitor_id": strconv.Itoa(monitorID),
|
||||||
|
"monitor_name": monitorName,
|
||||||
|
"type": "monitor",
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add status (we'll use active as default since we have data for this monitor)
|
||||||
|
tags["status"] = "active"
|
||||||
|
|
||||||
|
// Define table columns
|
||||||
|
columns := []ColumnDef{
|
||||||
|
{Text: "time", Type: "time"},
|
||||||
|
{Text: "score", Type: "number"},
|
||||||
|
{Text: "rtt", Type: "number", Unit: "ms"},
|
||||||
|
{Text: "offset", Type: "number", Unit: "s"},
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build values array
|
||||||
|
var values [][]interface{}
|
||||||
|
for _, ls := range logScores {
|
||||||
|
// Convert timestamp to milliseconds
|
||||||
|
timestampMs := ls.Ts.Unix() * 1000
|
||||||
|
|
||||||
|
// Create row: [time, score, rtt, offset]
|
||||||
|
row := []interface{}{
|
||||||
|
timestampMs,
|
||||||
|
ls.Score,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add RTT (convert from microseconds to milliseconds, handle null)
|
||||||
|
if ls.Rtt.Valid {
|
||||||
|
rttMs := float64(ls.Rtt.Int32) / 1000.0
|
||||||
|
row = append(row, rttMs)
|
||||||
|
} else {
|
||||||
|
row = append(row, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add offset (handle null)
|
||||||
|
if ls.Offset.Valid {
|
||||||
|
row = append(row, ls.Offset.Float64)
|
||||||
|
} else {
|
||||||
|
row = append(row, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
values = append(values, row)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create table series
|
||||||
|
series := GrafanaTableSeries{
|
||||||
|
Target: target,
|
||||||
|
Tags: tags,
|
||||||
|
Columns: columns,
|
||||||
|
Values: values,
|
||||||
|
}
|
||||||
|
|
||||||
|
response = append(response, series)
|
||||||
|
|
||||||
|
logger.Setup().Info("created series for monitor",
|
||||||
|
"monitor_id", monitorID,
|
||||||
|
"target", series.Target,
|
||||||
|
"values_count", len(series.Values),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Setup().Info("transformation complete",
|
||||||
|
"final_response_count", len(response),
|
||||||
|
"response_is_nil", response == nil,
|
||||||
|
)
|
||||||
|
|
||||||
|
return response
|
||||||
|
}
|
||||||
|
|
||||||
|
// scoresTimeRange handles Grafana time range requests for NTP server scores
|
||||||
|
func (srv *Server) scoresTimeRange(c echo.Context) error {
|
||||||
|
log := logger.Setup()
|
||||||
|
ctx, span := tracing.Tracer().Start(c.Request().Context(), "scoresTimeRange")
|
||||||
|
defer span.End()
|
||||||
|
|
||||||
|
// Set reasonable default cache time; adjusted later based on data
|
||||||
|
c.Response().Header().Set("Cache-Control", "public,max-age=240")
|
||||||
|
|
||||||
|
// Validate mode parameter
|
||||||
|
mode := c.Param("mode")
|
||||||
|
if mode != "json" {
|
||||||
|
return echo.NewHTTPError(http.StatusNotFound, "invalid mode - only json supported")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find and validate server first
|
||||||
|
server, err := srv.FindServer(ctx, c.Param("server"))
|
||||||
|
if err != nil {
|
||||||
|
log.ErrorContext(ctx, "find server", "err", err)
|
||||||
|
if he, ok := err.(*echo.HTTPError); ok {
|
||||||
|
return he
|
||||||
|
}
|
||||||
|
span.RecordError(err)
|
||||||
|
return echo.NewHTTPError(http.StatusInternalServerError, "internal error")
|
||||||
|
}
|
||||||
|
if server.DeletionAge(30 * 24 * time.Hour) {
|
||||||
|
span.AddEvent("server deleted")
|
||||||
|
return echo.NewHTTPError(http.StatusNotFound, "server not found")
|
||||||
|
}
|
||||||
|
if server.ID == 0 {
|
||||||
|
span.AddEvent("server not found")
|
||||||
|
return echo.NewHTTPError(http.StatusNotFound, "server not found")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse and validate time range parameters
|
||||||
|
params, err := srv.parseTimeRangeParams(ctx, c, server)
|
||||||
|
if err != nil {
|
||||||
|
if he, ok := err.(*echo.HTTPError); ok {
|
||||||
|
return he
|
||||||
|
}
|
||||||
|
log.ErrorContext(ctx, "parse time range parameters", "err", err)
|
||||||
|
span.RecordError(err)
|
||||||
|
return echo.NewHTTPError(http.StatusInternalServerError, "internal error")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Query ClickHouse for time range data
|
||||||
|
log.InfoContext(ctx, "executing clickhouse time range query",
|
||||||
|
"server_id", server.ID,
|
||||||
|
"server_ip", server.Ip,
|
||||||
|
"monitor_id", params.monitorID,
|
||||||
|
"from", params.from,
|
||||||
|
"to", params.to,
|
||||||
|
"max_data_points", params.maxDataPoints,
|
||||||
|
"time_range_duration", params.to.Sub(params.from).String(),
|
||||||
|
)
|
||||||
|
|
||||||
|
logScores, err := srv.ch.LogscoresTimeRange(ctx, int(server.ID), params.monitorID, params.from, params.to, params.maxDataPoints)
|
||||||
|
if err != nil {
|
||||||
|
log.ErrorContext(ctx, "clickhouse time range query", "err", err,
|
||||||
|
"server_id", server.ID,
|
||||||
|
"monitor_id", params.monitorID,
|
||||||
|
"from", params.from,
|
||||||
|
"to", params.to,
|
||||||
|
)
|
||||||
|
span.RecordError(err)
|
||||||
|
return echo.NewHTTPError(http.StatusInternalServerError, "internal error")
|
||||||
|
}
|
||||||
|
|
||||||
|
log.InfoContext(ctx, "clickhouse query results",
|
||||||
|
"server_id", server.ID,
|
||||||
|
"rows_returned", len(logScores),
|
||||||
|
"first_few_ids", func() []uint64 {
|
||||||
|
ids := make([]uint64, 0, 3)
|
||||||
|
for i, ls := range logScores {
|
||||||
|
if i >= 3 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
ids = append(ids, ls.ID)
|
||||||
|
}
|
||||||
|
return ids
|
||||||
|
}(),
|
||||||
|
)
|
||||||
|
|
||||||
|
// Build LogScoreHistory structure for compatibility with existing functions
|
||||||
|
history := &logscores.LogScoreHistory{
|
||||||
|
LogScores: logScores,
|
||||||
|
Monitors: make(map[int]string),
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get monitor names for the returned data
|
||||||
|
monitorIDs := []uint32{}
|
||||||
|
for _, ls := range logScores {
|
||||||
|
if ls.MonitorID.Valid {
|
||||||
|
monitorID := uint32(ls.MonitorID.Int32)
|
||||||
|
if _, exists := history.Monitors[int(monitorID)]; !exists {
|
||||||
|
history.Monitors[int(monitorID)] = ""
|
||||||
|
monitorIDs = append(monitorIDs, monitorID)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log.InfoContext(ctx, "monitor processing",
|
||||||
|
"unique_monitor_ids", monitorIDs,
|
||||||
|
"monitor_count", len(monitorIDs),
|
||||||
|
)
|
||||||
|
|
||||||
|
// Get monitor details from database for status and display names
|
||||||
|
var monitors []ntpdb.Monitor
|
||||||
|
if len(monitorIDs) > 0 {
|
||||||
|
q := ntpdb.NewWrappedQuerier(ntpdb.New(srv.db))
|
||||||
|
logScoreMonitors, err := q.GetServerScores(ctx, ntpdb.GetServerScoresParams{
|
||||||
|
MonitorIDs: monitorIDs,
|
||||||
|
ServerID: server.ID,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
log.ErrorContext(ctx, "get monitor details", "err", err)
|
||||||
|
// Don't fail the request, just use basic info
|
||||||
|
} else {
|
||||||
|
for _, lsm := range logScoreMonitors {
|
||||||
|
// Create monitor entry for transformation (we mainly need the display name)
|
||||||
|
tempMon := ntpdb.Monitor{
|
||||||
|
TlsName: lsm.TlsName,
|
||||||
|
Location: lsm.Location,
|
||||||
|
ID: lsm.ID,
|
||||||
|
}
|
||||||
|
monitors = append(monitors, tempMon)
|
||||||
|
|
||||||
|
// Update monitor name in history
|
||||||
|
history.Monitors[int(lsm.ID)] = tempMon.DisplayName()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Transform to Grafana table format
|
||||||
|
log.InfoContext(ctx, "starting grafana transformation",
|
||||||
|
"log_scores_count", len(logScores),
|
||||||
|
"monitors_count", len(monitors),
|
||||||
|
"history_monitors", history.Monitors,
|
||||||
|
)
|
||||||
|
|
||||||
|
grafanaResponse := transformToGrafanaTableFormat(history, monitors)
|
||||||
|
|
||||||
|
log.InfoContext(ctx, "grafana transformation complete",
|
||||||
|
"response_series_count", len(grafanaResponse),
|
||||||
|
"response_preview", func() interface{} {
|
||||||
|
if len(grafanaResponse) == 0 {
|
||||||
|
return "empty_response"
|
||||||
|
}
|
||||||
|
first := grafanaResponse[0]
|
||||||
|
return map[string]interface{}{
|
||||||
|
"target": first.Target,
|
||||||
|
"tags": first.Tags,
|
||||||
|
"columns_count": len(first.Columns),
|
||||||
|
"values_count": len(first.Values),
|
||||||
|
"first_few_values": func() [][]interface{} {
|
||||||
|
if len(first.Values) == 0 {
|
||||||
|
return [][]interface{}{}
|
||||||
|
}
|
||||||
|
count := 2
|
||||||
|
if len(first.Values) < count {
|
||||||
|
count = len(first.Values)
|
||||||
|
}
|
||||||
|
return first.Values[:count]
|
||||||
|
}(),
|
||||||
|
}
|
||||||
|
}(),
|
||||||
|
)
|
||||||
|
|
||||||
|
// Set cache control headers based on data characteristics
|
||||||
|
setHistoryCacheControl(c, history)
|
||||||
|
|
||||||
|
// Set CORS headers
|
||||||
|
c.Response().Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
|
c.Response().Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
|
log.InfoContext(ctx, "time range response final",
|
||||||
|
"server_id", server.ID,
|
||||||
|
"server_ip", server.Ip,
|
||||||
|
"monitor_id", params.monitorID,
|
||||||
|
"time_range", params.to.Sub(params.from).String(),
|
||||||
|
"raw_data_points", len(logScores),
|
||||||
|
"grafana_series_count", len(grafanaResponse),
|
||||||
|
"max_data_points", params.maxDataPoints,
|
||||||
|
"response_is_null", grafanaResponse == nil,
|
||||||
|
"response_is_empty", len(grafanaResponse) == 0,
|
||||||
|
)
|
||||||
|
|
||||||
|
return c.JSON(http.StatusOK, grafanaResponse)
|
||||||
|
}
|
||||||
|
|
||||||
|
// testGrafanaTable returns sample data in Grafana table format for validation
|
||||||
|
func (srv *Server) testGrafanaTable(c echo.Context) error {
|
||||||
|
log := logger.Setup()
|
||||||
|
ctx, span := tracing.Tracer().Start(c.Request().Context(), "testGrafanaTable")
|
||||||
|
defer span.End()
|
||||||
|
|
||||||
|
log.InfoContext(ctx, "serving test Grafana table format",
|
||||||
|
"remote_ip", c.RealIP(),
|
||||||
|
"user_agent", c.Request().UserAgent(),
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generate sample data with realistic NTP Pool values
|
||||||
|
now := time.Now()
|
||||||
|
sampleData := GrafanaTimeSeriesResponse{
|
||||||
|
{
|
||||||
|
Target: "monitor{name=zakim1-yfhw4a}",
|
||||||
|
Tags: map[string]string{
|
||||||
|
"monitor_id": "126",
|
||||||
|
"monitor_name": "zakim1-yfhw4a",
|
||||||
|
"type": "monitor",
|
||||||
|
"status": "active",
|
||||||
|
},
|
||||||
|
Columns: []ColumnDef{
|
||||||
|
{Text: "time", Type: "time"},
|
||||||
|
{Text: "score", Type: "number"},
|
||||||
|
{Text: "rtt", Type: "number", Unit: "ms"},
|
||||||
|
{Text: "offset", Type: "number", Unit: "s"},
|
||||||
|
},
|
||||||
|
Values: [][]interface{}{
|
||||||
|
{now.Add(-10*time.Minute).Unix() * 1000, 20.0, 18.865, -0.000267},
|
||||||
|
{now.Add(-20*time.Minute).Unix() * 1000, 20.0, 18.96, -0.000390},
|
||||||
|
{now.Add(-30*time.Minute).Unix() * 1000, 20.0, 18.073, -0.000768},
|
||||||
|
{now.Add(-40*time.Minute).Unix() * 1000, 20.0, 18.209, nil}, // null offset example
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Target: "monitor{name=nj2-mon01}",
|
||||||
|
Tags: map[string]string{
|
||||||
|
"monitor_id": "84",
|
||||||
|
"monitor_name": "nj2-mon01",
|
||||||
|
"type": "monitor",
|
||||||
|
"status": "active",
|
||||||
|
},
|
||||||
|
Columns: []ColumnDef{
|
||||||
|
{Text: "time", Type: "time"},
|
||||||
|
{Text: "score", Type: "number"},
|
||||||
|
{Text: "rtt", Type: "number", Unit: "ms"},
|
||||||
|
{Text: "offset", Type: "number", Unit: "s"},
|
||||||
|
},
|
||||||
|
Values: [][]interface{}{
|
||||||
|
{now.Add(-10*time.Minute).Unix() * 1000, 19.5, 22.145, 0.000123},
|
||||||
|
{now.Add(-20*time.Minute).Unix() * 1000, 19.8, 21.892, 0.000089},
|
||||||
|
{now.Add(-30*time.Minute).Unix() * 1000, 20.0, 22.034, 0.000156},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add CORS header for browser testing
|
||||||
|
c.Response().Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
|
c.Response().Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
|
// Set cache control similar to other endpoints
|
||||||
|
c.Response().Header().Set("Cache-Control", "public,max-age=60")
|
||||||
|
|
||||||
|
log.InfoContext(ctx, "test Grafana table response sent",
|
||||||
|
"series_count", len(sampleData),
|
||||||
|
"response_size_approx", "~1KB",
|
||||||
|
)
|
||||||
|
|
||||||
|
return c.JSON(http.StatusOK, sampleData)
|
||||||
|
}
|
||||||
@@ -22,6 +22,23 @@ import (
|
|||||||
"go.ntppool.org/data-api/ntpdb"
|
"go.ntppool.org/data-api/ntpdb"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// sanitizeForCSV removes or replaces problematic characters for CSV output
|
||||||
|
func sanitizeForCSV(s string) string {
|
||||||
|
// Replace NULL bytes and other control characters with a placeholder
|
||||||
|
var result strings.Builder
|
||||||
|
for _, r := range s {
|
||||||
|
switch {
|
||||||
|
case r == 0: // NULL byte
|
||||||
|
result.WriteString("<NULL>")
|
||||||
|
case r < 32 && r != '\t' && r != '\n' && r != '\r': // Other control chars except tab/newline/carriage return
|
||||||
|
result.WriteString(fmt.Sprintf("<0x%02X>", r))
|
||||||
|
default:
|
||||||
|
result.WriteRune(r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.String()
|
||||||
|
}
|
||||||
|
|
||||||
type historyMode uint8
|
type historyMode uint8
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -52,7 +69,7 @@ type historyParameters struct {
|
|||||||
fullHistory bool
|
fullHistory bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (srv *Server) getHistoryParameters(ctx context.Context, c echo.Context) (historyParameters, error) {
|
func (srv *Server) getHistoryParameters(ctx context.Context, c echo.Context, server ntpdb.Server) (historyParameters, error) {
|
||||||
log := logger.FromContext(ctx)
|
log := logger.FromContext(ctx)
|
||||||
|
|
||||||
p := historyParameters{}
|
p := historyParameters{}
|
||||||
@@ -77,9 +94,18 @@ func (srv *Server) getHistoryParameters(ctx context.Context, c echo.Context) (hi
|
|||||||
switch monitorParam {
|
switch monitorParam {
|
||||||
case "":
|
case "":
|
||||||
name := "recentmedian.scores.ntp.dev"
|
name := "recentmedian.scores.ntp.dev"
|
||||||
monitor, err := q.GetMonitorByName(ctx, sql.NullString{Valid: true, String: name})
|
var ipVersion ntpdb.NullMonitorsIpVersion
|
||||||
|
if server.IpVersion == ntpdb.ServersIpVersionV4 {
|
||||||
|
ipVersion = ntpdb.NullMonitorsIpVersion{MonitorsIpVersion: ntpdb.MonitorsIpVersionV4, Valid: true}
|
||||||
|
} else {
|
||||||
|
ipVersion = ntpdb.NullMonitorsIpVersion{MonitorsIpVersion: ntpdb.MonitorsIpVersionV6, Valid: true}
|
||||||
|
}
|
||||||
|
monitor, err := q.GetMonitorByNameAndIPVersion(ctx, ntpdb.GetMonitorByNameAndIPVersionParams{
|
||||||
|
TlsName: sql.NullString{Valid: true, String: name},
|
||||||
|
IpVersion: ipVersion,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("could not find monitor", "name", name, "err", err)
|
log.Warn("could not find monitor", "name", name, "ip_version", server.IpVersion, "err", err)
|
||||||
}
|
}
|
||||||
monitorID = monitor.ID
|
monitorID = monitor.ID
|
||||||
case "*":
|
case "*":
|
||||||
@@ -96,12 +122,21 @@ func (srv *Server) getHistoryParameters(ctx context.Context, c echo.Context) (hi
|
|||||||
}
|
}
|
||||||
|
|
||||||
monitorParam = monitorParam + ".%"
|
monitorParam = monitorParam + ".%"
|
||||||
monitor, err := q.GetMonitorByName(ctx, sql.NullString{Valid: true, String: monitorParam})
|
var ipVersion ntpdb.NullMonitorsIpVersion
|
||||||
|
if server.IpVersion == ntpdb.ServersIpVersionV4 {
|
||||||
|
ipVersion = ntpdb.NullMonitorsIpVersion{MonitorsIpVersion: ntpdb.MonitorsIpVersionV4, Valid: true}
|
||||||
|
} else {
|
||||||
|
ipVersion = ntpdb.NullMonitorsIpVersion{MonitorsIpVersion: ntpdb.MonitorsIpVersionV6, Valid: true}
|
||||||
|
}
|
||||||
|
monitor, err := q.GetMonitorByNameAndIPVersion(ctx, ntpdb.GetMonitorByNameAndIPVersionParams{
|
||||||
|
TlsName: sql.NullString{Valid: true, String: monitorParam},
|
||||||
|
IpVersion: ipVersion,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == sql.ErrNoRows {
|
if err == sql.ErrNoRows {
|
||||||
return p, echo.NewHTTPError(http.StatusNotFound, "monitor not found").WithInternal(err)
|
return p, echo.NewHTTPError(http.StatusNotFound, "monitor not found").WithInternal(err)
|
||||||
}
|
}
|
||||||
log.WarnContext(ctx, "could not find monitor", "name", monitorParam, "err", err)
|
log.WarnContext(ctx, "could not find monitor", "name", monitorParam, "ip_version", server.IpVersion, "err", err)
|
||||||
return p, echo.NewHTTPError(http.StatusNotFound, "monitor not found (sql)")
|
return p, echo.NewHTTPError(http.StatusNotFound, "monitor not found (sql)")
|
||||||
}
|
}
|
||||||
monitorID = monitor.ID
|
monitorID = monitor.ID
|
||||||
@@ -110,7 +145,7 @@ func (srv *Server) getHistoryParameters(ctx context.Context, c echo.Context) (hi
|
|||||||
}
|
}
|
||||||
|
|
||||||
p.monitorID = int(monitorID)
|
p.monitorID = int(monitorID)
|
||||||
log.DebugContext(ctx, "monitor param", "monitor", monitorID)
|
log.DebugContext(ctx, "monitor param", "monitor", monitorID, "ip_version", server.IpVersion)
|
||||||
|
|
||||||
since, _ := strconv.ParseInt(c.QueryParam("since"), 10, 64) // defaults to 0 so don't care if it parses
|
since, _ := strconv.ParseInt(c.QueryParam("since"), 10, 64) // defaults to 0 so don't care if it parses
|
||||||
if since > 0 {
|
if since > 0 {
|
||||||
@@ -154,16 +189,6 @@ func (srv *Server) history(c echo.Context) error {
|
|||||||
return echo.NewHTTPError(http.StatusNotFound, "invalid mode")
|
return echo.NewHTTPError(http.StatusNotFound, "invalid mode")
|
||||||
}
|
}
|
||||||
|
|
||||||
p, err := srv.getHistoryParameters(ctx, c)
|
|
||||||
if err != nil {
|
|
||||||
if he, ok := err.(*echo.HTTPError); ok {
|
|
||||||
return he
|
|
||||||
}
|
|
||||||
log.ErrorContext(ctx, "get history parameters", "err", err)
|
|
||||||
span.RecordError(err)
|
|
||||||
return echo.NewHTTPError(http.StatusInternalServerError, "internal error")
|
|
||||||
}
|
|
||||||
|
|
||||||
server, err := srv.FindServer(ctx, c.Param("server"))
|
server, err := srv.FindServer(ctx, c.Param("server"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorContext(ctx, "find server", "err", err)
|
log.ErrorContext(ctx, "find server", "err", err)
|
||||||
@@ -182,6 +207,16 @@ func (srv *Server) history(c echo.Context) error {
|
|||||||
return echo.NewHTTPError(http.StatusNotFound, "server not found")
|
return echo.NewHTTPError(http.StatusNotFound, "server not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p, err := srv.getHistoryParameters(ctx, c, server)
|
||||||
|
if err != nil {
|
||||||
|
if he, ok := err.(*echo.HTTPError); ok {
|
||||||
|
return he
|
||||||
|
}
|
||||||
|
log.ErrorContext(ctx, "get history parameters", "err", err)
|
||||||
|
span.RecordError(err)
|
||||||
|
return echo.NewHTTPError(http.StatusInternalServerError, "internal error")
|
||||||
|
}
|
||||||
|
|
||||||
p.server = server
|
p.server = server
|
||||||
|
|
||||||
var history *logscores.LogScoreHistory
|
var history *logscores.LogScoreHistory
|
||||||
@@ -237,6 +272,7 @@ func (srv *Server) historyJSON(ctx context.Context, c echo.Context, server ntpdb
|
|||||||
Step float64 `json:"step"`
|
Step float64 `json:"step"`
|
||||||
Score float64 `json:"score"`
|
Score float64 `json:"score"`
|
||||||
MonitorID int `json:"monitor_id"`
|
MonitorID int `json:"monitor_id"`
|
||||||
|
Rtt *float64 `json:"rtt,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MonitorEntry struct {
|
type MonitorEntry struct {
|
||||||
@@ -246,6 +282,7 @@ func (srv *Server) historyJSON(ctx context.Context, c echo.Context, server ntpdb
|
|||||||
Ts string `json:"ts"`
|
Ts string `json:"ts"`
|
||||||
Score float64 `json:"score"`
|
Score float64 `json:"score"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
AvgRtt *float64 `json:"avg_rtt,omitempty"`
|
||||||
}
|
}
|
||||||
res := struct {
|
res := struct {
|
||||||
History []ScoresEntry `json:"history"`
|
History []ScoresEntry `json:"history"`
|
||||||
@@ -280,11 +317,23 @@ func (srv *Server) historyJSON(ctx context.Context, c echo.Context, server ntpdb
|
|||||||
|
|
||||||
// log.InfoContext(ctx, "got logScoreMonitors", "count", len(logScoreMonitors))
|
// log.InfoContext(ctx, "got logScoreMonitors", "count", len(logScoreMonitors))
|
||||||
|
|
||||||
|
// Calculate average RTT per monitor
|
||||||
|
monitorRttSums := make(map[uint32]float64)
|
||||||
|
monitorRttCounts := make(map[uint32]int)
|
||||||
|
|
||||||
|
for _, ls := range history.LogScores {
|
||||||
|
if ls.MonitorID.Valid && ls.Rtt.Valid {
|
||||||
|
monitorID := uint32(ls.MonitorID.Int32)
|
||||||
|
monitorRttSums[monitorID] += float64(ls.Rtt.Int32) / 1000.0
|
||||||
|
monitorRttCounts[monitorID]++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for _, lsm := range logScoreMonitors {
|
for _, lsm := range logScoreMonitors {
|
||||||
score := math.Round(lsm.ScoreRaw*10) / 10 // round to one decimal
|
score := math.Round(lsm.ScoreRaw*10) / 10 // round to one decimal
|
||||||
|
|
||||||
tempMon := ntpdb.Monitor{
|
tempMon := ntpdb.Monitor{
|
||||||
Name: lsm.Name,
|
// Hostname: lsm.Hostname,
|
||||||
TlsName: lsm.TlsName,
|
TlsName: lsm.TlsName,
|
||||||
Location: lsm.Location,
|
Location: lsm.Location,
|
||||||
ID: lsm.ID,
|
ID: lsm.ID,
|
||||||
@@ -299,6 +348,13 @@ func (srv *Server) historyJSON(ctx context.Context, c echo.Context, server ntpdb
|
|||||||
Score: score,
|
Score: score,
|
||||||
Status: string(lsm.Status),
|
Status: string(lsm.Status),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add average RTT if available
|
||||||
|
if count, exists := monitorRttCounts[lsm.ID]; exists && count > 0 {
|
||||||
|
avgRtt := monitorRttSums[lsm.ID] / float64(count)
|
||||||
|
me.AvgRtt = &avgRtt
|
||||||
|
}
|
||||||
|
|
||||||
res.Monitors = append(res.Monitors, me)
|
res.Monitors = append(res.Monitors, me)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,6 +371,10 @@ func (srv *Server) historyJSON(ctx context.Context, c echo.Context, server ntpdb
|
|||||||
offset := ls.Offset.Float64
|
offset := ls.Offset.Float64
|
||||||
res.History[i].Offset = &offset
|
res.History[i].Offset = &offset
|
||||||
}
|
}
|
||||||
|
if ls.Rtt.Valid {
|
||||||
|
rtt := float64(ls.Rtt.Int32) / 1000.0
|
||||||
|
res.History[i].Rtt = &rtt
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setHistoryCacheControl(c, history)
|
setHistoryCacheControl(c, history)
|
||||||
@@ -337,7 +397,7 @@ func (srv *Server) historyCSV(ctx context.Context, c echo.Context, history *logs
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
err := w.Write([]string{"ts_epoch", "ts", "offset", "step", "score", "monitor_id", "monitor_name", "leap", "error"})
|
err := w.Write([]string{"ts_epoch", "ts", "offset", "step", "score", "monitor_id", "monitor_name", "rtt", "leap", "error"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorContext(ctx, "could not write csv header", "err", err)
|
log.ErrorContext(ctx, "could not write csv header", "err", err)
|
||||||
return err
|
return err
|
||||||
@@ -361,6 +421,11 @@ func (srv *Server) historyCSV(ctx context.Context, c echo.Context, history *logs
|
|||||||
leap = fmt.Sprintf("%d", l.Attributes.Leap)
|
leap = fmt.Sprintf("%d", l.Attributes.Leap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var rtt string
|
||||||
|
if l.Rtt.Valid {
|
||||||
|
rtt = ff(float64(l.Rtt.Int32) / 1000.0)
|
||||||
|
}
|
||||||
|
|
||||||
err := w.Write([]string{
|
err := w.Write([]string{
|
||||||
strconv.Itoa(int(l.Ts.Unix())),
|
strconv.Itoa(int(l.Ts.Unix())),
|
||||||
// l.Ts.Format(time.RFC3339),
|
// l.Ts.Format(time.RFC3339),
|
||||||
@@ -370,8 +435,9 @@ func (srv *Server) historyCSV(ctx context.Context, c echo.Context, history *logs
|
|||||||
score,
|
score,
|
||||||
fmt.Sprintf("%d", l.MonitorID.Int32),
|
fmt.Sprintf("%d", l.MonitorID.Int32),
|
||||||
monName,
|
monName,
|
||||||
|
rtt,
|
||||||
leap,
|
leap,
|
||||||
l.Attributes.Error,
|
sanitizeForCSV(l.Attributes.Error),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("csv encoding error", "ls_id", l.ID, "err", err)
|
log.Warn("csv encoding error", "ls_id", l.ID, "err", err)
|
||||||
@@ -399,12 +465,12 @@ func setHistoryCacheControl(c echo.Context, history *logscores.LogScoreHistory)
|
|||||||
// cache for longer if data hasn't updated for a while; or we didn't
|
// cache for longer if data hasn't updated for a while; or we didn't
|
||||||
// find any.
|
// find any.
|
||||||
(time.Now().Add(-8 * time.Hour).After(history.LogScores[len(history.LogScores)-1].Ts)) {
|
(time.Now().Add(-8 * time.Hour).After(history.LogScores[len(history.LogScores)-1].Ts)) {
|
||||||
hdr.Set("Cache-Control", "s-maxage=3600,max-age=1800")
|
hdr.Set("Cache-Control", "s-maxage=260,max-age=360")
|
||||||
} else {
|
} else {
|
||||||
if len(history.LogScores) == 1 {
|
if len(history.LogScores) == 1 {
|
||||||
hdr.Set("Cache-Control", "s-maxage=60,max-age=35")
|
hdr.Set("Cache-Control", "s-maxage=60,max-age=35")
|
||||||
} else {
|
} else {
|
||||||
hdr.Set("Cache-Control", "s-maxage=240,max-age=120")
|
hdr.Set("Cache-Control", "s-maxage=90,max-age=120")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ func (srv *Server) Run() error {
|
|||||||
|
|
||||||
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
|
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
|
||||||
AllowOrigins: []string{
|
AllowOrigins: []string{
|
||||||
"http://localhost", "http://localhost:5173", "http://localhost:8080",
|
"http://localhost", "http://localhost:5173", "http://localhost:5174", "http://localhost:8080",
|
||||||
"https://www.ntppool.org", "https://*.ntppool.org",
|
"https://www.ntppool.org", "https://*.ntppool.org",
|
||||||
"https://web.beta.grundclock.com", "https://manage.beta.grundclock.com",
|
"https://web.beta.grundclock.com", "https://manage.beta.grundclock.com",
|
||||||
"https:/*.askdev.grundclock.com",
|
"https:/*.askdev.grundclock.com",
|
||||||
@@ -207,6 +207,9 @@ func (srv *Server) Run() error {
|
|||||||
e.GET("/api/usercc", srv.userCountryData)
|
e.GET("/api/usercc", srv.userCountryData)
|
||||||
e.GET("/api/server/dns/answers/:server", srv.dnsAnswers)
|
e.GET("/api/server/dns/answers/:server", srv.dnsAnswers)
|
||||||
e.GET("/api/server/scores/:server/:mode", srv.history)
|
e.GET("/api/server/scores/:server/:mode", srv.history)
|
||||||
|
e.GET("/api/dns/counts", srv.dnsQueryCounts)
|
||||||
|
e.GET("/api/v2/test/grafana-table", srv.testGrafanaTable)
|
||||||
|
e.GET("/api/v2/server/scores/:server/:mode", srv.scoresTimeRange)
|
||||||
|
|
||||||
if len(ntpconf.WebHostname()) > 0 {
|
if len(ntpconf.WebHostname()) > 0 {
|
||||||
e.POST("/api/server/scores/:server/:mode", func(c echo.Context) error {
|
e.POST("/api/server/scores/:server/:mode", func(c echo.Context) error {
|
||||||
@@ -261,7 +264,7 @@ func (srv *Server) userCountryData(c echo.Context) error {
|
|||||||
log.InfoContext(ctx, "didn't get zoneStats")
|
log.InfoContext(ctx, "didn't get zoneStats")
|
||||||
}
|
}
|
||||||
|
|
||||||
data, err := srv.ch.UserCountryData(c.Request().Context())
|
data, err := srv.ch.UserCountryData(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorContext(ctx, "UserCountryData", "err", err)
|
log.ErrorContext(ctx, "UserCountryData", "err", err)
|
||||||
return c.String(http.StatusInternalServerError, err.Error())
|
return c.String(http.StatusInternalServerError, err.Error())
|
||||||
@@ -276,6 +279,23 @@ func (srv *Server) userCountryData(c echo.Context) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (srv *Server) dnsQueryCounts(c echo.Context) error {
|
||||||
|
log := logger.Setup()
|
||||||
|
ctx, span := tracing.Tracer().Start(c.Request().Context(), "dnsQueryCounts")
|
||||||
|
defer span.End()
|
||||||
|
|
||||||
|
data, err := srv.ch.DNSQueries(ctx)
|
||||||
|
if err != nil {
|
||||||
|
log.ErrorContext(ctx, "dnsQueryCounts", "err", err)
|
||||||
|
return c.String(http.StatusInternalServerError, err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
hdr := c.Response().Header()
|
||||||
|
hdr.Set("Cache-Control", "s-maxage=30,max-age=60")
|
||||||
|
|
||||||
|
return c.JSON(http.StatusOK, data)
|
||||||
|
}
|
||||||
|
|
||||||
func healthHandler(srv *Server, log *slog.Logger) func(w http.ResponseWriter, req *http.Request) {
|
func healthHandler(srv *Server, log *slog.Logger) func(w http.ResponseWriter, req *http.Request) {
|
||||||
return func(w http.ResponseWriter, req *http.Request) {
|
return func(w http.ResponseWriter, req *http.Request) {
|
||||||
ctx := req.Context()
|
ctx := req.Context()
|
||||||
|
|||||||
Reference in New Issue
Block a user