A package that monkey-patches Express and the Application Insights SDK for Node.js to automatically track Express middleware execution as dependency telemetry. It provides a setAutoCollectExpressMiddleware() method to enable collection, sending trackDependency() calls with middleware names and durations. Current version 0.0.5, last updated in May 2020. This is an early-stage project with no production guarantee; it is a WIP and likely has bugs. It targets the deprecated Azure Application Insights SDK and is not maintained actively. Consider the official @opentelemetry/instrumentation-express and @azure/monitor-opentelemetry for modern use cases.
npm install applicationinsights-express-middlewareNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Enables automatic tracking of Express middleware as dependencies in Azure Application Insights.
Migrate to @opentelemetry/instrumentation-express and @azure/monitor-opentelemetry.
Update your code to use the new internal names if you relied on undocumented internals.
Reorder requires: require('applicationinsights-express-middleware') first, then applicationinsights, then express.Restart the application to stop tracking.
Use @azure/monitor-opentelemetry with @opentelemetry/instrumentation-express instead.
Ensure you require('applicationinsights-express-middleware') before const appInsights = require('applicationinsights').Run npm install applicationinsights-express-middleware.
Call appInsights.setup('key').start() after requiring the middleware package.