MSBA-273 · Lesson 10 of 12 · 20 min

Monitoring integrations

▶ Video coming soon A video version of this lesson is on the way.

Every integration Signe had reviewed so far worked on the day it was demonstrated. The harder question, which Rupert asked at the start of the tenth session, was how anyone would know when one stopped working. Integrations fail quietly. A flow whose connection expired does not send an email to the registrar; it simply stops creating rows. A webhook receiver that returns errors leaves failed system jobs that nobody looks at. A sync whose delta token expired over a long weekend leaves Dataverse a little more out of date each day. The tenth session was about making failures visible quickly, to the right person, with enough information to fix them.

What to watch

Monitoring starts with deciding what healthy looks like. For each integration, Signe asked the owner to describe a few measurable signals, sometimes called service level indicators, and the threshold at which someone should be told.

Signals for integration health.
SignalQuestion it answersExample threshold
FreshnessHow old is the newest data that arrived?Supplier sync older than 26 hours
Error rateWhat share of operations failed?More than 2 in 100 messages failed in an hour
BacklogHow much work is waiting?More than 500 messages in the alarm queue for 15 minutes
Dead lettersHow many items could not be processed at all?Any new dead-lettered message
LatencyHow long does one item take end to end?Dispatch notification slower than 2 minutes
ThrottlingHow often are limits being hit?Sustained 429 responses for 10 minutes

Freshness was the signal Signe valued most, because it catches failures that produce no errors at all. A nightly job that silently stops running reports zero errors forever. A check that asks when the last successful run finished, and alerts when that time is too long ago, catches it the next morning.

An integration path from source system through queue and function to Dataverse and on to Fabric. Under each part, the monitoring source: system logs at the source, Service Bus metrics for queue length and dead letters, Application Insights for the function, plug-in trace logs, system jobs and exported Dataverse telemetry for Dataverse, and link status for Fabric. All feed alerts to the integration owner.
Where each monitoring signal comes from along an integration path.

Monitoring inside Dataverse

Dataverse records several kinds of operational information that integration owners should know how to find.

System jobs are the record of asynchronous work, including asynchronous plug-in steps, webhook and service endpoint posts, and bulk delete jobs. Each job shows its status, its start and end times and, when it failed, the error message. The system jobs view in the environment's settings can be filtered to failed or waiting jobs. Lumenvale's integration owners kept a saved view of failed jobs for their own solutions and checked it as part of a weekly routine, in addition to the automatic alerts.

The plug-in trace log records messages written by plug-ins through the tracing service, together with exceptions, when tracing is enabled in the environment's settings. Plug-ins that act as integration points, such as an Azure-aware plug-in or a custom virtual table provider, should trace the key decisions and the correlation identifier. Tracing every step in production creates a lot of data, so Lumenvale enabled exception-only tracing in production and full tracing in development and test.

Audit history shows who changed which columns and when, including changes made by application users. When a sync job writes a wrong value, audit history tells the investigator which job did it and when, provided auditing is enabled on the table and the job runs under its own application user, as Lesson 2 required.

Exporting telemetry to Application Insights

For richer monitoring, the Power Platform admin center can export telemetry to Azure Application Insights. Administrators configure the export for selected environments, and Dataverse then sends diagnostic and performance data, such as API requests and plug-in executions, to an Application Insights resource the organization owns; telemetry for other components such as model-driven apps and cloud flows can be exported in the same way. Once the data is in Application Insights, the team can query it with the Kusto Query Language, build dashboards and set alerts in Azure Monitor. The set of exported data has grown over time, so the current documentation is the guide to exactly what is available.

Lumenvale had connected its production environments to an Application Insights resource during the fall, as the earlier developer series described. For integrations the most valuable data was the API request telemetry, which showed each application user's request volume, error responses and durations, and made it easy to spot a job that had started receiving 429 responses.

Listing 10.1: A query over exported Dataverse telemetry (KQL, not executable here).
// KQL in Application Insights: Dataverse API requests by application user, last 24 hours,
// with error and throttling counts. Column names follow the exported schema; check yours.
requests
| where timestamp > ago(24h)
| extend user = tostring(customDimensions.UserId)
| summarize total = count(),
            failed = countif(success == false),
            throttled = countif(resultCode == "429"),
            p95ms = percentile(duration, 95)
          by user
