You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
8
8
9
9
## About the Sample Apps
10
10
@@ -34,11 +34,15 @@ Clone locally the aws-otel-collector here: https://github.com/aws-observability/
34
34
Make sure Docker Desktop is running.
35
35
36
36
### 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.
38
42
39
43
### Grpc Installation
40
44
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.
42
46
43
47
`brew install PHP`
44
48
@@ -50,6 +54,16 @@ If you are having issues please visit one of these resources:
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
+
53
67
### Update Repository Packages and Dependencies
54
68
55
69
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:
60
74
61
75
`make update`
62
76
77
+
Then run the following command to make sure the local composer is updated:
78
+
79
+
`composer update`
80
+
63
81
To make sure everything is working properly, run the following command to run all tests:
64
82
65
83
`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
70
88
71
89
### Run Collector
72
90
73
-
First start the up the collector.
74
-
75
91
Open a new terminal window and navigate into the aws-otel-collector folder.
76
92
77
93
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.
88
104
89
105
Run the following command for Sample App 1:
90
106
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
+
```
92
118
93
119
Run the following command for Sample App 2:
94
120
95
-
`php examples/SampleApp2/SampleApp2.php`
121
+
`php examples/aws/SampleApp2/SampleApp2.php`
96
122
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:
98
124
```
99
-
Final trace ID: {"traceId":"1-61141835-46b87ba81fad02d169814785"}
125
+
Starting Sample App
126
+
Child span trace ID after service 2: {"traceId":"1-6115649a-230ef2ffe1d289a056b8d0ea"}
100
127
Sample App complete!
101
128
```
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
+
102
132
## Viewing Traces on AWS X-Ray
103
133
104
134
Navigate to AWS X-Ray on your internet browser.
105
135
106
136
Click on the traces tab on the left hand side, like the image below:
107
137
108
-
TODO: Add image here
138
+
<imgwidth="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">
109
139
110
140
Make sure your region is set to us-west-2:
111
141
112
-
TODO: Add image here
142
+
<imgwidth="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">
113
143
114
144
After running the sample app, there should be traces under the traces tab with all relevant information.
145
+
146
+
<imgwidth="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