File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Modules/CIPPCore/Public/Entrypoints/Timer Functions Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,29 @@ function Start-CIPPProcessorQueue {
2424 }
2525 if (Get-Command - Name $FunctionName - ErrorAction SilentlyContinue) {
2626 try {
27- Invoke-Command - ScriptBlock { & $FunctionName @Parameters }
27+ # Prepare telemetry metadata
28+ $metadata = @ {
29+ FunctionName = $FunctionName
30+ TriggerType = ' ProcessorQueue'
31+ QueueRowKey = $QueueItem.RowKey
32+ }
33+
34+ # Add parameters info if available
35+ if ($Parameters.Count -gt 0 ) {
36+ $metadata [' ParameterCount' ] = $Parameters.Count
37+ # Add common parameters
38+ if ($Parameters.Tenant ) {
39+ $metadata [' Tenant' ] = $Parameters.Tenant
40+ }
41+ if ($Parameters.TenantFilter ) {
42+ $metadata [' Tenant' ] = $Parameters.TenantFilter
43+ }
44+ }
45+
46+ # Wrap function execution with telemetry
47+ Measure-CippTask - TaskName $FunctionName - Metadata $metadata - Script {
48+ Invoke-Command - ScriptBlock { & $FunctionName @Parameters }
49+ }
2850 } catch {
2951 Write-Warning " Failed to run function $ ( $FunctionName ) . Error: $ ( $_.Exception.Message ) "
3052 }
You can’t perform that action at this time.
0 commit comments