forked from open-telemetry/opentelemetry-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement the events api + sdk per spec v1.32: - event logger is now only retrievable via an event logger provider - domain attribute for events is removed - events accept a subset of logrecord params, rather than an entire logrecord
- Loading branch information
Showing
33 changed files
with
481 additions
and
107 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OpenTelemetry\Example; | ||
|
||
use OpenTelemetry\API\Logs\Severity; | ||
use OpenTelemetry\SDK\Common\Configuration\Variables; | ||
use OpenTelemetry\SDK\Logs\EventLoggerProviderFactory; | ||
use OpenTelemetry\SDK\Logs\LoggerProviderFactory; | ||
|
||
require __DIR__ . '/../../../vendor/autoload.php'; | ||
putenv(sprintf('%s=console', Variables::OTEL_LOGS_EXPORTER)); | ||
putenv(sprintf('%s=simple', Variables::OTEL_PHP_LOGS_PROCESSOR)); | ||
|
||
$provider = (new EventLoggerProviderFactory())->create((new LoggerProviderFactory())->create()); | ||
$eventLogger = $provider->getEventLogger('my-event-logger', '1.0', 'https://example.com/events'); | ||
|
||
$payload = ['foo' => 'bar', 'baz' => 'bat', 'msg' => 'hello world']; | ||
$eventLogger->emit(name: 'my-event', payload: $payload, severityNumber: Severity::DEBUG); |
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
Oops, something went wrong.