Giter Site home page Giter Site logo

jop-software / typo3-sentry-client Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 143 KB

Use Sentry to track down errors in your TYPO3 installation!

Home Page: https://extensions.typo3.org/extension/typo3_sentry_client

License: GNU General Public License v2.0

PHP 99.51% Shell 0.49%
typo3-extension typo3 sentry sentry-integration typo3-cms-extension typo3-cms sentry-client hacktoberfest

typo3-sentry-client's Introduction

TYPO3 Sentry Client

This TYPO3 extension allows you to send exceptions that occur in a TYPO3 installation to Sentry.


CI - Pipeline

Professional Support

Professional support is available, please contact [email protected] for more information.

Installation

Install this TYPO3 Extension via composer.

composer require jop-software/typo3-sentry-client

Attention: Installation for non-composer installations on TYPO3 is not supported currently, because we depend on some composer packages. See Issue #4 for more information.

Configuration

Configuration is supported via TYPO3 Extension configuration and environment variables. See Settings > Extension Configuration > typo3_sentry_client in the TYPO3 backend.

You can overwrite those settings with environment variables:

###> jop-software/typo3-sentry-client
SetEnv SENTRY_ACTIVE true
SetEnv SENTRY_DSN http://[email protected]/projectId
SetEnv SENTRY_ENVIRONMENT Production
SetEnv SENTRY_TRACES_SAMPLE_RATE 1.0
SetEnv SENTRY_RELEASE 9.10.19
SetEnv SENTRY_ERROR_LEVEL 32767 # See https://www.php.net/manual/en/errorfunc.constants.php
###< jop-software/typo3-sentry-client

Add the productionExceptionHandler / debugExceptionHandler to your LocalConfiguration.php or AdditionalConfiguration.phpfile.

$GLOBALS['TYPO3_CONF_VARS']['SYS']['productionExceptionHandler'] = 'Jops\TYPO3\Sentry\Handler\ProductionExceptionHandler';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['debugExceptionHandler'] = 'Jops\TYPO3\Sentry\Handler\DebugExceptionHandler';

Multiple Environments

If you use the same .htaccess file for multiple environments like Production / Development, you can move the

SetEnv SENTRY_ENVIRONMENT Production

into the ApplicationContext section of the TYPO3 htaccess. e.G.:

# Rules to set ApplicationContext based on hostname
RewriteCond %{HTTP_HOST} ^dev\.example\.com$
RewriteRule .? - [E=TYPO3_CONTEXT:Development,E=SENTRY_ENVIRONMENT:Development]
RewriteCond %{HTTP_HOST} ^staging\.example\.com$
RewriteRule .? - [E=TYPO3_CONTEXT:Production/Staging,E=SENTRY_ENVIRONMENT:Production-Staging]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule .? - [E=TYPO3_CONTEXT:Production,E=SENTRY_ENVIRONMENT:Production]

Local Development

We use DDEV for local development. With the extension you get a complete TYPO3 DDEV setup. Type ddev start to start the container.

Headless

If you use EXT:headless, you can use the official @nuxtjs/sentry module for the frontend. There is great documentation available here.

This extension itself can be used together with EXT:headless without any known problems.

License

This project is licensed under GPL-2.0-or-later, see the LICENSE file for more information.

typo3-sentry-client's People

Contributors

cngjo avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

mbrodala

typo3-sentry-client's Issues

Installation without composer

This extension cannot be installed without composer currently.
We rely on some composer packages, which are not part of TYPO3 itself.

Is it possible to run composer install when creating a release and include the vendor directory in the ZIP-Archive Github generates for the release?
Also: I guess we need to adjust dependency loading.

Is this even worth it? How many TYPO3 installations nowadays do not use composer?

EDIT
It seems like there is a pretty easy way with composer to accomplish this.
Example from EXT:solr: TYPO3's EXT:solr does this: https://github.com/TYPO3-Solr/ext-solr/blob/main/Resources/Private/Php/ComposerLibraries/composer.json

Can we support headless?

For the Headless PWA approcah we would need to inject a JS SDK into NuxtJS.
I guess thats better haused in a separate plugin.

Check weather is makes sense to create a own typo3-nuxt-pwa extension or if we can reccomend an existing NuxtJS Sentry Integration.

feat: send user data bag

Send use information in a user databag to sentry.
This feature should be Opt-In because of data protection rules.

chore: compatability to TYPO3 12.0

  • Check and ensure compatability with TYPO3 12
  • Run CI against 11 and 12

Note: When possible both Version 11 and 12 should be supported in the same major version.

Performance Issues

Can this extension lead to performance issues? And If so, how can we mitigate them?

feat: transaction support for CLI processes

Followup for 0970039 and #35.

This change deactivated transaction support for cli processes.

Tasks

  • Start transaction for cli
  • Stop transaction for cli
    The middleware doesn't get executed. We need to find another way to finish the transaction in cli context.

Improve test Suite

  • Run agains PHP 7.4, 8.0 and 8.1
  • Searate Linting and testing into multiple workflows / jobs

feat: add an easy way to test the integration

There should be an option to send a example exception to Sentry from the Backend.

Two options

  1. A Button in the extension configuration
  2. A Button in the "Clear Cache" dropdown

In the case of Option 2, should the permission to test the integration be configurable to prevent abuse.

PHPStan

Install and configure phpstan/phpstan.
PHPStan should also run in pipelines for each push / pull-request.

feat: blacklist exceptions

There should be an options to blacklist exceptions.

Introduce a new system configuration that contains a regex that gets matches agains every exception FQCN of the exception.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.