Skip to content

Commit 3d9beb3

Browse files
Laravel: enabled spi-config.autoload-files composer config for SPI plugin cleanup.
1 parent c1ed471 commit 3d9beb3

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

src/Instrumentation/Laravel/_register.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<?php
2+
/**
3+
* This file must *only* be used to register SPI components, as it
4+
* will be pruned automatically via the tbachert/spi plugin.
5+
*/
26

37
declare(strict_types=1);
48

@@ -7,7 +11,6 @@
711
use OpenTelemetry\Contrib\Instrumentation\Laravel\Hooks;
812
use OpenTelemetry\Contrib\Instrumentation\Laravel\LaravelInstrumentation;
913

10-
// In case the `tbachert/spi` plugin has not been allowed in composer allow-plugins (root-level).
1114
ServiceLoader::register(Instrumentation::class, LaravelInstrumentation::class);
1215

1316
ServiceLoader::register(Hooks\Hook::class, Hooks\Illuminate\Console\Command::class);

src/Instrumentation/Laravel/composer.json

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,12 @@
4343
}
4444
},
4545
"extra": {
46+
"spi-config": {
47+
"autoload-files": true
48+
},
4649
"spi": {
4750
"OpenTelemetry\\Config\\SDK\\Configuration\\ComponentProvider": [
4851
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\LaravelComponentProvider"
49-
],
50-
"OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\Instrumentation": [
51-
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\LaravelInstrumentation"
52-
],
53-
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\Hooks\\Hook": [
54-
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\Hooks\\Illuminate\\Console\\Command",
55-
56-
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\Hooks\\Illuminate\\Contracts\\Console\\Kernel",
57-
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\Hooks\\Illuminate\\Contracts\\Http\\Kernel",
58-
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\Hooks\\Illuminate\\Contracts\\Queue\\Queue",
59-
60-
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\Hooks\\Illuminate\\Foundation\\Console\\ServeCommand",
61-
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\Hooks\\Illuminate\\Foundation\\Application",
62-
63-
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\Hooks\\Illuminate\\Queue\\Queue",
64-
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\Hooks\\Illuminate\\Queue\\SyncQueue",
65-
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\Hooks\\Illuminate\\Queue\\Worker"
6652
]
6753
}
6854
},

0 commit comments

Comments
 (0)