-
Notifications
You must be signed in to change notification settings - Fork 257
[Payables Agent] Enhance historical data loading with error handling and telemetry #5106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Payables Agent] Enhance historical data loading with error handling and telemetry #5106
Conversation
// Load historical data | ||
LoadHistoricalDataIntoTempTable(TempPurchInvLine, VendorNo, EDocHistoricalMatchingSetup); | ||
// Load historical data with error handling | ||
if not TryLoadHistoricalData(TempPurchInvLine, VendorNo, EDocHistoricalMatchingSetup) then begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking a bit on all the AI tools we have, maybe we could move this to reused across all tools for consistent telemetry? Wdyt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment this is the only place we load large amounts of historical data, and I think this pattern will go away when we move to a model-first approach. So, I don't think refactoring this now to make generic is needed IMO.
This pull request introduces enhanced error handling and telemetry logging to the historical data loading process in the
E-Doc. Historical Matching
codeunit. The main improvements are focused on making the data load process more robust and observable, especially in error scenarios and performance tracking.Error handling and telemetry improvements:
[TryFunction]
procedureTryLoadHistoricalData
to wrap the historical data loading, enabling graceful handling of load failures.FeatureTelemetry.LogError
, including the e-document system ID and error message for better diagnostics.Performance and usage tracking:
LoadHistoricalDataIntoTempTable
procedure to measure and log the time taken, number of records loaded, and whether the record limit was reached, usingFeatureTelemetry.LogUsage
and a telemetry dimensions dictionary.Supporting changes:
HistoricalDataLoadFailedErr
,AIHistoricalDataLoadEventTok
) to improve error reporting and event tracking.FeatureTelemetry
,EDocSystemId
,ErrorMessage
,TelemetryDimensions
) to support the new functionality.Fixes AB#604259