Skip to content

Commit 67b0c44

Browse files
committed
Second Draft
1 parent ed68620 commit 67b0c44

File tree

1 file changed

+43
-11
lines changed

1 file changed

+43
-11
lines changed

examples/README.md

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Overview
55
![Current Version](https://img.shields.io/github/v/tag/open-telemetry/opentelemetry-php)
66

7-
This is a getting started guide for the example applications found in the AWS contrib folder. This walkthrough covers prerequite, installations, how to run the applications, and viewing the traces on X-Ray. Before reading this guide, you should familiarize with distributed tracing and the basics of OpenTelemetry. To learn more about getting started with OpenTelemetry Go, see the OpenTelemetry developer documentation.
7+
This is a getting started guide for the example applications found in the AWS contrib folder. This walkthrough covers prerequite, installations, how to run the applications, and viewing the traces on X-Ray. Before reading this guide, you should familiarize with distributed tracing and the basics of OpenTelemetry. To learn more about getting started with OpenTelemetry PHP, see the OpenTelemetry developer documentation.
88

99
## About the Sample Apps
1010

@@ -34,11 +34,15 @@ Clone locally the aws-otel-collector here: https://github.com/aws-observability/
3434
Make sure Docker Desktop is running.
3535

3636
### AWS Access Keys
37-
First make sure that your AWS access keys are configured in your root directory. If they are not configured, please visit [here](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) for instructions on how to set them up.
37+
First make sure that your AWS access keys are configured in your root directory. To see if your credentials are setup run the following command:
38+
39+
`cat .aws/credentials`
40+
41+
If they are not configured, please visit [here](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) for instructions on how to set them up.
3842

3943
### Grpc Installation
4044

41-
In your root directory, run the following commands:
45+
In your root directory, run the following commands. These commands will take a while to install all the necessary components.
4246

4347
`brew install PHP`
4448

@@ -50,6 +54,16 @@ If you are having issues please visit one of these resources:
5054
- https://grpc.io/docs/languages/php/quickstart/
5155
- https://cjyabraham.github.io/docs/quickstart/php/
5256

57+
### Composer
58+
59+
To check if you have composer installed, run the following command in your root directory:
60+
61+
`composer -V`
62+
63+
If the above does not work, please visit [here](https://getcomposer.org/download/) to install Composer. There are two methods, programmatically or manual file download. Please choose whichever way you prefer and then move the composer.phar file to your `$PATH` with the following command:
64+
65+
`mv composer.phar /usr/local/bin/composer`
66+
5367
### Update Repository Packages and Dependencies
5468

5569
In the php contrib repository, run the following:
@@ -60,6 +74,10 @@ Then run to make sure all dependencies and packages are up to date:
6074

6175
`make update`
6276

77+
Then run the following command to make sure the local composer is updated:
78+
79+
`composer update`
80+
6381
To make sure everything is working properly, run the following command to run all tests:
6482

6583
`make install && make update && make style && make test && make phan && make psalm && make phpstan`
@@ -70,8 +88,6 @@ At this point all necessary items have been installed in your system and you are
7088

7189
### Run Collector
7290

73-
First start the up the collector.
74-
7591
Open a new terminal window and navigate into the aws-otel-collector folder.
7692

7793
Run the following command. Make sure to replace `YOUR_ACCESS_KEY_HERE` and `YOUR_SECRET_ACCESS_KEY_HERE` with your own specific keys.
@@ -88,27 +104,43 @@ In another terminal window, navigate to the opentelemetry-php-contrib folder.
88104

89105
Run the following command for Sample App 1:
90106

91-
`php examples/SampleApp1/SampleApp1.php`
107+
`php examples/aws/SampleApp1/SampleApp1.php`
108+
109+
The output for this app should look similar to the following:
110+
```
111+
Starting Sample App
112+
Which call would you like to make?
113+
Type outgoing-http-call or aws-sdk-call
114+
outgoing-http-call
115+
Final trace ID: {"traceId":"1-6115648a-d40b50a270b3c1249bcf60c2"}
116+
Sample App complete!
117+
```
92118

93119
Run the following command for Sample App 2:
94120

95-
`php examples/SampleApp2/SampleApp2.php`
121+
`php examples/aws/SampleApp2/SampleApp2.php`
96122

97-
You should see the trace Id in the terminal similar to the following:
123+
The output for this app should look similar to the following:
98124
```
99-
Final trace ID: {"traceId":"1-61141835-46b87ba81fad02d169814785"}
125+
Starting Sample App
126+
Child span trace ID after service 2: {"traceId":"1-6115649a-230ef2ffe1d289a056b8d0ea"}
100127
Sample App complete!
101128
```
129+
130+
The trace IDs in any sample app will be completely unique. The first number is the version, the second section is the timestamp, and the last section is a randomized hexadecimal string.
131+
102132
## Viewing Traces on AWS X-Ray
103133

104134
Navigate to AWS X-Ray on your internet browser.
105135

106136
Click on the traces tab on the left hand side, like the image below:
107137

108-
TODO: Add image here
138+
<img width="1755" alt="Screen Shot 2021-08-12 at 11 22 23 AM" src="https://user-images.githubusercontent.com/46689344/129248717-a9fd9137-0ed5-4498-9cfb-8e3ba1a57fbe.png">
109139

110140
Make sure your region is set to us-west-2:
111141

112-
TODO: Add image here
142+
<img width="291" alt="Screen Shot 2021-08-12 at 11 21 59 AM" src="https://user-images.githubusercontent.com/46689344/129248725-d3f7a655-fe3b-47d4-a229-583365e16a54.png">
113143

114144
After running the sample app, there should be traces under the traces tab with all relevant information.
145+
146+
<img width="1398" alt="Screen Shot 2021-08-09 at 11 42 50 PM" src="https://user-images.githubusercontent.com/46689344/129248704-0888b387-2fa8-4753-824e-d99e0c9a67b6.png">

0 commit comments

Comments
 (0)