- Introduction
- Overview of Sentry
- Integrating Sentry with TYPO3
- Frontend Performance Analysis
- TYPO3 CSP Reporting
- Sentry Integration with GitLab CI
- Optional Live Demo
- Q&A
- Why do you need centralized error logging / monitoring?
- Multi-Server Setup (think: Cloud)
- Many Projects in Maintenance Mode
- Editors! Marketers! (they do things!)
- Error Tracking
- Performance Monitoring
- Alerting
- SaaS or Self-Hosted Environment
- Various Integrations (Jira, GitLab, ...)
Note: Error Tracking easier, Performance a bit more work
%%
composer req networkteam/sentry-client
- Expose environment variables:
SENTRY_DSN=http://public_key@your-sentry-server.com/project-id
SENTRY_RELEASE=1.0.7
SENTRY_ENVIRONMENT=Staging
%%
Set ProductionExceptionHandler
in
config/system/settings.php
return [
// ...
'SYS' => [
productionExceptionHandler' =>
\Networkteam\SentryClient\ProductionExceptionHandler::class;
]
];
Optional:
\Networkteam\SentryClient\SentryLogWriter::class
Note: ExceptionHandler (Production or Debug is mostly enough), LogWriter can be used additionally.
%%
%%
- Automated solutions for Laravel and Symfony
- Manual tracking for TYPO3 necessary
- As a proof of concept:
composer require neusta/sentry-tracing-typo3
Note: Extends the Timetracker
%%
%%
$transactionContext = new \Sentry\Tracing\TransactionContext();
$transactionContext->setName('Example Transaction');
$transactionContext->setOp('http.server');
$transaction = \Sentry\startTransaction($transactionContext);
\Sentry\SentrySdk::getCurrentHub()->setSpan($transaction);
$spanContext = new \Sentry\Tracing\SpanContext();
$spanContext->setOp('expensive_operation');
$span1 = $transaction->startChild($spanContext);
\Sentry\SentrySdk::getCurrentHub()->setSpan($span1);
// whatever you want to trace goes here ...
$span1->finish();
\Sentry\SentrySdk::getCurrentHub()->setSpan($transaction);
$transaction->finish();
Note: See example extension for more info - once the next version of sentry_client is released, extending will be much easier.
- Moar JavaScript, moar FE performance important
- Web Vitals
- Error Tracing (incl. Client Info)
- Highly individual setup
%%
import * as Sentry from "@sentry/browser";
Sentry.init({
dsn: "https://yourkey@sentry.yourdomain.de/18",
integrations: [
new Sentry.BrowserTracing(),
],
tracesSampleRate: 0.2,
});
%%
%%
- Connect Backend & Frontend Metrics
- Sentry Meta Tags: baggage & sentry-trace
%%
<nsd:metaTag content="{sentry.baggage}" name="baggage" />
<nsd:metaTag content="{sentry.trace}" name="sentry-trace" />
<meta name="sentry-trace"
content="49879feb76c84743ba5034bd2d3f1ca3-7cb5535c930d4666-1"/>
<meta name="baggage"
content="sentry-trace_id=49879feb76c84743ba5034bd2d3f1ca3,
sentry-sample_rate=0.2,
sentry-transaction=my-transaction,sentry-public_key=public,
sentry-release=1.0.0,sentry-environment=prod">
Note: see example tracing extension for a data processor providing the necessary info from sentry
%%
- Use Sentry as endpoint for CSP errors
'BE' => [
'contentSecurityPolicyReportingUrl' =>
'https://sentry.neusta.de/api/18/security/?sentry_key=123',
],
'FE' => [
'contentSecurityPolicyReportingUrl' =>
'https://sentry.neusta.de/api/18/security/?sentry_key=123',
],
%%
- Know which release / commits are responsible for errors
- Get better StackTraces in Sentry
- Connect Gitlab, Github, Bitbucket or Phabricator
%%
sentry_release:
image: getsentry/sentry-cli:latest
script:
- export SENTRY_URL=https://sentry.neusta.de
- export SENTRY_AUTH_TOKEN=$NEUSTA_SENTRY_INTEGRATION_TOKEN
- export SENTRY_ORG=team-neusta
- export SENTRY_PROJECT=demo
- sentry-cli releases new "$CI_COMMIT_SHORT_SHA"
# the spaces are required - otherwise it won't work
- sentry-cli releases set-commits "$CI_COMMIT_SHORT_SHA" --commit \
"NSD / p_typo3_demo / TYPO3 Demo@$CI_COMMIT_SHA"
- sentry-cli releases finalize "$CI_COMMIT_SHORT_SHA"
- sentry-cli releases deploys "$CI_COMMIT_SHORT_SHA" new -e staging
Note: Gitlab integration has to be set up in Sentry
%%
- Use Sentry Relay to improve performance
- ... and to scrub data (GDPR / data privacy)
- SAML / SCIM Provisioning
- Frontend Session Replays
- Collecting User Feedback
- Multi-Project Performance Monitoring