Closed mjneth closed 2 months ago
@mjneth thanks for reporting, are you willing to contribute a fix that will work for all solutions?
@mjneth thanks for reporting, are you willing to contribute a fix that will work for all solutions?
If I can find the time soon to dig deeper then i'll try. I think the solution is not include the hardcoded project ID when using the gcp-stackdriver scaler since people can add project_id to the filter query to match whatever they need to do.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed due to inactivity.
Report
The GCP Stackdriver scaler is unable to pull metrics from a centralized metrics scope project because it is hardcoded to add the wrong project ID. It was updated as part of issue #5256 and PR #5258 to add a project_id filter that is the project being queried but this breaks the query if you're pulling from a metrics scope project and trying to filter the query by a different project that is included in the metrics scope.
The changes in #5258 work if you want to query a metric that came from the same project your trigger is set to query from but that doesn't work if you use a separate, centralized metrics scope project.
Expected Behavior
The scaler can successfully pull metrics from a centralized metrics scope project.
Actual Behavior
The scaler can't pull metrics because the filter is hardcoded to add an incorrect resource label to the query.
Steps to Reproduce the Problem
ScaledObject
with a trigger that has type ofgcp-stackdriver
, projectId ofprojectC
, and a filter that queries the metric published in projectB.Logs from KEDA operator
My filter is:
filter: 'metric.type="prometheus.googleapis.com/our_custom_metric_name/gauge" AND metric.label.store_id="a.unique.id"'
Note that it's automatically adding
AND resource.labels.project_id=\"projectC\""
to the query that's not present in our filter which is causing it to fail.KEDA Version
2.14.0
Kubernetes Version
1.27
Platform
Google Cloud
Scaler Details
GCP Stackdriver
Anything else?
No response