This cookbook runs multiple containers on a Docker host. A container of the Apache http server exposes a web listener to serve some PHP samples and another container continuously connects to it to generate traffic. The PHP samples are manually instrumented with OpenTelemetry and different exporters, OTLP http and also Zipkin. The APM OpenTelemetry Collector container collects all traces, every span without sampling, and sends the spans to the Aternity SaaS backend.
- an APM account (SaaS)
- a Docker host, for example Docker Desktop
Navigate to APM (for example https://apm.myaccount.aternity.com) > Agents > Install Agents:
- Find your CustomerID, for example 12341234-12341234-13241234
- Grab SaaS Analysis Server Host, for example agents.apm.myaccount.aternity.com
Those information are required to activate the APM OpenTelemetry Collector container, passing via the environment variable SERVER_URL
.
Download a local copy of the files of this cookbook, for example store them in the folder Tech-Community/110-opentelemetry-php-app
|- docker-compose.yaml
|- src
|- index.php
|- SampleOTLPhttpExporter.php
|- SampleZipkinExporter.php
Start the containers using the docker-compose.yaml, for example with Bash:
cd Riverbed-Community-Toolkit/APM/110-opentelemetry-php-app
# Configure the environment variables for the APM OpenTelemetry Collector
export RIVERBED_APM_SAAS_SERVER_HOST="agents.apm.myaccount.aternity.com"
export RIVERBED_APM_CUSTOMER_ID="12341234-12341234-13241234"
docker-compose up
or with PowerShell:
cd Riverbed-Community-Toolkit/APM/110-opentelemetry-php-app
# Configure the environement variable for the APM OpenTelemetry Collector
$env:RIVERBED_APM_SAAS_SERVER_HOST="agents.apm.myaccount.aternity.com"
$env:RIVERBED_APM_CUSTOMER_ID="12341234-12341234-13241234"
docker-compose up
Browse the local urls
- http://localhost:8110
- http://localhost:8110/SampleOTLPhttpExporter.php
- http://localhost:8110/SampleZipkinExporter.php
Step 4. Open the APM web console to visualize and analyze the traces collected for every transaction
Press CTRL + C in the shell where it is running.
Or in a shell, go to the folder where you keep the docker-compose.yaml and run:
docker-compose down
Copyright (c) 2022-2024 Riverbed Technology, Inc.
The contents provided here are licensed under the terms and conditions of the MIT License accompanying the software ("License"). The scripts are distributed "AS IS" as set forth in the License. The script also include certain third party code. All such third party code is also distributed "AS IS" and is licensed by the respective copyright holders under the applicable terms and conditions (including, without limitation, warranty and liability disclaimers) identified in the license notices accompanying the software.