| order by throttled desc, failed desc

Monitoring the Azure side

Azure Functions send their own telemetry to Application Insights when it is configured for the Function App: each invocation, its duration, exceptions, and dependency calls such as requests to Dataverse or Service Bus. Service Bus publishes metrics to Azure Monitor, including active message counts, dead-lettered message counts and server errors, for each queue and topic. Azure Monitor alert rules can fire on any of these, sending email, a Teams message or a call to an automation through an action group.

The D4 alarm design specified three alerts: dead-lettered messages greater than zero, active messages above 500 for fifteen minutes, and function failures above a small threshold over an hour. Each alert named an owner and pointed to a runbook entry. An alert without an owner or a runbook was, in Rupert's words, a way of making sure the whole team ignored it together.

Following one operation end to end

When an alarm fails to produce a work order, an investigator needs to follow it through every system it passed. That is only possible if each system records the same identifier. Signe's rule was that every message carried a correlation identifier from the moment it entered the integration: the gateway's alarm identifier was set as the Service Bus message identifier, logged by the ingest function with the Dataverse row identifier, passed to the custom API as a parameter, and written to the work order. Application Insights links operations within one request automatically through its operation identifier; the custom identifier carried the trail across the asynchronous gaps where automatic linking stops.

Listing 10.2: Tracing one alarm across functions by its identifier (KQL, not executable here).
// KQL: everything the D4 functions logged for one gateway alarm identifier.
union traces, exceptions, dependencies
| where timestamp > ago(7d)
| where tostring(customDimensions.AlarmId) == "LSB-BLR2-20261118-0610"
| project timestamp, itemType, operation_Name, message, outerMessage, target, resultCode
| order by timestamp asc

Monitoring flows

Cloud flows record run history, with each run's status, duration, trigger and the inputs and outputs of each action unless they are secured. Owners can see their flows' runs, and administrators can see flows across environments. A flow that fails repeatedly is eventually turned off automatically, and its owners are notified, but the notification goes to the owners, who may have moved on. Lumenvale's CoE tools listed flows whose owners had left and flows with recent failures, and Rupert's team reassigned or retired them.

Flows that matter should report their own failures rather than relying on someone reading run history. The catch scope pattern from Lesson 9 can post a message to the owning team's channel, create a row in an integration error table, or both. Production flows that run on a schedule should also be watched for freshness, because a schedule that stops firing produces no failures to catch.

A health table for integrations

To bring the signals together, Signe proposed a small Dataverse table, Integration Run, that every batch integration and scheduled flow would write to at the end of each run: the integration's name, the start and end times, the counts of rows read, written and rejected, and the final status. A model-driven view showed the latest run for each integration, and a scheduled flow checked the table each morning for any integration whose last successful run was older than its freshness threshold. The table gave Ysaline and other business owners a page they could read themselves without access to Azure.

Worked problem

Setting an error-rate alert

The supplier sync processes about 300 rows on a typical night. Historically, 1 or 2 rows are rejected each night because of incomplete data in LedgerPoint. The team wants an alert when rejections are unusual. Would an alert on any rejection work, and what threshold would make sense?

Show solution
  1. An alert on any rejection would fire almost every night, so the owner would learn to ignore it.
  2. Normal rejections are 1 or 2 in 300, which is under 1 percent.
  3. A threshold of more than 10 rejections, about 3 percent, would ignore normal noise but catch a mapping error or a change in LedgerPoint's data.
  4. A separate freshness alert covers the case where the job does not run at all.

Answer: Alert on more than about 10 rejections in a run, plus a freshness alert; review the threshold after a few months of data.

What not to log

Monitoring data is itself data, and it can leak what the integration protects. Lumenvale's logging rules, agreed with Dr. Philippa Ondaatje-Ruiz, were short. Log identifiers, counts, statuses, durations and error codes. Do not log access tokens, keys, connection strings or passwords under any circumstances. Do not log personal information, such as student names, contact details or health information, unless the privacy assessment for the solution explicitly allows it and the log store has matching controls. Keep logs only as long as needed, with retention set on the Application Insights resource and the trace log.

