Skip to content

Commit e5a33a4

Browse files
authored
Deprecate API InstrumentationInterface and ConfigurationResolver (#1896)
* Deprecate not supported `InstrumentationInterface` See comment in `InstrumentationTrait::activate()`: "activate instrumentation with the API. not implemented yet." * Deprecate `API` `ConfigurationResolver` Superseded by `EnvComponentLoader` which incorporates better with file-based and code-based configuration.
1 parent 43d823a commit e5a33a4

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

src/API/Behavior/Internal/LogWriterFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class LogWriterFactory
1818

1919
public function create(): LogWriterInterface
2020
{
21+
/** @phan-suppress-next-line PhanDeprecatedClass */
2122
$dest = (new ConfigurationResolver())->getString(self::OTEL_PHP_LOG_DESTINATION);
2223
$logger = LoggerHolder::get();
2324

src/API/Instrumentation/ConfigurationResolver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
namespace OpenTelemetry\API\Instrumentation;
66

7+
/**
8+
* @deprecated environment variables should be accessed using {@link \OpenTelemetry\API\Configuration\ConfigEnv\EnvComponentLoader}s.
9+
*
10+
* @phan-suppress PhanDeprecatedInterface
11+
*/
712
class ConfigurationResolver implements ConfigurationResolverInterface
813
{
914
#[\Override]

src/API/Instrumentation/ConfigurationResolverInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
namespace OpenTelemetry\API\Instrumentation;
66

7+
/**
8+
* @deprecated
9+
*/
710
interface ConfigurationResolverInterface
811
{
912
public function has(string $name): bool;

src/API/Instrumentation/InstrumentationInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use OpenTelemetry\Context\Propagation\TextMapPropagatorInterface;
1313
use Psr\Log\LoggerInterface;
1414

15+
/**
16+
* @deprecated
17+
*/
1518
interface InstrumentationInterface
1619
{
1720
public function getName(): string;

src/API/Instrumentation/InstrumentationTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public function init(): bool
6161
$instrumentation->activate()
6262
6363
to activate and use the instrumentation with the API/SDK.
64+
*
65+
* @deprecated
6466
**/
6567

6668
trait InstrumentationTrait

0 commit comments

Comments
 (0)