
FoF Sentry
fof/sentry
Flarum integration for Sentry
- Downloads
- 13,168
- Version control
- github.com/FriendsOfFlarum/sentry
- Discuss
- discuss.flarum.org/d/18089
Sentry by FriendsOfFlarum
A Flarum extension. Flarum integration for Sentry.
Installation
Install with composer:
composer require fof/sentry:"*"
Updating
composer update fof/sentry:"*"
Configuration
Configure the extension in the admin panel. You'll need to provide your Sentry DSN to get started.
Customizing Sentry for Developers
This extension provides an extender that allows other extensions to customize Sentry configuration. You can use this to set custom release versions, add tags, and more. All settings are applied to both the PHP backend and JavaScript frontend.
Basic Usage
In your extension's extend.php
file:
use FoF\Sentry\Extend\Sentry;
return [
// Other extenders
(new Sentry())
->setRelease('my-app-v1.2.3')
->setEnvironment('production')
->addTag('app_name', 'My Awesome App'),
];
Available Methods
setRelease(string $release)
Set a custom release version for Sentry events (applied to both backend and frontend):
(new Sentry())->setRelease('v2.0.0-beta.1');
setEnvironment(string $environment)
Set a custom environment name (applied to both backend and frontend):
(new Sentry())->setEnvironment('staging');
addTag(string $key, string $value)
Add a custom tag to all Sentry events (applied to both backend and frontend):
(new Sentry())
->addTag('server_type', 'dedicated')
->addTag('php_version', PHP_VERSION);
Example: Setting Environment Variables
You can use environment variables to configure Sentry:
(new Sentry())
->setRelease(env('APP_VERSION', 'development'))
->setEnvironment(env('APP_ENV', 'production'))
->addTag('server_id', env('SERVER_ID', 'unknown'));
Links
An extension by FriendsOfFlarum, commissioned by webdeveloper.com.
Versions
-
Version 1.4.0-beta.2.
Likely works with Flarum v1.8.10.
Unlikely to work with Flarum v2.0.0-beta.3.
-
33 additional versions.
-
Extension created.