Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code example with wrong class name in Manual Instrumentation for OpenTelemetry PHP #3603

Closed
isiryder opened this issue Nov 26, 2023 · 3 comments · Fixed by #3606
Closed

Code example with wrong class name in Manual Instrumentation for OpenTelemetry PHP #3603

isiryder opened this issue Nov 26, 2023 · 3 comments · Fixed by #3606
Labels

Comments

@isiryder
Copy link
Contributor

isiryder commented Nov 26, 2023

Versions:
PHP 8.2.12
guzzlehttp/guzzle 7.8.0
guzzlehttp/psr7 2.6.1
open-telemetry/api 1.0.0
open-telemetry/sem-conv 1.23.0beta1

I was trying to run the example here https://opentelemetry.io/docs/instrumentation/php/manual/#example but I got the following error:

Uncaught Error: Class "OpenTelemetry\SDK\Logs\LogsProcessor\SimpleLogsProcessor" not found

So I checked and found out that the class name was changed some time ago.

I made it work by changing
use OpenTelemetry\SDK\Logs\Processor\SimpleLogRecordProcessor;
instead of
use OpenTelemetry\SDK\Logs\Processor\SimpleLogsProcessor;

@cartermp cartermp added bug Something isn't working sig:php and removed bug Something isn't working labels Nov 27, 2023
@cartermp
Copy link
Contributor

This looks like it's by design, as ~4 months ago the type was renamed to match the spec: open-telemetry/opentelemetry-php#1073

I think to address this you'll need to update your packages.

@isiryder
Copy link
Contributor Author

The packages I use are the latest versions. Anyway what I am actually pointing here is a documentation issue.

I think that the docs should be updated to reflect the change you mentioned.

@svrnm
Copy link
Member

svrnm commented Nov 27, 2023

@isiryder looking at the issue @cartermp linked this needs to be changed in the docs as well, please feel free to raise a PR to fix that. cc @open-telemetry/php-approvers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants