You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.LogError(ex,"Failed to load partition information from topic '{topic}'",topicName);
85
+
}
86
+
}
87
+
returntopicPartitions;
68
88
}
69
89
catch(Exceptionex)
70
90
{
71
-
logger.LogError(ex,"Failed to load partition information from topic '{topic}'",this.topicName);
91
+
logger.LogError(ex,"Failed to load partition information from topics");
72
92
}
73
93
74
94
returnnewList<TopicPartition>();
@@ -123,7 +143,7 @@ public Task<KafkaTriggerMetrics> GetMetricsAsync()
123
143
124
144
if(partitionWithHighestLag!=Partition.Any)
125
145
{
126
-
logger.LogInformation("Total lag in '{topic}' is {totalLag}, highest partition lag found in {partition} with value of {offsetDifference}",this.topicName,totalLag,partitionWithHighestLag.Value,highestPartitionLag);
146
+
logger.LogInformation("Total lag in '{topic}' is {totalLag}, highest partition lag found in {partition} with value of {offsetDifference}",string.Join(",",topicNames),totalLag,partitionWithHighestLag.Value,highestPartitionLag);
@@ -167,8 +187,8 @@ private ScaleStatus GetScaleStatusCore(int workerCount, KafkaTriggerMetrics[] me
167
187
168
188
if(this.logger.IsEnabled(LogLevel.Information))
169
189
{
170
-
this.logger.LogInformation("WorkerCount ({workerCount}) > PartitionCount ({partitionCount}). For topic {topicName}, for consumer group {consumerGroup}.",workerCount,partitionCount,this.topicName,this.consumerGroup);
171
-
this.logger.LogInformation("Number of instances ({workerCount}) is too high relative to number of partitions ({partitionCount}). For topic {topicName}, for consumer group {consumerGroup}.",workerCount,partitionCount,this.topicName,this.consumerGroup);
190
+
this.logger.LogInformation("WorkerCount ({workerCount}) > PartitionCount ({partitionCount}). For topic {topicName}, for consumer group {consumerGroup}.",workerCount,partitionCount,string.Join(",",topicNames),this.consumerGroup);
191
+
this.logger.LogInformation("Number of instances ({workerCount}) is too high relative to number of partitions ({partitionCount}). For topic {topicName}, for consumer group {consumerGroup}.",workerCount,partitionCount,string.Join(",",topicNames),this.consumerGroup);
172
192
}
173
193
174
194
returnstatus;
@@ -182,7 +202,7 @@ private ScaleStatus GetScaleStatusCore(int workerCount, KafkaTriggerMetrics[] me
182
202
status.Vote=ScaleVote.ScaleIn;
183
203
if(this.logger.IsEnabled(LogLevel.Information))
184
204
{
185
-
this.logger.LogInformation("Topic '{topicName}', for consumer group {consumerGroup}' is idle.",this.topicName,this.consumerGroup);
205
+
this.logger.LogInformation("Topic '{topicName}', for consumer group {consumerGroup}' is idle.",string.Join(",",topicNames),this.consumerGroup);
186
206
}
187
207
188
208
returnstatus;
@@ -192,17 +212,17 @@ private ScaleStatus GetScaleStatusCore(int workerCount, KafkaTriggerMetrics[] me
192
212
if(totalLag>workerCount*lagThreshold)
193
213
{
194
214
if(workerCount<partitionCount)
195
-
{
215
+
{
196
216
status.Vote=ScaleVote.ScaleOut;
197
217
198
218
if(this.logger.IsEnabled(LogLevel.Information))
199
219
{
200
-
this.logger.LogInformation("Total lag ({totalLag}) is less than the number of instances ({workerCount}). Scale out, for topic {topicName}, for consumer group {consumerGroup}.",totalLag,workerCount,topicName,consumerGroup);
220
+
this.logger.LogInformation("Total lag ({totalLag}) is less than the number of instances ({workerCount}). Scale out, for topic {topicName}, for consumer group {consumerGroup}.",totalLag,workerCount,string.Join(",",topicNames),consumerGroup);
201
221
}
202
222
}
203
223
returnstatus;
204
224
}
205
-
225
+
206
226
// Samples are in chronological order. Check for a continuous increase in unprocessed message count.
207
227
// If detected, this results in an automatic scale out for the site container.
208
228
if(metrics[0].TotalLag>0)
@@ -220,13 +240,13 @@ private ScaleStatus GetScaleStatusCore(int workerCount, KafkaTriggerMetrics[] me
220
240
221
241
if(this.logger.IsEnabled(LogLevel.Information))
222
242
{
223
-
this.logger.LogInformation("Total lag ({totalLag}) is less than the number of instances ({workerCount}). Scale out, for topic {topicName}, for consumer group {consumerGroup}.",totalLag,workerCount,topicName,consumerGroup);
243
+
this.logger.LogInformation("Total lag ({totalLag}) is less than the number of instances ({workerCount}). Scale out, for topic {topicName}, for consumer group {consumerGroup}.",totalLag,workerCount,string.Join(",",topicNames),consumerGroup);
224
244
}
225
245
returnstatus;
226
246
}
227
247
}
228
248
}
229
-
249
+
230
250
if(workerCount>1)
231
251
{
232
252
boolqueueLengthDecreasing=IsTrueForLast(
@@ -246,12 +266,12 @@ private ScaleStatus GetScaleStatusCore(int workerCount, KafkaTriggerMetrics[] me
246
266
247
267
if(this.logger.IsEnabled(LogLevel.Information))
248
268
{
249
-
this.logger.LogInformation("Total lag length is decreasing for topic {topicName}, for consumer group {consumerGroup}.",this.topicName,this.consumerGroup);
250
-
}
251
-
}
269
+
this.logger.LogInformation("Total lag length is decreasing for topic {topicName}, for consumer group {consumerGroup}.",string.Join(",",topicNames),this.consumerGroup);
0 commit comments