Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to read the metrics through interceptors #812

Closed
chandramohank opened this issue Oct 8, 2023 · 11 comments
Closed

Unable to read the metrics through interceptors #812

chandramohank opened this issue Oct 8, 2023 · 11 comments
Labels
bug Something isn't working stale All issues that are marked as stale due to inactivity

Comments

@chandramohank
Copy link

Report

Insatlled the HttpAddOn and created the HttpScaler Object. However i am seeing the errors in Interceptor and external scaler Pod logs.

Http Scaler Object

kind: HTTPScaledObject
apiVersion: http.keda.sh/v1alpha1
metadata:
    name: webapp-demo-scaler
spec:
    targetPendingRequests: 10
    scaleTargetRef:
        deployment: webapp-demo
        service: webapp-demo
        port: 8080
    replicas:
        min: 1
        max: 3

image

Expected Behavior

Should not show any errors in Interceptor and external scaler pod logs. Should able to read the metrics without any erros.

Actual Behavior

Should able to retrieve the metrics without errors

Steps to Reproduce the Problem

Installed the HttpAddon on Azure AKS cluster and created the HttpScaler Object

Logs from KEDA HTTP operator

1. keda-add-ons-http-interceptor

{"level":"error","ts":1696737567.7369373,"logger":"Probe","caller":"handler/probe.go:63","msg":"health check function failed"
,"error":"table has not synced","errorVerbose":"table has not synced\ngithub.com/kedacore/http-add-on/pkg/routing.init\n\tgit
hub.com/kedacore/http-add-on/pkg/routing/table.go:25\nruntime.doInit\n\truntime/proc.go:6506\nruntime.doInit\n\truntime/proc.
go:6483\nruntime.doInit\n\truntime/proc.go:6483\nruntime.main\n\truntime/proc.go:233\nruntime.goexit\n\truntime/asm_amd64.s:1
598","stacktrace":"github.com/kedacore/http-add-on/interceptor/handler.(*Probe).check\n\tgithub.com/kedacore/http-add-on/inte
rceptor/handler/probe.go:63\ngithub.com/kedacore/http-add-on/interceptor/handler.(*Probe).Start\n\tgithub.com/kedacore/http-a
dd-on/interceptor/handler/probe.go:44"}
  1. keda-add-ons-http-external-scaler
{"level":"error","ts":1696737812.986016,"logger":"GetMetricSpec","caller":"scaler/handlers.go:117","msg":"unable to get HTTPS
caledObject","name":"keda-add-ons-http-interceptor","namespace":"demo-cluster-ns","error":"httpscaledobject.http.keda.sh \"ke
da-add-ons-http-interceptor\" not found","stacktrace":"main.(*impl).GetMetricSpec\n\tgithub.com/kedacore/http-add-on/scaler/h
andlers.go:117\ngithub.com/kedacore/keda/v2/pkg/scalers/externalscaler._ExternalScaler_GetMetricSpec_Handler\n\tgithub.com/ke
dacore/keda/[email protected]/pkg/scalers/externalscaler/externalscaler_grpc.pb.go:190\ngoogle.golang.
org/grpc.(*Server).processUnaryRPC\n\tgoogle.golang.org/[email protected]/server.go:1345\ngoogle.golang.org/grpc.(*Server).handleS
tream\n\tgoogle.golang.org/[email protected]/server.go:1722\ngoogle.golang.org/grpc.(*Server).serveStreams.func1.2\n\tgoogle.golan
g.org/[email protected]/server.go:966"}

HTTP Add-on Version

0.5.0

Kubernetes Version

1.26

Platform

Microsoft Azure

Anything else?

No response

@JorTurFer
Copy link
Member

Hello,
The error was in the HTTP add-on code and chart. We released a new version (0.6.0) last week with this and other fixes, please give it a try and let me know if this has solved

@chandramohank
Copy link
Author

Hi @JorTurFer

After upgraded to (0.6.0), the errors from keda-add-ons-http-external-scaler POD were gone. however i am still seeing the errors in keda-add-ons-http-interceptor POD.

{"level":"error","ts":1698145314.5528457,"logger":"Probe","caller":"handler/probe.go:63","msg":"health check function failed" ,"error":"table has not synced","stacktrace":"github.com/kedacore/http-add-on/interceptor/handler.(*Probe).check\n\tgithub.co m/kedacore/http-add-on/interceptor/handler/probe.go:63\ngithub.com/kedacore/http-add-on/interceptor/handler.(*Probe).Start\n\ tgithub.com/kedacore/http-add-on/interceptor/handler/probe.go:44"}

@JorTurFer
Copy link
Member

Do you see those errors all the time? The error means that the internal table for routes hasn't been generated yet, but it should disappear after some seconds

@chandramohank
Copy link
Author

chandramohank commented Oct 25, 2023 via email

@JorTurFer
Copy link
Member

Any idea @t0rr3sp3dr0 ?

@eumel8
Copy link

eumel8 commented Nov 4, 2023

The current chart doesn't exposed a port for the metrics so there is no endpoint:

$ kubectl -n keda get ep keda-add-ons-http-controller-manager-metrics-service
NAME                                                   ENDPOINTS   AGE
keda-add-ons-http-controller-manager-metrics-service   <none>      4h39m

the operator deployment needs to extend:

template:
    spec:
      containers:
        ports:
        - containerPort: 8443
          name: https
          protocol: TCP
$ kubectl -n keda get ep keda-add-ons-http-controller-manager-metrics-service
NAME                                                   ENDPOINTS         AGE
keda-add-ons-http-controller-manager-metrics-service   10.42.1.89:8443   4h41m

@JorTurFer
Copy link
Member

The service isn't correct, but it should point to metrics, we don't expose to https endpoint intentionally because we use a metrics proxy to protect the metrics through RBAC

@eumel8
Copy link

eumel8 commented Nov 6, 2023

ah, ok. Just wondering this service had no endpoints

@JorTurFer
Copy link
Member

ah, ok. Just wondering this service had no endpoints

Yeah, you are right and thanks to your comment I've noticed the gap. The PR is already opened 😄

Copy link

stale bot commented Jan 5, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Jan 5, 2024
Copy link

stale bot commented Jan 12, 2024

This issue has been automatically closed due to inactivity.

@stale stale bot closed this as completed Jan 12, 2024
@github-project-automation github-project-automation bot moved this from To Triage to Done in Roadmap - KEDA HTTP Add-On Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale All issues that are marked as stale due to inactivity
Projects
Status: Done
Development

No branches or pull requests

3 participants