Skip to content

Commit

Permalink
fixes tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkeschiren committed Feb 9, 2024
1 parent 5c9881d commit 67f27a6
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
tmp/
vendor/
node_modules/
.vscode
4 changes: 2 additions & 2 deletions Sentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public function addJsVariables(&$out)
$out .= "piwik.sentryDSN = '$dsn';\n";
$out .= "piwik.matomoRelease = '$version';\n";
$out .= "piwik.sentryEnv = '$dsnEnvironment';\n";
$out .= "piwik.autoSessionTracking = '$autoSessionTracking';\n";
$out .= "piwik.autoSessionTracking = $autoSessionTracking;\n";
$out .= "piwik.hostname = '$hostname';\n";
$out .= "piwik.tracesSampleRate = '$tracesSampleRate';\n";
$out .= "piwik.tracesSampleRate = $tracesSampleRate;\n";
}
}
2 changes: 1 addition & 1 deletion SystemSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ function (FieldConfig $field) {
}
);
}
}
}
6 changes: 3 additions & 3 deletions TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ Go to Sentry plugin dir:
composer install
```

Go to Matomo root (/var/www/html usually) run:
Go to Matomo root (/var/www/html usually) and run:

```bash
/var/www/html/plugins/Sentry/vendor/bin/phpstan analyze -c /var/www/html/plugins/Sentry/tests/phpstan.neon --level=5 /var/www/html/plugins/Sentry
```

## PHPCS
## PHP CodeSniffer

Go to Sentry plugin dir:

```bash
composer install
```

Run PHP Codesniffer
Run PHP CodeSniffer

```bash
vendor/bin/phpcs --ignore=*/vendor/*,*/node_modules/*,*.js --standard=PSR2 .
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"require": {
"sentry/sentry": "~4.5.0",
"sentry/sentry": "^4.5",
"symfony/http-client": "^6.4",
"http-interop/http-factory-guzzle": "^1.2"
"http-interop/http-factory-guzzle": "^1.2",
"monolog/monolog": "~1.11"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
Expand Down
88 changes: 87 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions javascripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
});
Sentry.setTag("hostname", piwik.hostname);
Sentry.init({
Vue: Vue,
dsn: piwik.sentryDSN,
release: piwik.matomoRelease,
environment: piwik.sentryEnv,
autoSessionTracking: piwik.autoSessionTracking,
integrations: [new Sentry.BrowserTracing()],
tracesSampleRate: piwik.tracesSampleRate
enableTracing: true,
integrations: [
Sentry.browserTracingIntegration()
],
tracesSampleRate: 1.0,

//tracesSampleRate: piwik.tracesSampleRate
});
}
})(jQuery, require);
4 changes: 2 additions & 2 deletions libs/bundle.min.js

Large diffs are not rendered by default.

0 comments on commit 67f27a6

Please sign in to comment.