diff --git a/app/vmctl/flags.go b/app/vmctl/flags.go index e075edcff..7aa227cd7 100644 --- a/app/vmctl/flags.go +++ b/app/vmctl/flags.go @@ -277,28 +277,28 @@ var ( }, &cli.BoolFlag{ Name: influxPrometheusMode, - Usage: "Wether to restore the original timeseries name previously written from Prometheus to InfluxDB v1 via remote_write.", + Usage: "Whether to restore the original timeseries name previously written from Prometheus to InfluxDB v1 via remote_write.", Value: false, }, &cli.StringFlag{ Name: influxCertFile, - Usage: "Optional path to client-side TLS certificate file to use when connecting to influxAddr", + Usage: "Optional path to client-side TLS certificate file to use when connecting to -influx-addr", }, &cli.StringFlag{ Name: influxKeyFile, - Usage: "Optional path to client-side TLS key to use when connecting to influxAddr", + Usage: "Optional path to client-side TLS key to use when connecting to -influx-addr", }, &cli.StringFlag{ Name: influxCAFile, - Usage: "Optional path to TLS CA file to use for verifying connections to influxAddr. By default, system CA is used", + Usage: "Optional path to TLS CA file to use for verifying connections to -influx-addr. By default, system CA is used", }, &cli.StringFlag{ Name: influxServerName, - Usage: "Optional TLS server name to use for connections to influxAddr. By default, the server name from influxAddr is used", + Usage: "Optional TLS server name to use for connections to -influx-addr. By default, the server name from -influx-addr is used", }, &cli.BoolFlag{ Name: influxInsecureSkipVerify, - Usage: "Whether to skip tls verification when connecting to infuxAddr", + Usage: "Whether to skip tls verification when connecting to -influx-addr", Value: false, }, } @@ -606,19 +606,19 @@ var ( }, &cli.StringFlag{ Name: remoteReadCertFile, - Usage: "Optional path to client-side TLS certificate file to use when connecting to remoteReadSrcAddr", + Usage: "Optional path to client-side TLS certificate file to use when connecting to -remote-read-src-addr", }, &cli.StringFlag{ Name: remoteReadKeyFile, - Usage: "Optional path to client-side TLS key to use when connecting to remoteReadSrcAddr", + Usage: "Optional path to client-side TLS key to use when connecting to -remote-read-src-addr", }, &cli.StringFlag{ Name: remoteReadCAFile, - Usage: "Optional path to TLS CA file to use for verifying connections to remoteReadSrcAddr. By default, system CA is used", + Usage: "Optional path to TLS CA file to use for verifying connections to -remote-read-src-addr. By default, system CA is used", }, &cli.StringFlag{ Name: remoteReadServerName, - Usage: "Optional TLS server name to use for connections to remoteReadSrcAddr. By default, the server name from remoteReadSrcAddr is used", + Usage: "Optional TLS server name to use for connections to remoteReadSrcAddr. By default, the server name from -remote-read-src-addr is used", }, &cli.BoolFlag{ Name: remoteReadInsecureSkipVerify, diff --git a/app/vmctl/remoteread/remoteread.go b/app/vmctl/remoteread/remoteread.go index 7dc9d92d3..349fbb165 100644 --- a/app/vmctl/remoteread/remoteread.go +++ b/app/vmctl/remoteread/remoteread.go @@ -65,7 +65,7 @@ type Config struct { // Is optional. LabelName, LabelValue string - // Optional cert file, key file, CA file and server name for client side TLS condiguration + // Optional cert file, key file, CA file and server name for client side TLS configuration CertFile string KeyFile string CAFile string @@ -110,10 +110,9 @@ func NewClient(cfg Config) (*Client, error) { } } - //create Transport tr, err := httputils.Transport(cfg.Addr, cfg.CertFile, cfg.KeyFile, cfg.CAFile, cfg.ServerName, cfg.InsecureSkipVerify) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to create transport: %s", err) } c := &Client{ diff --git a/app/vmctl/utils/time.go b/app/vmctl/time.go similarity index 86% rename from app/vmctl/utils/time.go rename to app/vmctl/time.go index 9b3b496b4..43dd7588d 100644 --- a/app/vmctl/utils/time.go +++ b/app/vmctl/time.go @@ -1,4 +1,4 @@ -package utils +package main import ( "fmt" @@ -13,8 +13,7 @@ const ( maxTimeMsecs = int64(1<<63-1) / 1e6 ) -// GetTime returns time from the given string. -func GetTime(s string) (time.Time, error) { +func parseTime(s string) (time.Time, error) { secs, err := promutils.ParseTime(s) if err != nil { return time.Time{}, fmt.Errorf("cannot parse %s: %w", s, err) diff --git a/app/vmctl/utils/time_test.go b/app/vmctl/time_test.go similarity index 98% rename from app/vmctl/utils/time_test.go rename to app/vmctl/time_test.go index fde14e1e2..989162078 100644 --- a/app/vmctl/utils/time_test.go +++ b/app/vmctl/time_test.go @@ -1,4 +1,4 @@ -package utils +package main import ( "testing" @@ -165,7 +165,7 @@ func TestGetTime(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := GetTime(tt.s) + got, err := parseTime(tt.s) if (err != nil) != tt.wantErr { t.Errorf("ParseTime() error = %v, wantErr %v", err, tt.wantErr) return diff --git a/app/vmctl/vm_native.go b/app/vmctl/vm_native.go index 3cbea821d..31375ae3d 100644 --- a/app/vmctl/vm_native.go +++ b/app/vmctl/vm_native.go @@ -16,7 +16,6 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/app/vmctl/limiter" "github.com/VictoriaMetrics/VictoriaMetrics/app/vmctl/native" "github.com/VictoriaMetrics/VictoriaMetrics/app/vmctl/stepper" - "github.com/VictoriaMetrics/VictoriaMetrics/app/vmctl/utils" "github.com/VictoriaMetrics/VictoriaMetrics/app/vmctl/vm" "github.com/VictoriaMetrics/VictoriaMetrics/app/vmselect/searchutils" "github.com/VictoriaMetrics/VictoriaMetrics/lib/logger" @@ -54,14 +53,14 @@ func (p *vmNativeProcessor) run(ctx context.Context) error { startTime: time.Now(), } - start, err := utils.GetTime(p.filter.TimeStart) + start, err := parseTime(p.filter.TimeStart) if err != nil { return fmt.Errorf("failed to parse %s, provided: %s, error: %w", vmNativeFilterTimeStart, p.filter.TimeStart, err) } end := time.Now().In(start.Location()) if p.filter.TimeEnd != "" { - end, err = utils.GetTime(p.filter.TimeEnd) + end, err = parseTime(p.filter.TimeEnd) if err != nil { return fmt.Errorf("failed to parse %s, provided: %s, error: %w", vmNativeFilterTimeEnd, p.filter.TimeEnd, err) } diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 3a87adccf..5c4266b7d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -30,6 +30,7 @@ The sandbox cluster installation is running under the constant load generated by * FEATURE: [Single-node VictoriaMetrics](https://docs.victoriametrics.com/) and `vmstorage` in [VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/): expose `vm_last_partition_parts` [metrics](https://docs.victoriametrics.com/#monitoring), which show the number of [parts in the latest partition](https://docs.victoriametrics.com/#storage). These metrics may help debugging query performance slowdown related to the increased number of parts in the last partition, since usually all the ingested data is written to the last partition and all the queries are performed over the recently ingested data, e.g. the last partition. * FEATURE: [vmctl](https://docs.victoriametrics.com/vmctl.html): support client-side TLS configuration for [InfluxDB](https://docs.victoriametrics.com/vmctl/#migrating-data-from-influxdb-1x). See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5748). Thanks to @khushijain21 [the pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5783). +* FEATURE: [vmctl](https://docs.victoriametrics.com/vmctl.html): support client-side TLS configuration for [Remote Read protocol](https://docs.victoriametrics.com/vmctl/#migrating-data-by-remote-read-protocol). See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5748). Thanks to @khushijain21 [the pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5798). ## [v1.98.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.98.0) @@ -68,7 +69,6 @@ Released at 2024-02-14 * BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): clear entered text in select after selecting a value. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5727). * BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): improve the operation of the context for autocomplete. See [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5736), [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5737) and [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5739) issues. * BUGFIX: [dashboards](https://grafana.com/orgs/victoriametrics): update `Storage full ETA` panels for Single-node and Cluster dashboards to prevent them from showing negative or blank results caused by increase of deduplicated samples. Deduplicated samples were part of the expression to provide a better estimate for disk usage, but due to sporadic nature of [deduplication](https://docs.victoriametrics.com/#deduplication) in VictoriaMetrics it rather produced skewed results. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5747). -* FEATURE: [vmctl](https://docs.victoriametrics.com/vmctl.html): support client-side TLS configuration for migration from remote read address. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5748) # [v1.97.2](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.97.2)