open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
686 stars 170 forks source link

implement events v1.32 #1291

Closed brettmc closed 1 month ago

brettmc commented 2 months ago

implement the events api + sdk per spec v1.32:

todo: the spec is a little unclear on exactly how an EventLoggerProvider should access the Logger that it uses. Since the only way a Logger should be obtained is through a LoggerProvider (at least, that's true for other signals, but not expressly forbidden by the logs bridge API), I've gone with an EventLoggerProvider containing a LoggerProvider, from which it gets its logger.

The event logger API suggests that the above is correct ("EventLoggers can be accessed with a EventLoggerProvider"), however the event logger SDK says that "The SDK MAY be implemented on top of the Logs Bridge API".

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 84.61538% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 74.02%. Comparing base (100e593) to head (c04ce0b).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291/graphs/tree.svg?width=650&height=150&src=pr&token=OE661REHqm&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ```diff @@ Coverage Diff @@ ## main #1291 +/- ## ============================================ + Coverage 74.00% 74.02% +0.02% - Complexity 2367 2384 +17 ============================================ Files 347 352 +5 Lines 7077 7131 +54 ============================================ + Hits 5237 5279 +42 - Misses 1840 1852 +12 ``` | [Flag](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [8.1](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `74.02% <84.61%> (+0.02%)` | :arrow_up: | | [8.2](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `74.02% <84.61%> (+0.02%)` | :arrow_up: | | [8.3](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `74.02% <84.61%> (+0.02%)` | :arrow_up: | | [8.4](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `72.90% <84.61%> (+0.03%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [src/API/Globals.php](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?src=pr&el=tree&filepath=src%2FAPI%2FGlobals.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL0FQSS9HbG9iYWxzLnBocA==) | `94.11% <100.00%> (+0.56%)` | :arrow_up: | | [src/API/Instrumentation/CachedInstrumentation.php](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?src=pr&el=tree&filepath=src%2FAPI%2FInstrumentation%2FCachedInstrumentation.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL0FQSS9JbnN0cnVtZW50YXRpb24vQ2FjaGVkSW5zdHJ1bWVudGF0aW9uLnBocA==) | `100.00% <100.00%> (ø)` | | | [src/API/Instrumentation/Configurator.php](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?src=pr&el=tree&filepath=src%2FAPI%2FInstrumentation%2FConfigurator.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL0FQSS9JbnN0cnVtZW50YXRpb24vQ29uZmlndXJhdG9yLnBocA==) | `100.00% <100.00%> (ø)` | | | [src/API/Instrumentation/ContextKeys.php](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?src=pr&el=tree&filepath=src%2FAPI%2FInstrumentation%2FContextKeys.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL0FQSS9JbnN0cnVtZW50YXRpb24vQ29udGV4dEtleXMucGhw) | `100.00% <100.00%> (ø)` | | | [src/API/Logs/LogRecord.php](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?src=pr&el=tree&filepath=src%2FAPI%2FLogs%2FLogRecord.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL0FQSS9Mb2dzL0xvZ1JlY29yZC5waHA=) | `100.00% <100.00%> (ø)` | | | [src/API/Logs/Map/Psr3.php](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?src=pr&el=tree&filepath=src%2FAPI%2FLogs%2FMap%2FPsr3.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL0FQSS9Mb2dzL01hcC9Qc3IzLnBocA==) | `100.00% <100.00%> (ø)` | | | [src/API/Logs/Severity.php](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?src=pr&el=tree&filepath=src%2FAPI%2FLogs%2FSeverity.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL0FQSS9Mb2dzL1NldmVyaXR5LnBocA==) | `100.00% <100.00%> (ø)` | | | [src/SDK/Logs/EventLogger.php](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?src=pr&el=tree&filepath=src%2FSDK%2FLogs%2FEventLogger.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL1NESy9Mb2dzL0V2ZW50TG9nZ2VyLnBocA==) | `100.00% <100.00%> (ø)` | | | [src/SDK/Logs/EventLoggerProvider.php](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?src=pr&el=tree&filepath=src%2FSDK%2FLogs%2FEventLoggerProvider.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL1NESy9Mb2dzL0V2ZW50TG9nZ2VyUHJvdmlkZXIucGhw) | `100.00% <100.00%> (ø)` | | | [src/SDK/Logs/EventLoggerProviderFactory.php](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?src=pr&el=tree&filepath=src%2FSDK%2FLogs%2FEventLoggerProviderFactory.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL1NESy9Mb2dzL0V2ZW50TG9nZ2VyUHJvdmlkZXJGYWN0b3J5LnBocA==) | `100.00% <100.00%> (ø)` | | | ... and [7 more](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry). Last update [100e593...c04ce0b](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1291?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry).