Lesson 2 of 2 Monitoring with Azure Monitor

Application Insights for Data APIs

This lesson explains Application Insights telemetry, Data API builder telemetry settings and how application and database monitoring combine.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the telemetry Application Insights collects.
  • Explain how DAB sends telemetry.
  • Identify how to correlate API and database monitoring.

What Application Insights collects

Application Insights is the application performance monitoring feature of Azure Monitor, backed by a Log Analytics workspace. Instrumented applications send requests (incoming calls with duration and result code), dependencies (outgoing calls, including SQL commands with duration and success), exceptions, traces and custom metrics. Each telemetry item carries an operation ID, so a slow API request can be followed to the exact SQL dependency that took the time. Instrumentation uses the Azure Monitor OpenTelemetry distribution, or auto-instrumentation on App Service, with a connection string.

Data API builder telemetry

DAB sends telemetry to Application Insights when runtime.telemetry.application-insights.connection-string is set (usually from @env()), or to any OpenTelemetry collector through runtime.telemetry.open-telemetry, and it can also send logs to Azure Log Analytics or files. REST, GraphQL and MCP requests are traced with OpenTelemetry spans, so agent tool calls appear next to ordinary API calls. runtime.telemetry.log-level sets verbosity per namespace and can be changed without a restart.

dab configure --runtime.telemetry.application-insights.enabled true \
  --runtime.telemetry.application-insights.connection-string "@env('APPLICATIONINSIGHTS_CONNECTION_STRING')"
True or false

DAB telemetry

Exam skills 2.4.6

Decide whether each statement about Data API builder telemetry is true.

Log in to try this activity Interactive activities are free with an account.

Combining application and database monitoring

A complete monitoring design combines the two views, as the following list explains.

  • Application Insights shows user-facing latency, failure rates and which API operations call which SQL statements.
  • Database diagnostic logs and Query Store show why a statement was slow: waits, blocking, plan changes or resource limits.
  • Both land in Log Analytics, so KQL queries and workbooks can correlate them by time and operation.
  • Alerts cover both sides: failed request rates and response times for the API, resource and blocking alerts for the database.

Sampling in Application Insights reduces cost for high-volume APIs while keeping representative traces.

Sort into groups

Application or database view?

Exam skills 2.4.6

Decide which monitoring source answers each question.

Log in to try this activity Interactive activities are free with an account.
Worked example

Slow API calls

Users report that some product searches through a DAB endpoint take several seconds, but database CPU is low. The team needs to know which requests are slow and which SQL calls they make. What should the developer enable?

Configure DAB's Application Insights telemetry with the connection string, then use the Performance view or a KQL query on requests and dependencies to find slow operations and their SQL dependency durations; follow up in Query Store or blocking logs for the specific statements. Database metrics alone cannot link a user's request to the statement it ran, and raising DAB's log level without a telemetry destination produces only local logs.

Check yourself

Which Application Insights telemetry type records the SQL commands an API runs?

Show answer

Dependencies, linked to the incoming request by an operation ID.

Exam Tips

Remember for the exam

  • End-to-end API tracing with SQL dependencies: Application Insights.
  • DAB telemetry: runtime.telemetry.application-insights or open-telemetry.
  • Correlate API and database data in Log Analytics with KQL.
  • Use sampling to control Application Insights cost for busy APIs.