-
Notifications
You must be signed in to change notification settings - Fork 28
/
docker-compose.yaml
113 lines (89 loc) · 3.6 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# docker-compose.yaml
#
# Riverbed-Community-Toolkit
# 110-opentelemetry-php-app
# version: 24.10.4
#
# Compose file to use with the cookbook 110
#
# Usage
# docker-compose up
#
# Example in Bash
# export RIVERBED_APM_SAAS_SERVER_HOST="agents.apm.myaccount.aternity.com"
# export RIVERBED_APM_CUSTOMER_ID="12341234-12341234-13241234"
# docker-compose up
#
# Example in PowerShell
# $env:RIVERBED_APM_SAAS_SERVER_HOST="agents.apm.myaccount.aternity.com"
# $env:RIVERBED_APM_CUSTOMER_ID="12341234-12341234-13241234"
# docker-compose up
services:
riverbed-apm-opentelemetry-collector:
# APM OpenTelemetry Collector
# https://hub.docker.com/r/aternity/apm-collector
image: registry.hub.docker.com/aternity/apm-collector:2022.11.0-4
container_name: riverbed-apm-opentelemetry-collector-110
environment:
SERVER_URL: "wss://${RIVERBED_APM_SAAS_SERVER_HOST}/?RPM_AGENT_CUSTOMER_ID=${RIVERBED_APM_CUSTOMER_ID}"
ports:
# Uncomment the telemetry protocol used by the application
# OpenTelemetry, https://opentelemetry.io
- "4318:4318/tcp" # OpenTelemetry OTLP JSON/Protobuf over HTTP
# - "55681:55681/tcp" # OpenTelemetry OTLP JSON/Protobuf over HTTP
# - "4317:4317/tcp" # OpenTelemetry OTLP over gRPC
# Jaeger, https://www.jaegertracing.io
# - "14268:14268/tcp" # Jaeger Thrift Binary over HTTP
# - "6831:6831/udp" # Jaeger Thrift Compact
# - "6832:6832/udp" # Jaeger Thrift Binary
# Zipkin, https://zipkin.io
- "9411:9411/tcp" # Zipkin v2 json/protobuf and v1 json/thrift
# - "5775:5775/udp" # Jaeger's Thrift support for Zipkin v1
service110_php:
depends_on:
- riverbed-apm-opentelemetry-collector
image: php:8.1-apache
volumes:
- ./src:/var/www/html/
ports:
- 8110:80
environment:
OTEL_SERVICE_NAME: service110-php
OTEL_EXPORTER_ZIPKIN_ENDPOINT: http://riverbed-apm-opentelemetry-collector:9411/api/v2/spans
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: http://riverbed-apm-opentelemetry-collector:4318/v1/traces
command: >
bash -c "
# Install unzip
apt-get update ; apt-get install unzip ;
# Install PHP composer, https://getcomposer.org/
php -r \"copy('https://getcomposer.org/installer', 'composer-setup.php');\"
php composer-setup.php ;
php -r \"unlink('composer-setup.php');\"
mv composer.phar /usr/local/bin/composer ;
# Install OpenTelemetry prereqs for PHP instrumentation, https://opentelemetry.io/
composer config minimum-stability dev ;
composer require guzzlehttp/psr7 ;
composer require guzzlehttp/guzzle ;
composer require symfony/http-client
composer require open-telemetry/opentelemetry ;
composer require open-telemetry/exporter-otlp ;
composer require open-telemetry/exporter-zipkin ;
# Launch Apache http webserver, https://httpd.apache.org/
apache2-foreground ;
"
service110_traffic_generator:
depends_on:
- service110_php
image: registry.hub.docker.com/alpine/curl:latest
command: >
/bin/sh -c "
sleep 10;
while :; do
curl http://service110_php > /dev/null 1>&1;
sleep 5;
curl http://service110_php/SampleOTLPhttpExporter.php > /dev/null 1>&1;
sleep 5;
curl http://service110_php/SampleZipkinExporter.php > /dev/null 1>&1;
sleep 5;
done
"