Skip to content

Commit 1b7bd84

Browse files
authored
feat: Support newer API namespace for open-telemetry/api >= 1.0.0beta10 (#171)
* build(deps): Bump open-telemetry/api to 1.0.0beta10 * fix: Use OpenTelemetry\API instead of OpenTelemetry\API\Common Signed-off-by: Natsuki Ikeguchi <[email protected]>
1 parent 700f005 commit 1b7bd84

File tree

7 files changed

+8
-9
lines changed

7 files changed

+8
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ See https://github.com/open-telemetry/opentelemetry-php#sdk-autoloading
2525
require_once 'vendor/autoload.php';
2626

2727
$tracerProvider = /*create tracer provider*/;
28-
$scope = \OpenTelemetry\API\Common\Instrumentation\Configurator::create()
28+
$scope = \OpenTelemetry\API\Instrumentation\Configurator::create()
2929
->withTracerProvider($tracerProvider)
3030
->activate();
3131

@@ -59,4 +59,4 @@ Parts of this auto-instrumentation library can be configured, more options are a
5959
|-------------------------------------|---------------|-------------------------|---------|---------------------------------------------------------------------------------|
6060
| OTEL_PHP_DISABLED_INSTRUMENTATIONS | [] | Instrumentation name(s) | laravel | Disable one or more installed auto-instrumentations, names are comma seperated. |
6161

62-
Configurations can be provided as environment variables, or via `php.ini` (or a file included by `php.ini`)
62+
Configurations can be provided as environment variables, or via `php.ini` (or a file included by `php.ini`)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"php": "^8.0",
1212
"laravel/framework": "*",
1313
"ext-opentelemetry": "*",
14-
"open-telemetry/api": "^1",
14+
"open-telemetry/api": "^1.0.0beta10",
1515
"open-telemetry/sem-conv": "^1"
1616
},
1717
"require-dev": {

src/ClientRequestWatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Illuminate\Http\Client\Events\ConnectionFailed;
99
use Illuminate\Http\Client\Events\RequestSending;
1010
use Illuminate\Http\Client\Events\ResponseReceived;
11-
use OpenTelemetry\API\Common\Instrumentation\CachedInstrumentation;
11+
use OpenTelemetry\API\Instrumentation\CachedInstrumentation;
1212
use OpenTelemetry\API\Trace\SpanInterface;
1313
use OpenTelemetry\API\Trace\SpanKind;
1414
use OpenTelemetry\API\Trace\StatusCode;

src/LaravelInstrumentation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
use Illuminate\Foundation\Application;
88
use Illuminate\Foundation\Http\Kernel;
99
use Illuminate\Http\Request;
10-
use OpenTelemetry\API\Common\Instrumentation\CachedInstrumentation;
11-
use OpenTelemetry\API\Common\Instrumentation\Globals;
10+
use OpenTelemetry\API\Globals;
11+
use OpenTelemetry\API\Instrumentation\CachedInstrumentation;
1212
use OpenTelemetry\API\Trace\Span;
1313
use OpenTelemetry\API\Trace\SpanInterface;
1414
use OpenTelemetry\API\Trace\SpanKind;

src/QueryWatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Illuminate\Contracts\Foundation\Application;
88
use Illuminate\Database\Events\QueryExecuted;
99
use Illuminate\Support\Str;
10-
use OpenTelemetry\API\Common\Instrumentation\CachedInstrumentation;
10+
use OpenTelemetry\API\Instrumentation\CachedInstrumentation;
1111
use OpenTelemetry\API\Trace\SpanKind;
1212
use OpenTelemetry\SDK\Common\Time\ClockFactory;
1313
use OpenTelemetry\SemConv\TraceAttributes;

tests/Integration/LaravelInstrumentationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Illuminate\Foundation\Http\Kernel;
99
use Illuminate\Http\Response;
1010
use Illuminate\Support\Facades\Http;
11-
use OpenTelemetry\API\Common\Instrumentation\Configurator;
11+
use OpenTelemetry\API\Instrumentation\Configurator;
1212
use OpenTelemetry\Context\ScopeInterface;
1313
use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter;
1414
use OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor;

tests/app/Providers/EventServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Illuminate\Auth\Events\Registered;
88
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
99
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
10-
use Illuminate\Support\Facades\Event;
1110

1211
class EventServiceProvider extends ServiceProvider
1312
{

0 commit comments

Comments
 (0)