Skip to content

Commit

Permalink
Merge pull request #587 from getsentry/3.x
Browse files Browse the repository at this point in the history
Laravel SDK version 3.0.0
  • Loading branch information
cleptric committed Oct 18, 2022
2 parents 9cfb082 + ab86de5 commit 81f8c8e
Show file tree
Hide file tree
Showing 41 changed files with 786 additions and 1,229 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/ci.yaml
Expand Up @@ -21,14 +21,6 @@ jobs:
php: [ "8.1", "8.0", "7.4", "7.3", "7.2" ]
packages:
# All versions below should be test on PHP ^7.1 (Sentry SDK requirement)
- { laravel: 5.1.*, testbench: 3.1.*, phpunit: 5.7.* }
- { laravel: 5.2.*, testbench: 3.2.*, phpunit: 5.7.* }
- { laravel: 5.3.*, testbench: 3.3.*, phpunit: 5.7.* }
- { laravel: 5.4.*, testbench: 3.4.*, phpunit: 5.7.* }
- { laravel: 5.5.*, testbench: 3.5.*, phpunit: 6.5.* }
- { laravel: 5.6.*, testbench: 3.6.*, phpunit: 7.5.* }
- { laravel: 5.7.*, testbench: 3.7.*, phpunit: 7.5.* }
- { laravel: 5.8.*, testbench: 3.8.*, phpunit: 7.5.* }
- { laravel: ^6.0, testbench: 4.7.*, phpunit: 8.4.* }
- { laravel: ^7.0, testbench: 5.1.*, phpunit: 8.4.* }

Expand All @@ -48,43 +40,11 @@ jobs:
- php: "7.2"
packages: { laravel: ^8.0, testbench: ^6.0, phpunit: 9.3.* }

- php: "8.0"
packages: { laravel: 5.1.*, testbench: 3.1.*, phpunit: 5.7.* }
- php: "8.0"
packages: { laravel: 5.2.*, testbench: 3.2.*, phpunit: 5.7.* }
- php: "8.0"
packages: { laravel: 5.3.*, testbench: 3.3.*, phpunit: 5.7.* }
- php: "8.0"
packages: { laravel: 5.4.*, testbench: 3.4.*, phpunit: 5.7.* }
- php: "8.0"
packages: { laravel: 5.5.*, testbench: 3.5.*, phpunit: 6.5.* }
- php: "8.0"
packages: { laravel: 5.6.*, testbench: 3.6.*, phpunit: 7.5.* }
- php: "8.0"
packages: { laravel: 5.7.*, testbench: 3.7.*, phpunit: 7.5.* }
- php: "8.0"
packages: { laravel: 5.8.*, testbench: 3.8.*, phpunit: 7.5.* }
- php: "8.0"
packages: { laravel: ^6.0, testbench: 4.7.*, phpunit: 8.4.* }
- php: "8.0"
packages: { laravel: ^7.0, testbench: 5.1.*, phpunit: 8.4.* }

- php: "8.1"
packages: { laravel: 5.1.*, testbench: 3.1.*, phpunit: 5.7.* }
- php: "8.1"
packages: { laravel: 5.2.*, testbench: 3.2.*, phpunit: 5.7.* }
- php: "8.1"
packages: { laravel: 5.3.*, testbench: 3.3.*, phpunit: 5.7.* }
- php: "8.1"
packages: { laravel: 5.4.*, testbench: 3.4.*, phpunit: 5.7.* }
- php: "8.1"
packages: { laravel: 5.5.*, testbench: 3.5.*, phpunit: 6.5.* }
- php: "8.1"
packages: { laravel: 5.6.*, testbench: 3.6.*, phpunit: 7.5.* }
- php: "8.1"
packages: { laravel: 5.7.*, testbench: 3.7.*, phpunit: 7.5.* }
- php: "8.1"
packages: { laravel: 5.8.*, testbench: 3.8.*, phpunit: 7.5.* }
- php: "8.1"
packages: { laravel: ^6.0, testbench: 4.7.*, phpunit: 8.4.* }
- php: "8.1"
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,13 +2,41 @@

## Unreleased

## 3.0.0

**New features**

