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

Cannot make getting started manual instrumentation example to work #1042

Closed
tigrannajaryan opened this issue Jun 19, 2023 · 3 comments · Fixed by open-telemetry/opentelemetry.io#2896
Labels
bug Something isn't working

Comments

@tigrannajaryan
Copy link
Member

Describe your environment

$ php -v
PHP 8.2.7 (cli) (built: Jun  8 2023 20:05:45) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies

Steps to reproduce
Follow instruction at https://opentelemetry.io/docs/instrumentation/php/manual/
Copy example from https://opentelemetry.io/docs/instrumentation/php/manual/#example to GetttingStarted.php
Run https://opentelemetry.io/docs/instrumentation/php/manual/#example
Open http://localhost:8080/rolldice

What is the expected behavior?
Page to load without errors

What is the actual behavior?
The following error is shown:

Fatal error: Uncaught Error: Class "ResourceInfoFactory" not found in /Users/tnajaryan/work/experiments/otel-php/GettingStarted.php:2 Stack trace: #0 {main} thrown in /Users/tnajaryan/work/experiments/otel-php/GettingStarted.php on line 2

Additional context
Testing for open-telemetry/community#1537
I started with trace example, the next step would be adding logs, but I didn't get there.

@tigrannajaryan tigrannajaryan added the bug Something isn't working label Jun 19, 2023
@tigrannajaryan
Copy link
Member Author

Sorry for dumb bug reports. For now I am following the Getting Started instructions to the letter without trying to troubleshoot myself, just to make sure our instructions are good.

@brettmc
Copy link
Collaborator

brettmc commented Jun 21, 2023

This is because we haven't put all of the import statements in for brevity. To make the example work via copy/paste, we will need to add this (plus the <?php opening tag)

@brettmc
Copy link
Collaborator

brettmc commented Jul 18, 2023

The docs have been thoroughly updated, and in my testing all of the examples are now runnable.

@brettmc brettmc closed this as completed Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants