Skip to content

Commit baabafe

Browse files
[ContainerApp] Fixing cloud role name issue with az containerapp function invocations (#9552)
1 parent bbe6f7a commit baabafe

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/containerapp/HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ upcoming
77
* 'az containerapp function invocations': Update application insights query
88
* 'az containerapp function keys': Update minimum replica check
99
* 'az containerapp list': Add `--kind` parameter to filter container apps by kind
10+
* 'az containerapp function invocations': Fix issue when cloud role name is set
1011

1112
1.3.0b1
1213
++++++

src/containerapp/azext_containerapp/containerapp_functions_decorator.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ def get_summary(self):
280280
invocation_summary_query = (
281281
f"requests | extend functionNameFromCustomDimension = tostring(customDimensions['faas.name']) "
282282
f"| where timestamp >= ago({timespan}) "
283-
f"| where cloud_RoleName =~ '{container_app_name}' "
284283
f"| where isempty(\"{revision_name}\") or cloud_RoleInstance contains '{revision_name}' "
285284
f"| where operation_Name =~ '{function_name}' or functionNameFromCustomDimension =~ '{function_name}' "
286285
f"| summarize SuccessCount = coalesce(countif(success == true), 0), ErrorCount = coalesce(countif(success == false), 0)"
@@ -312,11 +311,9 @@ def get_traces(self):
312311
revision_name = "" if self.active_revision_mode.lower() == "single" else revision_name
313312

314313
invocation_traces_query = (
315-
f"requests | extend functionNameFromCustomDimension = tostring(customDimensions['faas.name']) "
316-
f"| project timestamp, id, operation_Name, success, resultCode, duration, operation_Id, functionNameFromCustomDimension, "
317-
f"cloud_RoleName, cloud_RoleInstance, invocationId=coalesce(tostring(customDimensions['InvocationId']), tostring(customDimensions['faas.invocation_id'])) "
314+
f"requests | extend functionNameFromCustomDimension = tostring(customDimensions['faas.name']), "
315+
f"invocationId=coalesce(tostring(customDimensions['InvocationId']), tostring(customDimensions['faas.invocation_id'])) "
318316
f"| where timestamp > ago({timespan}) "
319-
f"| where cloud_RoleName =~ '{container_app_name}' "
320317
f"| where isempty(\"{revision_name}\") or cloud_RoleInstance contains '{revision_name}' "
321318
f"| where operation_Name =~ '{function_name}' or functionNameFromCustomDimension =~ '{function_name}' "
322319
f"| order by timestamp desc | take {limit} "

0 commit comments

Comments
 (0)