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

Support profiling for keda components #1250

Merged
merged 10 commits into from
Oct 31, 2023
34 changes: 34 additions & 0 deletions content/docs/2.13/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,38 @@ title = "Troubleshooting"
description = "How to address commonly encountered KEDA issues"
+++

## Troubleshoot keda errors using profiling
yuvalweber marked this conversation as resolved.
Show resolved Hide resolved

in golang we have the possibility to profile specific actions in order to determine what causes an issue.
For example, if our keda-operator pod is keeps getting OOM after a specific time, using profilig we can profile the heap and see what operatios taking all of this space.
yuvalweber marked this conversation as resolved.
Show resolved Hide resolved

Golang support many profiling options like heap, cpu, goroutines and more... (for more info check this site https://pkg.go.dev/net/http/pprof).

In keda we provide the option to enable profiling on each component separately by enabling it using
the helm chart and providing a port (if not enabled then it won't work)
yuvalweber marked this conversation as resolved.
Show resolved Hide resolved

```yaml
profiling:
keda:
enabled: false
port: 8082
metricsApiServer:
zroubalik marked this conversation as resolved.
Show resolved Hide resolved
enabled: false
port: 8083
webhooks:
enabled: false
port: 8084
```

If not using the helm chart then you can enabling the profiling on each on of the components by specifying
this argument:
yuvalweber marked this conversation as resolved.
Show resolved Hide resolved
```bash
--profiling-bind-address=":8082"
```
and it will be expose on the port you specify.
yuvalweber marked this conversation as resolved.
Show resolved Hide resolved

after enabling it you can port-forward or expose the service and use tool like go tool pprof in order to get profiling data.
yuvalweber marked this conversation as resolved.
Show resolved Hide resolved

For more info look at this document https://go.dev/blog/pprof.

{{< troubleshooting >}}