- We are now creating more spans to give you better insights into the performance of your application
- Add a `http.client` span. This span indicates the time that is spent when using the Laravel HTTP client (#585)
- Add a `http.route` span. This span indicates the time that is spent inside a controller method or route closure (#593)
- Add a `db.transaction` span. This span indicates the time that is spent inside a database transaction (#594)
- Add support for [Dynamic Sampling](https://docs.sentry.io/product/data-management-settings/dynamic-sampling/), allowing developers to set a server-side sampling rate without the need to re-deploy their applications
- Add support for Dynamic Sampling (#572)

**Breaking changes**

- Laravel Lumen is no longer supported
- Drop support for Laravel Lumen (#579)
- Laravel versions 5.0 - 5.8 are no longer supported
- Drop support for Laravel 5.x (#581)
- Remove `Sentry\Integration::extractNameForRoute()`, it's alternative `Sentry\Integration::extractNameAndSourceForRoute()` is marked as `@internal` (#580)
- Remove internal `Sentry\Integration::currentTracingSpan()`, use `SentrySdk::getCurrentHub()->getSpan()` if you were using this internal method (#592)

**Other changes**

- Set the tracing transaction name on the `Illuminate\Routing\Events\RouteMatched` instead of at the end of the request (#580)
- Remove extracting route name or controller for transaction names (#583). This unifies the transaction names to a more concise format.
- Simplify Sentry meta tag retrieval, by adding `Sentry\Laravel\Integration::sentryMeta()` (#586)
- Fix tracing with nested queue jobs (mostly when running jobs in the `sync` driver) (#592)

## 2.14.2

- Fix extracting command input resulting in errors when calling Artisan commands programatically with `null` as an argument value (#589)

## 2.14.1

- Fix not setting the correct SDK ID and version when running the `sentry:test` command (#582)
- Transaction names now only show the parameterized URL (`/some/{route}`) instead of the route name or controller class (#583)

## 2.14.0

Expand Down
14 changes: 10 additions & 4 deletions README.md
Expand Up @@ -78,15 +78,21 @@ try {

## Laravel Version Compatibility

- Laravel `<= 4.2.x` is supported until `0.8.x`
- Laravel `<= 5.7.x` on PHP `<= 7.0` is supported until `0.11.x`
- Laravel `>= 5.x.x` on PHP `>= 7.1` is supported in all versions
The Laravel versions listed below are all currently supported:

- Laravel `>= 6.x.x` on PHP `>= 7.2` is supported starting from `1.2.0`
- Laravel `>= 7.x.x` on PHP `>= 7.2` is supported starting from `1.7.0`
- Laravel `>= 8.x.x` on PHP `>= 7.3` is supported starting from `1.9.0`
- Laravel `>= 9.x.x` on PHP `>= 8.0` is supported starting from `2.11.0`

Please note that of version `>= 2.0.0` we require PHP Version `>= 7.2` because we are using our new [PHP SDK](https://github.com/getsentry/sentry-php) underneath.
Please note that starting with version `>= 2.0.0` we require PHP Version `>= 7.2` because we are using our new [PHP SDK](https://github.com/getsentry/sentry-php) underneath.

The Laravel and Lumen version listed below were supported in previous versions:

- Laravel `<= 4.2.x` is supported until `0.8.x`
- Laravel `<= 5.7.x` on PHP `<= 7.0` is supported until `0.11.x`
- Laravel `>= 5.x.x` on PHP `>= 7.1` is supported until `2.14.x`
- Laravel Lumen is supported until `2.14.x`

## Contributing to the SDK

Expand Down
17 changes: 10 additions & 7 deletions composer.json
Expand Up @@ -22,21 +22,24 @@
],
"require": {
"php": "^7.2 | ^8.0",
"illuminate/support": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0",
"sentry/sentry": "^3.3",
"illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0",
"sentry/sentry": "^3.9",
"sentry/sdk": "^3.1",
"symfony/psr-http-message-bridge": "^1.0 | ^2.0",
"nyholm/psr7": "^1.0"
},
"conflict": {
"laravel/lumen-framework": "*"
},
"autoload": {
"psr-0": {
"Sentry\\Laravel\\": "src/"
}
},
"require-dev": {
"phpunit/phpunit": "^5.7 | ^6.5 | ^7.5 | ^8.4 | ^9.3",
"laravel/framework": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0",
"orchestra/testbench": "3.1 - 3.8 | ^4.7 | ^5.1 | ^6.0 | ^7.0",
"phpunit/phpunit": "^8.4 | ^9.3",
"laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0",
"orchestra/testbench": "^4.7 | ^5.1 | ^6.0 | ^7.0",
"friendsofphp/php-cs-fixer": "^3.11",
"mockery/mockery": "^1.3"
},
Expand All @@ -61,8 +64,8 @@
},
"extra": {
"branch-alias": {
"dev-3.x": "3.x-dev",
"dev-master": "2.x-dev",
"dev-master": "3.x-dev",
"dev-2.x": "2.x-dev",
"dev-1.x": "1.x-dev",
"dev-0.x": "0.x-dev"
},
Expand Down
5 changes: 3 additions & 2 deletions config/sentry.php
Expand Up @@ -45,13 +45,14 @@

// Indicates if the tracing integrations supplied by Sentry should be loaded
'default_integrations' => true,

// Indicates that requests without a matching route should be traced
'missing_routes' => false,
],

// @see: https://docs.sentry.io/platforms/php/configuration/options/#send-default-pii
'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', false),

'traces_sample_rate' => (float)(env('SENTRY_TRACES_SAMPLE_RATE', 0.0)),

'controllers_base_namespace' => env('SENTRY_CONTROLLERS_BASE_NAMESPACE', 'App\\Http\\Controllers'),

];
7 changes: 0 additions & 7 deletions src/Sentry/Laravel/Console/PublishCommand.php
Expand Up @@ -10,13 +10,6 @@

class PublishCommand extends Command
{
/**
* Laravel 5.0.x: The name and signature of the console command.
*
* @var string
*/
protected $name = 'sentry:publish';

/**
* The name and signature of the console command.
*
Expand Down
9 changes: 2 additions & 7 deletions src/Sentry/Laravel/Console/TestCommand.php
Expand Up @@ -12,17 +12,11 @@
use Sentry\State\HubInterface;
use Sentry\Tracing\SpanContext;
use Sentry\Tracing\TransactionContext;
use Sentry\Tracing\TransactionSource;
use Throwable;

class TestCommand extends Command
{
/**
* Laravel 5.0.x: The name and signature of the console command.
*
* @var string
*/
protected $name = 'sentry:test';

/**
* The name and signature of the console command.
*
Expand Down Expand Up @@ -145,6 +139,7 @@ public function log($level, $message, array $context = []): void
$transactionContext = new TransactionContext();
$transactionContext->setSampled(true);
$transactionContext->setName('Sentry Test Transaction');
$transactionContext->setSource(TransactionSource::custom());
$transactionContext->setOp('sentry.test');

$transaction = $hub->startTransaction($transactionContext);
Expand Down

0 comments on commit 81f8c8e

Please sign in to comment.