Skip to content

Commit a2b9992

Browse files
authored
feat: option to ignore tracing for path (#8)
* feat: add a tracing blacklist array in config file * feat: check if uri is blacklisted before trace it * refactor: blacklist array renamed to ignored_paths * refactor: exclude paths based on patterns
1 parent c975406 commit a2b9992

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

config/stackdriver.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
'workerNum' => 1,
8989
],
9090
],
91+
92+
'ignored_paths' => [],
9193
],
9294

9395
'error_reporting' => [

src/Stackdriver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ public function startTracing(): void
6161
return;
6262
}
6363

64+
$ignoredPaths = config('stackdriver.tracing.ignored_paths', []);
65+
if ($this->app['request']->is($ignoredPaths)) {
66+
return;
67+
}
68+
6469
// Enable OpenCensus extension integrations
6570
Laravel::load();
6671
Mysql::load();

0 commit comments

Comments
 (0)