Skip to content

Commit

Permalink
implement events v1.32 (#1291)
Browse files Browse the repository at this point in the history
* implement events v1.32
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

* convert severity to a backed enum

* lint

* remove instead of deprecating logEvent, mark Logger constructor as internal

* make severity an enum only

* event attributes to iterable

* inject ClockInterface, add CachedInstrumentation, update examples

* set correct defaults for events

* test coverage

* Revert "make severity an enum only"

This reverts commit 710822907bbc41d1ddcb2c19aa78222f59bde3aa.
Also, move PSR-3 mapping into the Severity enum.

* event attributes to iterable

* apply review feedback
  • Loading branch information
brettmc authored May 5, 2024
1 parent 89fac3c commit 30e3039
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ComponentProvider/OpenTelemetrySdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use OpenTelemetry\Context\Propagation\TextMapPropagatorInterface;
use OpenTelemetry\SDK\Common\Attribute\Attributes;
use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScopeFactory;
use OpenTelemetry\SDK\Logs\EventLoggerProvider;
use OpenTelemetry\SDK\Logs\LoggerProvider;
use OpenTelemetry\SDK\Logs\LogRecordProcessorInterface;
use OpenTelemetry\SDK\Logs\Processor\MultiLogRecordProcessor;
Expand Down Expand Up @@ -239,12 +240,14 @@ public function createPlugin(array $properties, Context $context): SdkBuilder
instrumentationScopeFactory: new InstrumentationScopeFactory(Attributes::factory()),
resource: $resource,
);
$eventLoggerProvider = new EventLoggerProvider($loggerProvider);

// </editor-fold>

$sdkBuilder->setTracerProvider($tracerProvider);
$sdkBuilder->setMeterProvider($meterProvider);
$sdkBuilder->setLoggerProvider($loggerProvider);
$sdkBuilder->setEventLoggerProvider($eventLoggerProvider);

return $sdkBuilder;
}
Expand Down

0 comments on commit 30e3039

Please sign in to comment.