Skip to content

Add example for OTel scaler + metrics from nginx ingress controller#116

Merged
jkremser merged 3 commits into
kedify:mainfrom
jkremser:add-otel-nginx
Jun 30, 2026
Merged

Add example for OTel scaler + metrics from nginx ingress controller#116
jkremser merged 3 commits into
kedify:mainfrom
jkremser:add-otel-nginx

Conversation

@jkremser

Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
Copilot AI review requested due to automatic review settings June 30, 2026 13:43
@jkremser jkremser requested a review from a team as a code owner June 30, 2026 13:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new PoC sample (samples/otel-ingress-nginx-poc) demonstrating KEDA OTel Scaler usage with metrics scraped from the nginx ingress controller.

Changes:

  • Adds a setup script and README for deploying ingress-nginx metrics + OTel scaler.
  • Adds OTel Collector/scaler Helm values to scrape ingress metrics and forward them to the scaler.
  • Adds Kubernetes manifests for a simple frontend app plus KEDA ScaledObjects and Apollo Router chart values.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
samples/otel-ingress-nginx-poc/setup.sh Automates installing CRDs/router/ingress-nginx/OTel scaler and applying demo manifests.
samples/otel-ingress-nginx-poc/README.md Documents setup steps and links to the architecture diagram.
samples/otel-ingress-nginx-poc/otel-scaler-values.yaml Configures OTel Collector Prometheus scrape + filtering + export to the scaler.
samples/otel-ingress-nginx-poc/fe.yaml Defines a small Node-based frontend service and ingress to generate/receive traffic.
samples/otel-ingress-nginx-poc/fe-so.yaml ScaledObject intended to scale FE from ingress-nginx metrics via OTel scaler.
samples/otel-ingress-nginx-poc/be-so.yaml ScaledObject intended to scale the backend/router based on Kubernetes workload presence.
samples/otel-ingress-nginx-poc/apollo-values.yaml Apollo Router Helm values (supergraph init container + dev flags).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread samples/otel-ingress-nginx-poc/setup.sh
Comment thread samples/otel-ingress-nginx-poc/setup.sh Outdated
@@ -0,0 +1,31 @@
#!/bin/bash

k apply -f https://raw.githubusercontent.com/prometheus-community/helm-charts/refs/heads/main/charts/kube-prometheus-stack/charts/crds/crds/crd-servicemonitors.yaml
Comment thread samples/otel-ingress-nginx-poc/setup.sh Outdated
Comment on lines +4 to +8
helm upgrade -i msol-app-bff-main \
--namespace other-app \
--create-namespace \
oci://ghcr.io/apollographql/helm-charts/router \
-f apollo-values.yaml
Comment thread samples/otel-ingress-nginx-poc/setup.sh Outdated
Comment on lines +10 to +13
helm upgrade -i ingress-nginx ingress-nginx --reuse-values \
https://kubernetes.github.io/ingress-nginx \
--namespace ingress-nginx \
--set controller.metrics.enabled=true

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo this

Comment thread samples/otel-ingress-nginx-poc/otel-scaler-values.yaml
Comment on lines +5 to +8
helm upgrade -i nginx-ingress nginx-ingress --reuse-values \
https://kubernetes.github.io/ingress-nginx \
--namespace ingress-nginx \
--set controller.metrics.enabled=true

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo this


initContainers:
- name: init-graph
image: busybox:latest
Comment on lines +25 to +29
# to test:
# kubectl -n apollo-router port-forward svc/apollo-be-router 4000:80
# curl -s http://localhost:4000/ \
# -H 'content-type: application/json' \
# --data-binary '{"query":"query { __schema { queryType { fields { name } } } }"}' | jq
Comment on lines +19 to +21
3. create scaled objects


Copilot AI review requested due to automatic review settings June 30, 2026 14:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 11 comments.

Comment thread samples/otel-ingress-nginx-poc/setup.sh Outdated
@@ -0,0 +1,31 @@
#!/bin/bash
set -e
Comment thread samples/otel-ingress-nginx-poc/setup.sh Outdated
@@ -0,0 +1,31 @@
#!/bin/bash
set -e
k apply -f https://raw.githubusercontent.com/prometheus-community/helm-charts/refs/heads/main/charts/kube-prometheus-stack/charts/crds/crds/crd-servicemonitors.yaml
Comment thread samples/otel-ingress-nginx-poc/setup.sh Outdated
Comment on lines +4 to +8
helm upgrade -i msol-app-bff-main \
--namespace other-app \
--create-namespace \
oci://ghcr.io/apollographql/helm-charts/router \
-f apollo-values.yaml
Comment thread samples/otel-ingress-nginx-poc/setup.sh Outdated
Comment on lines +10 to +13
helm upgrade -i ingress-nginx ingress-nginx --reuse-values \
https://kubernetes.github.io/ingress-nginx \
--namespace ingress-nginx \
--set controller.metrics.enabled=true

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo this

Comment on lines +5 to +8
helm upgrade -i nginx-ingress nginx-ingress --reuse-values \
https://kubernetes.github.io/ingress-nginx \
--namespace ingress-nginx \
--set controller.metrics.enabled=true

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo this

Comment thread samples/otel-ingress-nginx-poc/otel-scaler-values.yaml
- type: kedify-otel
metadata:
scalerAddress: "keda-otel-scaler.keda.svc:4318"
metricQuery: "nginx_ingress_controller_connect_duration_seconds_count{service=msol-app-fe-main,namespace=app}"
Comment on lines +25 to +26
# to test:
# kubectl -n apollo-router port-forward svc/apollo-be-router 4000:80
Comment on lines +19 to +21
3. create scaled objects


Comment thread samples/otel-ingress-nginx-poc/setup.sh Outdated
Comment on lines +23 to +26
helm upgrade -i keda-otel-scaler -nkeda \
oci://ghcr.io/kedify/charts/otel-add-on \
--version=v0.1.3 \
-f ./otel-scaler-values.yaml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 9 comments.

Comment thread samples/otel-ingress-nginx-poc/setup.sh Outdated
Comment on lines +10 to +13
helm upgrade -i ingress-nginx ingress-nginx --reuse-values \
https://kubernetes.github.io/ingress-nginx \
--namespace ingress-nginx \
--set controller.metrics.enabled=true
Comment thread samples/otel-ingress-nginx-poc/setup.sh Outdated
Comment on lines +4 to +8
helm upgrade -i my-app-be \
--namespace other-app \
--create-namespace \
oci://ghcr.io/apollographql/helm-charts/router \
-f apollo-values.yaml
Comment thread samples/otel-ingress-nginx-poc/setup.sh Outdated
@@ -0,0 +1,31 @@
#!/bin/bash
set -e
k apply -f https://raw.githubusercontent.com/prometheus-community/helm-charts/refs/heads/main/charts/kube-prometheus-stack/charts/crds/crds/crd-servicemonitors.yaml
Comment thread samples/otel-ingress-nginx-poc/setup.sh Outdated
--version=v0.1.3 \
-f ./otel-scaler-values.yaml

k apply -f fe.yaml -f be-so.yaml -f fe-so.yaml
- type: kedify-otel
metadata:
scalerAddress: "keda-otel-scaler.keda.svc:4318"
metricQuery: "nginx_ingress_controller_connect_duration_seconds_count{service=my-app-fe,namespace=app}"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need, it accept both forms.. w/ quotes or w/o

Comment on lines +5 to +8
helm upgrade -i nginx-ingress nginx-ingress --reuse-values \
https://kubernetes.github.io/ingress-nginx \
--namespace ingress-nginx \
--set controller.metrics.enabled=true

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in fcc7ae2

# Architecture
![diagram](./diagram.png "Diagram")

[## https://excalidraw.com/#json=bMb11limAWMauy_ChBZFb,D-XdxbUT9BR6ZPcLszl5Fw](https://excalidraw.com/#json=VzaunOMs2NXOd_rTVy2yl,RU1vtVumsMIw-PxaUETKKw) No newline at end of file
Comment on lines +25 to +29
# to test:
# kubectl -n apollo-router port-forward svc/apollo-be-router 4000:80
# curl -s http://localhost:4000/ \
# -H 'content-type: application/json' \
# --data-binary '{"query":"query { __schema { queryType { fields { name } } } }"}' | jq
Comment on lines +19 to +21
3. create scaled objects


Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
@jkremser jkremser merged commit 65357ac into kedify:main Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants