Skip to content

Commit

Permalink
feat: option to ignore tracing for path (#8)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ibrunotome committed Feb 23, 2020
1 parent c975406 commit a2b9992
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/stackdriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
'workerNum' => 1,
],
],

'ignored_paths' => [],
],

'error_reporting' => [
Expand Down
5 changes: 5 additions & 0 deletions src/Stackdriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public function startTracing(): void
return;
}

$ignoredPaths = config('stackdriver.tracing.ignored_paths', []);
if ($this->app['request']->is($ignoredPaths)) {
return;
}

// Enable OpenCensus extension integrations
Laravel::load();
Mysql::load();
Expand Down

0 comments on commit a2b9992

Please sign in to comment.