app-insights-php / client
此包已被废弃且不再维护。未建议替代包。
Microsoft App Insights遥测客户端php包装器
0.3.0
2023-03-28 10:26 UTC
Requires
- php: ~8.1 || ~8.2
- app-insights-php/application-insights: ^0.5
- guzzlehttp/guzzle: ^7.4
- psr/log: ^1.1 || ^2.0 || ^3.0
- psr/simple-cache: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3
- phpunit/phpunit: ^8.5 || ^9.0
This package is auto-updated.
Last update: 2024-02-23 05:51:26 UTC
README
此类封装了microsoft/application-insights
包,允许根据当前需求进行配置。
它被创建来简化app-insights-php/app-insights-php-bundle
实现。
使用
$client = new AppInsightsPHP\Client\Factory( 'your_instrumentation_key', AppInsightsPHP\Client\Configuration::createDefault() ); $client->trackMessage(...); $client->trackRequest(...); // ... all methods available by source package
限制
遥测数据的大小限制为64千字节。在尝试向AppInsights发送任何内容之前,遥测将验证该要求。如果超过限制,将抛出异常。为了避免该异常,您应首先检查给定数据是否过大。您可以使用TelemetryData::exceededMaximumSize()
来完成此操作。