Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio
- **Metrics API Scaler**: Fix `aggregateFromKubeServiceEndpoints` using empty label selector that matched all EndpointSlices in the namespace instead of only the target service's ([#7641](https://github.com/kedacore/keda/issues/7641))
- **NATS JetStream Scaler**: Return an error from `getMaxMsgLag` when the configured consumer is missing instead of falling back to the stream's last sequence, preventing incorrect scale-up to `maxReplicaCount` ([#7657](https://github.com/kedacore/keda/issues/7657))
- **NATS JetStream Scaler**: URL-encode user input in monitoring URL construction ([#7483](https://github.com/kedacore/keda/pull/7483))
- **PredictKube Scaler**: Bump `dysnix/predictkube-libs` to `v0.1.0` (drops the predictkube path to the archived/EOL `go-grpc-prometheus` and to the deprecated `golang/protobuf`) and use a portable Prometheus-API instant query for the health check so the scaler works against VictoriaMetrics, Thanos and other Prometheus-API-compatible backends ([#7745](https://github.com/kedacore/keda/pull/7745))
- **Prometheus Scaler**: Handle NaN results in the same manner as Inf ([#7475](https://github.com/kedacore/keda/issues/7475))
- **Prometheus Scaler**: Limit HTTP error response logging ([#7469](https://github.com/kedacore/keda/pull/7469))
- **Pulsar Scaler**: Drop bearer/basic auth headers on redirects to a different host or on https->http downgrades to prevent credential leakage ([#7686](https://github.com/kedacore/keda/issues/7686))
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ require (
github.com/beanstalkd/go-beanstalk v0.2.0
github.com/bradleyfalzon/ghinstallation/v2 v2.18.0
github.com/cloudevents/sdk-go/v2 v2.16.2
github.com/dysnix/predictkube-libs v0.0.4-0.20250415003622-40081ddd4983
github.com/dysnix/predictkube-libs v0.1.0
github.com/dysnix/predictkube-proto v0.0.0-20250415003810-aa0af0a0019b
github.com/elastic/go-elasticsearch/v7 v7.17.10
github.com/expr-lang/expr v1.17.8
Expand Down Expand Up @@ -256,7 +256,6 @@ require (
github.com/googleapis/gax-go/v2 v2.21.0 // indirect
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
github.com/grafana/regexp v0.0.0-20250905093917-f7b3be9d1853 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
Expand Down
35 changes: 2 additions & 33 deletions go.sum

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion pkg/scalers/predictkube_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,10 @@ func parsePredictKubeMetadata(config *scalersconfig.ScalerConfig) (result *predi
}

func (s *PredictKubeScaler) ping(ctx context.Context) (err error) {
_, err = s.api.Runtimeinfo(ctx)
// Use a portable Prometheus-API instant query rather than
// /api/v1/status/runtimeinfo, which is Prometheus-only and not
// implemented by VictoriaMetrics, M3DB, Thanos sidecar, etc.
_, _, err = s.api.Query(ctx, "vector(1)", time.Now())
return err
}

Expand Down
21 changes: 15 additions & 6 deletions pkg/scalers/predictkube_scaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (
"net"
"net/http"
"net/http/httptest"
"strings"
"sync"
"testing"
"time"

libsSrv "github.com/dysnix/predictkube-libs/external/grpc/server"
pb "github.com/dysnix/predictkube-proto/external/proto/services"
"github.com/phayes/freeport"
prometheusV1 "github.com/prometheus/client_golang/api/prometheus/v1"
"github.com/prometheus/common/model"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"
Expand All @@ -26,12 +26,21 @@ import (
)

var apiStub = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.RequestURI == "/api/v1/status/runtimeinfo" {
// ping() now uses an instant Prometheus query (vector(1)) instead of
// /api/v1/status/runtimeinfo, for VictoriaMetrics-style backend compat.
if strings.HasPrefix(r.RequestURI, "/api/v1/query?") || r.RequestURI == "/api/v1/query" {
w.WriteHeader(http.StatusOK)
runtimeInfo := prometheusV1.RuntimeinfoResult{
StartTime: time.Now(),
result := struct {
Type model.ValueType `json:"resultType"`
Result interface{} `json:"result"`
}{
Type: model.ValScalar,
Result: model.Scalar{
Value: 1,
Timestamp: model.Now(),
},
}
data, _ := json.Marshal(runtimeInfo)
data, _ := json.Marshal(result)
response := struct {
Data json.RawMessage `json:"data"`
}{
Expand All @@ -40,7 +49,7 @@ var apiStub = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r
_ = json.NewEncoder(w).Encode(response)
return
}
if r.RequestURI == "/api/v1/query_range" {
if r.RequestURI == "/api/v1/query_range" || strings.HasPrefix(r.RequestURI, "/api/v1/query_range?") {
w.WriteHeader(http.StatusOK)
result := struct {
Type model.ValueType `json:"resultType"`
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Loading
Loading