Azure AppInsights plugin for Apollo Server
This package provides integration with Application Insights (part of Azure Monitor) for metrics gathering within Apollo Server.
Usage
Install the package to your project
npm install -d @aaronpowell/apollo-server-plugin-appinsights
Create a resource in Azure, if required, and copy the Instrumentation Key.
Configure the plugin on your Apollo instance:
import appInsightsPlugin from "@aaronpowell/apollo-server-plugin-appinsights";
const server = new ApolloServer({
typeDefs,
resolvers,
plugins: [appInsightsPlugin(process.env.APP_INSIGHTS || "")],
});
Note: if you want to use your own TelemetryClient
for AppInsights, you can pass that into the appInsightsPlugin
, rather than the instrumentation key.