Secure inputs and outputs in flows, the trace-only-exceptions setting in production and careful choice of what a function writes to its logs all serve the same rule. When a developer needs detail to fix a problem, they reproduce it in test with test data, where full tracing is allowed.

Runbooks and ownership

An alert is only useful if someone knows what to do when it fires. Each integration's documentation included a runbook entry for each alert: what it means, how to check the cause, how to fix the usual causes, and when to escalate. The runbook for the supplier sync, for example, said what to do when the delta token had expired: run the job in full-resync mode, compare counts, and notify accounts payable that the morning's data might be late. Business owners were named alongside technical owners, so that the right person heard about a failure that affected their work.

A weekly integration review

Alerts catch sudden failures; slow drift needs a regular look. Lumenvale's integration owners met for twenty minutes each week with a short agenda: alerts that fired and what caused them, integrations with rising error or throttling counts, dead-letter and exception queues, credentials and certificates expiring in the next sixty days, and changes planned in connected systems. The meeting used the Integration Run view, the Application Insights dashboard and the CoE inventory, and each item ended with an owner and a date. Rupert kept the meeting short on purpose; its value lay in happening every week, not in being thorough.

Changes in connected systems deserved special attention. LedgerPoint's vendor released updates twice a year, the building management vendor patched its gateway quarterly, and Microsoft changed Power Platform every month. Each change could break an integration that had worked for months. The weekly review was where someone asked, before the change, which integrations touched the changing system and who would test them.

Testing the monitoring itself

A monitoring design that has never fired may not work. Signe asked each integration owner to test their alerts once, in the test environment, by causing each failure on purpose: stopping the function, sending a malformed message to the queue, pausing the nightly job past its freshness threshold, expiring a test credential. Each test confirmed that the alert fired, reached the right person, and that the runbook entry led to the fix. Two alerts failed the test in the first round, one because its action group sent email to a mailbox nobody read, and were corrected before the integrations they protected went live.

Common mistakes

  • MistakeMonitoring only for errors.

    InsteadAlso monitor freshness, because a job that stops running produces no errors.

  • MistakeAlerting on every single failure.

    InsteadSet thresholds from normal behavior so alerts are rare and meaningful.

  • MistakeCreating alerts without owners or runbooks.

    InsteadName an owner and write what to do for each alert.

  • MistakeLogging full message bodies with personal data.

    InsteadLog identifiers, counts and statuses; reproduce detail in test.

  • MistakeLosing the trail at queues and asynchronous steps.

    InsteadCarry one correlation identifier through every system.

  • MistakeLeaving full plug-in tracing on in production.

    InsteadTrace exceptions only in production and everything in test.

Summary and key terms

  • Useful signals are freshness, error rate, backlog, dead letters, latency and throttling, each with a threshold and an owner.
  • Inside Dataverse, system jobs, the plug-in trace log and audit history show asynchronous work, plug-in behavior and who changed what.
  • The admin center can export Dataverse and other Power Platform telemetry to Application Insights for KQL queries and alerts.
  • Functions and Service Bus report to Application Insights and Azure Monitor; alerts go to named owners with runbooks.
  • A correlation identifier carried through every system lets an investigator follow one item end to end.
  • Logs contain identifiers and counts, never secrets, and personal data only where the privacy assessment allows.
Service level indicator
A measurable signal of how well a service is working, such as freshness or error rate.
Freshness
How recently an integration last delivered data successfully.
System job
A Dataverse record of asynchronous work, such as an asynchronous plug-in step or webhook post.
Plug-in trace log
A Dataverse table that stores tracing messages and exceptions from plug-ins when tracing is enabled.
Application Insights
An Azure service that collects application telemetry for querying, dashboards and alerts.
Runbook
Written steps for responding to an alert or performing an operational task.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Why can a freshness alert catch problems that an error alert cannot?

    Show answer

    A job that stops running reports no errors, but its last successful run grows old.

  2. Where would you look for a failed asynchronous webhook post?

    Show answer

    In the system jobs list for the environment.

  3. What is the purpose of the Integration Run table?

    Show answer

    To record each run's counts and status so owners can see health and a morning check can alert on stale integrations.

  4. Name two things that must never appear in integration logs.

    Show answer

    Access tokens and keys or passwords; personal data unless explicitly allowed.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz