Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

app-insights-php/client

Folders and files

NameName
Last commit message
Last commit date
Mar 29, 2023
Feb 13, 2021
Mar 28, 2023
Feb 13, 2021
Feb 13, 2021
Aug 9, 2022
Mar 28, 2023
Feb 21, 2019
Sep 3, 2019
Mar 28, 2023
Jan 23, 2024
Feb 21, 2019

Repository files navigation

Microsoft App Insights PHP telemetry client wrapper

This class wraps microsoft/application-insights package allowing to configure it according to the current needs.

It was created to simplify app-insights-php/app-insights-php-bundle implementation.

Usage

$client = new AppInsightsPHP\Client\Factory(
    'your_instrumentation_key', 
    AppInsightsPHP\Client\Configuration::createDefault()
);

$client->trackMessage(...);
$client->trackRequest(...);
// ... all methods available by source package

Limitations

Size of the telemetry is limited to 64 kilobytes. Before trying to send anything to AppInsights a telemetry is validated against that requirement. If it exceeds the limit exception is thrown. To avoid that exception you should first check if the given data are not too big. You can use TelemetryData::exceededMaximumSize() do it for you.