-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding a configuration option OTEL_PHP_INTERNAL_METRICS_ENABLED which controls whether the SDK will emit its own metrics (eg batch processor state).
- Loading branch information
Showing
7 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OpenTelemetry\Example; | ||
|
||
use OpenTelemetry\API\Globals; | ||
|
||
/** | ||
* The OpenTelemetry SDK is able to emit some metrics about its internal state. For example, | ||
* batch span and log processor state. | ||
* This feature can be enabled via the OTEL_PHP_INTERNAL_METRICS_ENABLED setting. | ||
*/ | ||
|
||
putenv('OTEL_PHP_INTERNAL_METRICS_ENABLED=true'); | ||
putenv('OTEL_PHP_AUTOLOAD_ENABLED=true'); | ||
putenv('OTEL_TRACES_EXPORTER=console'); | ||
putenv('OTEL_METRICS_EXPORTER=console'); | ||
putenv('OTEL_LOGS_EXPORTER=console'); | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$tracerProvider = Globals::tracerProvider(); | ||
$tracerProvider->getTracer('demo')->spanBuilder('root')->startSpan()->end(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters