-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Same metric name with multiple scaled object defined #3588
Comments
I think that we shouldn't do this. The metric name is an internal KEDA thing that it's used to avoid conflicts. Previously we gave the option to "customize it" to avoid conflicts with duplicated metric names, but that it's already solved, and every metric is unique inside the SO. Some scalers have that option because they had it before the changes, and we are removing the support to it. @kedacore/keda-core-contributors ? |
Is the composition of the internal metric name specific per scaler or in general? Because from the example above, it looks like it's scaler specific (except for the s{n} previx) |
I think this is a scaler specific issue. i.e. when monitoring the metric from Prometheus, the "metric" name is too similar and hard to explain its exact meaning to others.
When the user has defined a meaningful metric name, I think the scaler need to at least pick up the origin trigger.metadata.metricName when creating their own one. That is what I am trying to do in PR #3589 . If there is any better solution to solve the monitoring pain point, I am glad to adopt as well :-) |
I'm not an expert on that scaler, but based on docs, users don't have any parameter to provide metric name, I guess that's because the scaler doesn't need that information for working. We try to avoid supporting extra metric name parameters because as I said, we used it to avoid conflicts that now don't happen any more. Is the ScaledObject name not enough for monitoring proposes? I mean, with the SO name you could get all the info |
@JorTurFer , scaledobject name is not enough. Per KEDA docs, it is recommended to define multiple triggers for the same scaling target,
That means, if you have a deployment A, and you hope to auto scale A under different conditions , you need to define a single scaledobject for A with multiple triggers. In this case, adding "scaledobject" name can't help at all to distinguish the different metric for triggers. In my example in original post, I defined 2 triggers based on the different query of "azure-data-explorer". , even adding "scaledobject name", the metric name will still be "s0-azure-data-explorer-dbName-scaledobjectName" and "s1-azure-data-explorer-dbName-scaledobjectName". These names are not meaningful enough. See metric example below, how can I tell the exactly meaning of the each metric?
So, I hope the customized trigger.metadata.metricName can be honored. The metricName is common in other scalers. |
I also vote for not including this parametr in the scaler metadata. We are actively trying to get rid of these, to avoid confusion. |
@zroubalik , then how to resolve the monitoring pain point? See my example: When creating the trigger, I set 2 different trigger.metadata.metricName , one is "inProgressTaskNumber", another is "pendingTaskNumber", but from the monitoring metric, all the meaningful info is erased. How can I explain to others that "s1" is the "inProgreesNumber" and "s2" is the "Pending"? I think metricName should not be treated to avoid duplication only. It does give people a place to add meaning description to the trigger. If metricName is not supported anymore, could we discuss to add a "metricDescription" field, and add the "metricDescription" into the metric "keda_metrics_adapter_scaler_metrics_value" ? |
Isn't the best solution that end-users can specify a suffix that we use after |
@tomkerkhove , yes, |
I completely understand the UX problem. Though I don't think this is the best solution. What I would suggest is to use this (at the moment unused) field: keda/apis/keda/v1alpha1/scaledobject_types.go Line 126 in 40da2e2
Basically to give a custom name to each trigger, that will be completely unrelated to the internal metric names. We can expose this property in the prom metrics. We will need to use such field anyway if we would like to have this functionality: #2440 (which is unrelated to this issue, but depends on the same). Another benefit is, that we could implement this for all scalers at once. WDYT? |
Sounds good to me |
That^ change should come hand in hand with a slow deprecation of |
@zroubalik , if my understanding is correct, I can start to define trigger.name directly in current KEDA version. But to show the "name" in grafana, additional code changes to enable "name" as a label is required. Correct? |
Correct. |
I think atm that field it's not documented but I'm willing to open a PR adding the field to the exported metrics and also documenting. |
@JorTurFer , I didn't notice your comments .... can you help to review? |
sure, I'll do it |
Report
We had multiple scaling metrics with azure-data-explorer-scaler when the metric extracted from the same azure-data-explorer-db, but from different query.
i.e I created a trigger using metricName "metric-A" to run query "query-A", then "metric-B" with run with "query-B"
With current implementation, both of the scaled object has the same metric name:
It is hard to remember the exactly query purpose with the
externalMetricNames
, which bring troubles with monitoring.Expected Behavior
I would like to suggest to add the orignal metadata.metricName in the final externalMetricNames, i.e. s0-metricName-A-azure-data-explorer-dbName in above example
Actual Behavior
Steps to Reproduce the Problem
See above description
Logs from KEDA operator
KEDA Version
No response
Kubernetes Version
No response
Platform
No response
Scaler Details
azure-data-explorer-scaler
Anything else?
I will raise a PR to address this issue
The text was updated successfully, but these errors were encountered: