-
Couldn't load subscription status.
- Fork 140
Instrument http add on operator #1328
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi folks, trying to get some eyes here but not really sure who to tag, thanks for any pointer in advance |
tests/checks/operator_otel_metrics/operator_otel_metrics_test.go
Outdated
Show resolved
Hide resolved
tests/checks/operator_otel_metrics/operator_otel_metrics_test.go
Outdated
Show resolved
Hide resolved
|
Thanks a lot for the contribution! |
723bbb9 to
176de5d
Compare
|
@elieser1101 could you please check those failing e2e tests? |
176de5d to
f56c1bd
Compare
|
I was able to reproduce the error in my local env. Was because of misconfig on go.mod. Also I rebased latest changes from main so this should work. lets see how e2e goes. @zroubalik @wozniakjan @JorTurFer for workflow approval. |
|
e2e went good on previous run, so fixing lints and some broken links from docs |
bbad4f2 to
bb94b8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds instrumentation for Prometheus-compatible endpoints and OpenTelemetry (OTEL) metrics to the KEDA HTTP Add-on operator. The implementation provides monitoring capabilities for HTTP scaled objects through both metrics collection methods.
- Added metrics collection infrastructure with Prometheus and OTEL exporters
- Implemented HTTP scaled object count tracking in the operator controller
- Added comprehensive end-to-end tests for both metrics collection methods
Reviewed Changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
operator/metrics/ |
New package containing metrics collection infrastructure with Prometheus and OTEL exporters |
operator/controllers/http/httpscaledobject_controller.go |
Updated controller to track HTTP scaled object metrics with thread-safe map |
operator/controllers/http/config/config.go |
Added metrics configuration structure with environment variable parsing |
operator/main.go |
Integrated metrics collectors initialization into main function |
tests/checks/operator_*_metrics/ |
Comprehensive E2E tests for both Prometheus and OTEL metrics |
docs/ |
Updated documentation with metrics configuration instructions |
config/ |
Added Kubernetes manifests for metrics service and E2E test configurations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
tests/checks/operator_prometheus_metrics/operator_prometheus_metrics_test.go
Show resolved
Hide resolved
tests/checks/operator_prometheus_metrics/operator_prometheus_metrics_test.go
Show resolved
Hide resolved
| namespacedName := scaledObject.Name + scaledObject.Namespace | ||
| metricsData, ok := httpScaledObjectPromMetricsMap[namespacedName] | ||
| if ok { | ||
| metrics.RecordDeleteHTTPScaledObjectCount(scaledObject.Namespace) |
Copilot
AI
Oct 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the map entry already exists, the code calls RecordDeleteHTTPScaledObjectCount before RecordHTTPScaledObjectCount, which could lead to incorrect metrics if the namespace changed. This logic appears to be attempting to handle namespace changes, but it's unclear and potentially buggy.
| metrics.RecordDeleteHTTPScaledObjectCount(scaledObject.Namespace) | |
| // Record deletion for the old namespace before updating | |
| metrics.RecordDeleteHTTPScaledObjectCount(metricsData.namespace) |
e2ccb2c to
af10bf6
Compare
Signed-off-by: Elieser Pereira <[email protected]>
af10bf6 to
ddaafca
Compare
Added instrumentation for promethues compatible endpoints and otel.
Added tests and e2e tests.
I went forward this ways as I was trying to get familiar with codebase. Happy to go in any direction reviewers advise.
Checklist
README.mddocs/directoryPart of #965