Skip to content

Commit

Permalink
feat: Support newer API namespace for open-telemetry/api >= 1.0.0beta…
Browse files Browse the repository at this point in the history
…10 (#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 <n_ikeguchi@yumemi.co.jp>
  • Loading branch information
siketyan authored Jun 26, 2023
1 parent ec2985b commit 8996293
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ See https://github.com/open-telemetry/opentelemetry-php#sdk-autoloading
require_once 'vendor/autoload.php';

$tracerProvider = /*create tracer provider*/;
$scope = \OpenTelemetry\API\Common\Instrumentation\Configurator::create()
$scope = \OpenTelemetry\API\Instrumentation\Configurator::create()
->withTracerProvider($tracerProvider)
->activate();

Expand Down Expand Up @@ -60,4 +60,4 @@ Parts of this auto-instrumentation library can be configured, more options are a
|-------------------------------------|---------------|-------------------------|---------|---------------------------------------------------------------------------------|
| OTEL_PHP_DISABLED_INSTRUMENTATIONS | [] | Instrumentation name(s) | pdo | Disable one or more installed auto-instrumentations, names are comma seperated. |

Configurations can be provided as environment variables, or via `php.ini` (or a file included by `php.ini`)
Configurations can be provided as environment variables, or via `php.ini` (or a file included by `php.ini`)
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"require": {
"php": "^8.2",
"ext-opentelemetry": "*",
"open-telemetry/api": "^1",
"open-telemetry/api": "^1.0.0beta10",
"open-telemetry/sem-conv": "^1"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion src/PDOInstrumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace OpenTelemetry\Contrib\Instrumentation\PDO;

use OpenTelemetry\API\Common\Instrumentation\CachedInstrumentation;
use OpenTelemetry\API\Instrumentation\CachedInstrumentation;
use OpenTelemetry\API\Trace\Span;
use OpenTelemetry\API\Trace\SpanBuilderInterface;
use OpenTelemetry\API\Trace\SpanKind;
Expand Down
3 changes: 1 addition & 2 deletions tests/Integration/PDOInstrumentationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
namespace OpenTelemetry\Tests\Instrumentation\PDO\tests\Integration;

use ArrayObject;
use OpenTelemetry\API\Common\Instrumentation\Configurator;
use OpenTelemetry\API\Instrumentation\Configurator;
use OpenTelemetry\Context\ScopeInterface;
use OpenTelemetry\SDK\Trace\ImmutableSpan;
use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter;
use OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor;
use OpenTelemetry\SDK\Trace\TracerProvider;
Expand Down

0 comments on commit 8996293

Please sign in to comment.