Skip to content

Commit

Permalink
Merge pull request #27 from uselagoon/prometheus-status-check
Browse files Browse the repository at this point in the history
fix: update status to check for 2xx and any other 200 http code with regex
  • Loading branch information
shreddedbacon authored May 30, 2024
2 parents f4e9a82 + 85aba20 commit e6aae71
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 72 deletions.
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
domain: amazee.io
repo: github.com/amazeeio/aergia-controller
repo: github.com/uselagoon/aergia-controller
version: "2"
2 changes: 1 addition & 1 deletion build-push.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
REPO=${2:-amazeeio}
REPO=${2:-uselagoon}
TAG=${1:-latest}
IMGNAME=${3:-aergia}
echo "Creating image for $REPO/${IMGNAME}:$TAG and pushing to docker hub"
Expand Down
4 changes: 2 additions & 2 deletions controllers/idling_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"encoding/json"
"fmt"

"github.com/amazeeio/aergia-controller/handlers/idler"
"github.com/amazeeio/aergia-controller/handlers/unidler"
"github.com/go-logr/logr"
"github.com/uselagoon/aergia-controller/handlers/idler"
"github.com/uselagoon/aergia-controller/handlers/unidler"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/amazeeio/aergia-controller
module github.com/uselagoon/aergia-controller

go 1.21

Expand Down
2 changes: 1 addition & 1 deletion handlers/idler/service-kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (h *Idler) KubernetesServiceIdler(ctx context.Context, opLog logr.Logger, n
defer cancel()
// get the number of requests to any ingress in the exported namespace by status code
promQuery := fmt.Sprintf(
`round(sum(increase(nginx_ingress_controller_requests{exported_namespace="%s",status="200"}[%s])) by (status))`,
`round(sum(increase(nginx_ingress_controller_requests{exported_namespace="%s",status=~"2[0-9x]{2}"}[%s])) by (status))`,
namespace.ObjectMeta.Name,
prometheusInternalCheck,
)
Expand Down
61 changes: 0 additions & 61 deletions helm-update.sh

This file was deleted.

10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
"os"
"time"

"github.com/amazeeio/aergia-controller/controllers"
"github.com/amazeeio/aergia-controller/handlers/idler"
"github.com/amazeeio/aergia-controller/handlers/metrics"
"github.com/amazeeio/aergia-controller/handlers/unidler"
u "github.com/amazeeio/aergia-controller/handlers/unidler"
prometheusapi "github.com/prometheus/client_golang/api"
"github.com/prometheus/client_golang/prometheus"
"github.com/uselagoon/aergia-controller/controllers"
"github.com/uselagoon/aergia-controller/handlers/idler"
"github.com/uselagoon/aergia-controller/handlers/metrics"
"github.com/uselagoon/aergia-controller/handlers/unidler"
u "github.com/uselagoon/aergia-controller/handlers/unidler"
variables "github.com/uselagoon/machinery/utils/variables"
"gopkg.in/robfig/cron.v2"
"gopkg.in/yaml.v2"
Expand Down

0 comments on commit e6aae71

Please sign in to comment.