appinsights-client

azure application insights client for javascript

Usage no npm install needed!

<script type="module">
  import appinsightsClient from 'https://cdn.skypack.dev/appinsights-client';
</script>

README

AppInsights Client for Javascript

A javascript client to query App Insights REST API ...because the LogAnalyticsClient Azure SDK is not easy to use

Install

npm install appinsights-client

Usage

const AppInsightsClient = require('appinsights-client')
const client = AppInsightsClient('AI_APPID', 'AI_APIKEY')

const timespan = 'PT12H' // past 12 hrs
const query = 'customEvents | project name,timestamp,operation_Name,cloud_RoleName | limit 2'

const objects = await client.query(query, timespan)

API Reference

https://dev.applicationinsights.io/reference

Get an API Key

image