-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Report
Hello
I think the azure_queue monitor is not reading the number of messages in the queue as it should
Looking at the code here I think that when Keda calculates the "visible messages" as 0 it returns 0, even though the actual number of messages in the queue is much higher
For example:
We see "showing 0 of 128503 messages in queue" in the portal, and Keda is also reporting 0 for the metric (even though the actual count is 128k) - see the right side in the screenshot
When we work with the c# SDK for azure storage we're getting the right numbers - see left side in the screen shot (csharp code below):
public async Task Run()
{
m_tracer.TraceInformation($"{nameof(StorageAccountMetricsLogger)} - Starting work.");
CloudStorageAccount storageAccount = m_aadStorageProvider.GetStorageAccount(m_queueStorageName);
var queueClient = storageAccount.CreateCloudQueueClient();
var queueNames = queueClient.ListQueues();
foreach (var cloudQueue in queueNames)
{
var dimension = new Dimensions();
dimension.SetDimension("Name", cloudQueue.Name);
var instrumentor = new Instrumentor(dimension);
await cloudQueue.FetchAttributesAsync();
if (!cloudQueue.ApproximateMessageCount.HasValue)
{
m_tracer.TraceWarning(0, $"{nameof(StorageAccountMetricsLogger)} - Failed to retrieve message count for storage queue {cloudQueue.Name}.");
continue;
}
instrumentor.LogMetric(s_monitoringStorageQueueActiveMessageCountMetricName, cloudQueue.ApproximateMessageCount.Value);
m_tracer.TraceInformation($"{nameof(StorageAccountMetricsLogger)} - Metrics for storage queue name \"{cloudQueue.Name}\" messages = {cloudQueue.ApproximateMessageCount}");
}
m_tracer.TraceInformation($"{nameof(StorageAccountMetricsLogger)} - Done.");
}
Expected Behavior
keda should report the actual # of messages in queue
Actual Behavior
keda is reporting 0 messages in queue
Steps to Reproduce the Problem
- add messages to azure queue
- query the queue with keda
Logs from KEDA operator
No response
KEDA Version
2.4.0
Kubernetes Version
1.19
Platform
Other
Scaler Details
Azure storage queue
Anything else?
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status