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

Service Bus Scaler fails with metric name uniqueness if queue name is listed twice against different namespaces #1755

Closed
matthawley opened this issue Apr 23, 2021 · 7 comments · Fixed by #1810
Labels
bug Something isn't working

Comments

@matthawley
Copy link

Report

We have defined a scaled object in a way that we wish to monitor multiple namespaces (scale out scenarios) wherein the queue names are identical in each namespace.

Triggers:
    Authentication Ref:
      Name:  keda-authentication
    Metadata:
      Message Count:  50
      Namespace:      namespace1
      Queue Name:     tasks0
    Type:             azure-servicebus
    Authentication Ref:
      Name:  keda-authentication
    Metadata:
      Message Count:  50
      Namespace:      namespace2
      Queue Name:     tasks0

Expected Behavior

The scaled object should be allowed to scale across different namespaces with the same queue name.

Actual Behavior

The following message is output "metricName azure-servicebus-tasks0 defined multiple times in ScaledObject X, please refer the documentation how to define metricName manually" in logs.

Steps to Reproduce the Problem

  1. Create a new scaled object using the example triggers above.
  2. Deploy scaled object.
  3. Inspect the logs.

Logs from KEDA operator

2021-04-19T17:35:13.196Z	INFO	controllers.ScaledObject	Reconciling ScaledObject	{"ScaledObject.Namespace": "default", "ScaledObject.Name": "myjobs"}
2021-04-19T17:35:13.196Z	ERROR	controllers.ScaledObject	Error checking metric name uniqueness	{"ScaledObject.Namespace": "default", "ScaledObject.Name": "myjobs", "error": "metricName azure-servicebus-tasks0 defined multiple times in ScaledObject myjobs, please refer the documentation how to define metircName manually"}
github.com/go-logr/zapr.(*zapLogger).Error
	/go/pkg/mod/github.com/go-logr/zapr@v0.3.0/zapr.go:132
github.com/kedacore/keda/v2/controllers.(*ScaledObjectReconciler).Reconcile
	/workspace/controllers/scaledobject_controller.go:160
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.4/pkg/internal/controller/controller.go:244
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.4/pkg/internal/controller/controller.go:218
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker
	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.4/pkg/internal/controller/controller.go:197
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1
	/go/pkg/mod/k8s.io/apimachinery@v0.20.2/pkg/util/wait/wait.go:155
k8s.io/apimachinery/pkg/util/wait.BackoffUntil
	/go/pkg/mod/k8s.io/apimachinery@v0.20.2/pkg/util/wait/wait.go:156
k8s.io/apimachinery/pkg/util/wait.JitterUntil
	/go/pkg/mod/k8s.io/apimachinery@v0.20.2/pkg/util/wait/wait.go:133
k8s.io/apimachinery/pkg/util/wait.Until
	/go/pkg/mod/k8s.io/apimachinery@v0.20.2/pkg/util/wait/wait.go:90

KEDA Version

2.1.0

Kubernetes Version

1.19

Platform

Microsoft Azure

Scaler Details

Azure Service Bus

Anything else?

No response

@matthawley matthawley added the bug Something isn't working label Apr 23, 2021
@tomkerkhove
Copy link
Member

Thanks for reporting! We should include the namespace name in the metric name.

Are you willing to contribute this?

@matthawley
Copy link
Author

@tomkerkhove I would love to, except that I'm following the coding guide and I'm not able to get an remote container built. I could probably add the changes in a PR, but I couldn't verify anything.

@tomkerkhove
Copy link
Member

Thanks! Maybe @zroubalik can help with that?

@zroubalik
Copy link
Member

And what exactly is the problem? https://github.com/kedacore/keda/blob/main/BUILD.md#custom-keda-as-an-image should do the job.

@matthawley
Copy link
Author

The remote containers dockerfile is failing to build my image. Attached is the log file.
keda-logs.txt

@zroubalik
Copy link
Member

Sorry for the delay, I missed your answer. By chance, are you able to build the image directly (linux/OSX)? I don't use remote containers and don't have Windows box and we should get that fixed!

@matthawley
Copy link
Author

I don't have a linux machine, sorry - but it seems there's a PR out there, which is great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants