From a6f4ad4505780fd4225ef46eae36dbfa3c0f706b Mon Sep 17 00:00:00 2001 From: Craig O'Donnell Date: Wed, 18 Oct 2023 17:37:04 +0000 Subject: [PATCH] remove app metrics endpoint --- .github/actions/validate-endpoints/action.yml | 10 ---------- pkg/apiserver/server.go | 1 - pkg/handlers/app.go | 8 -------- 3 files changed, 19 deletions(-) diff --git a/.github/actions/validate-endpoints/action.yml b/.github/actions/validate-endpoints/action.yml index 0e205eea..b402c4ff 100644 --- a/.github/actions/validate-endpoints/action.yml +++ b/.github/actions/validate-endpoints/action.yml @@ -142,13 +142,3 @@ runs: exit 1 fi fi - - - name: Validate /app/metrics endpoint - shell: bash - run: | - appStatusMetric=$(curl -H 'Authorization: ${{ inputs.license-id }}' -s --fail --show-error localhost:8888/api/v1/app/metrics | jq -r '."X-Replicated-AppStatus"' | tr -d '\n') - - if [ "$appStatusMetric" != "ready" ]; then - echo "Expected app status metric 'X-Replicated-AppStatus' to be 'ready', but is set to '$appStatusMetric'." - exit 1 - fi diff --git a/pkg/apiserver/server.go b/pkg/apiserver/server.go index 20a784ca..8888b47d 100644 --- a/pkg/apiserver/server.go +++ b/pkg/apiserver/server.go @@ -66,7 +66,6 @@ func Start(params APIServerParams) { r.HandleFunc("/api/v1/app/info", handlers.GetCurrentAppInfo).Methods("GET") r.HandleFunc("/api/v1/app/updates", handlers.GetAppUpdates).Methods("GET") r.HandleFunc("/api/v1/app/history", handlers.GetAppHistory).Methods("GET") - authRouter.HandleFunc("/api/v1/app/metrics", handlers.GetAppMetrics).Methods("GET") r.HandleFunc("/api/v1/app/custom-metrics", handlers.SendCustomAppMetrics).Methods("POST") // integration diff --git a/pkg/handlers/app.go b/pkg/handlers/app.go index 89eb0bc6..5697cc36 100644 --- a/pkg/handlers/app.go +++ b/pkg/handlers/app.go @@ -11,7 +11,6 @@ import ( "github.com/pkg/errors" appstatetypes "github.com/replicatedhq/replicated-sdk/pkg/appstate/types" "github.com/replicatedhq/replicated-sdk/pkg/config" - "github.com/replicatedhq/replicated-sdk/pkg/heartbeat" "github.com/replicatedhq/replicated-sdk/pkg/helm" "github.com/replicatedhq/replicated-sdk/pkg/integration" integrationtypes "github.com/replicatedhq/replicated-sdk/pkg/integration/types" @@ -326,13 +325,6 @@ func mockReleaseToAppRelease(mockRelease integrationtypes.MockRelease) AppReleas return appRelease } -func GetAppMetrics(w http.ResponseWriter, r *http.Request) { - heartbeatInfo := heartbeat.GetHeartbeatInfo(store.GetStore()) - headers := heartbeat.GetHeartbeatInfoHeaders(heartbeatInfo) - - JSON(w, http.StatusOK, headers) -} - func SendCustomAppMetrics(w http.ResponseWriter, r *http.Request) { license := store.GetStore().GetLicense()