Some Logic App Standard workflow runs are not logged to Log Analytics Workspace
- Dominant language
- ABAP
- Stars
- 424
- Forks
- 320
- Avg merge
- 14h 41m
- Merged PRs (30d)
- 1
Description
### Describe the Bug
My Logic App (standard) logs some, but not all, workflow runs to my Log Analytics Workspace.
These are my latest sucessful runs for a workflow. I'm in GMT+1 timezone, so subtract one hour to get UTC.

Given the above, and given the list of events mentioned in the documentation [here](https://learn.microsoft.com/en-us/azure/logic-apps/monitor-workflows-collect-diagnostic-data?tabs=standard#view-workflow-run-status), I am expecting to be able to use the diagnostic logs to track the following events:
- WorkflowRunStarted
- WorkflowRunCompleted
- WorkflowTriggerStarted
- WorkflowActionStarted
- WorkflowActionCompleted
... for the following UTC timestamps:
1. 13:11
2. 13:16
3. 13:23
4. 13:39
5. 13:48
6. 14:16
7. 14:09
8. 14:09 (again)
So let's go through each operation. I run this query, naturally with a time range to encompass the entire time range above), and I'm of course replacing the workflow name with my actual workflow name, and the operation name from the list above:
```
LogicAppWorkflowRuntime
| where WorkflowName == 'muh-workflow-name'
and OperationName == 'TheOperationName'
| sort by StartTime desc
| take 50
```
**WorkflowRunStarted**
Missing entries (UTC):
- 14:09 (one of them)
- 13:48
**WorkflowRunCompleted**
Missing entries (UTC):
- 14:09 (one of them)
- 13:48
- 13:16
**WorkflowTriggerStarted**

Missing entries (UTC):
- 14:09 (one of them)
- 13:48
- 13:16
**WorkflowActionStarted**
Missing entries (UTC):
- 14:09 (both of them)
- 13:48
- 13:16
**WorkflowActionCompleted**

Missing entries (UTC):
- 14:09 (both of them)
- 13:48
- 13:16
Note that 13:48 is notoriously missing from all of the above. It can only be found in the logs under the WorkflowRunDispatched Operation name.
Why the discrepancy? Why the seemingly random behavior? And specifically, for a workflow that consists of (in this case) two actions, how can these aspects be true simultaneously:
1. it reports multiple successful runs in the workflow Run history view in the Azure portal
2. only some of these runs are present under the WorkflowRunStarted event in the analytics workspace
3. only some of the runs that are under the WorkflowRunStarted event is also showing under the WorkflowActionStarted event
I mean for an obviously successful workflow that has at least one action, shouldn't the WorkflowRunStarted event **by necessity imply** that at least one WorkflowActionStarted vent is also present? This makes no sense at all.
Looking at resources.azure.com on this particular analytics workspace, the SKU is pergb2018, and I have a 30 day retention and a dailyQuotaGb of -1, so this shouldn't be due to some sort of data cap. I am not aware of there being any sort of setting for sampling rates or ratelimiting or whatnot in the Logic App itself. If there is some sort of rate limiting/429 issue under the hood when the Logic App is sending telemetry to the analytics workspace, is it even possible for me to troubleshoot it?
Unfortunately, all this renders the logging completely unreliable and unusable for Azure Logic Apps, especially when using tracked properties on specific actions in larger workflows, which is how I discovered this bug in the first place because some tracked properties were simply not coming through.
How do I fix this?
These are the diagnostic settings on the Logic App by the way:

### Plan Type
Standard
### Steps to Reproduce the Bug or Issue
Create a Logic App standard with a workflow with an HTTP trigger and some other action. Connect the Logic App to an Analytics Workspace and chose category "Workflow Runtime Logs" but leave the "AllMetrics" and "Function Application Logs" boxes unchecked, as per the screenshot in the description above.
Run the workflow a few times, wait the prerequisite time for everyting to actually end up in the analytics workspace (I have no idea if the official numbers of 5-10 minutes is correct) and then run the query suggested in the description above,. Expected result is that all workflow operations should be present, not only some of them.
### Workflow JSON
_No response_
### Screenshots or Videos
_No response_
### Additional context
_No response_
AB#17388362
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.