function SdkAutoloader::isExcludedUrl
Test whether a request URI is set, and if it matches the excluded urls configuration option
@internal
1 call to SdkAutoloader::isExcludedUrl()
- SdkAutoloader::autoload in vendor/
open-telemetry/ sdk/ SdkAutoloader.php
File
-
vendor/
open-telemetry/ sdk/ SdkAutoloader.php, line 246
Class
- SdkAutoloader
- @psalm-suppress RedundantCast
Namespace
OpenTelemetry\SDKCode
public static function isExcludedUrl() : bool {
$excludedUrls = Configuration::getList(Variables::OTEL_PHP_EXCLUDED_URLS, []);
if ($excludedUrls === []) {
return false;
}
$url = $_SERVER['REQUEST_URI'] ?? null;
if (!$url) {
return false;
}
foreach ($excludedUrls as $excludedUrl) {
if (preg_match(sprintf('|%s|', $excludedUrl), (string) $url) === 1) {
return true;
}
}
return false;
}