安装测试环境
我们使用Elastic在github上的项目apm-integration-testing,来生成对应的APM数据。我们使用这个项目的整个测试环境中包含了用于demo的前端,后端,数据库的实例,包含java
、python
、node.js
、ruby
、go
、.net
、php
等不同语言编写的应用程序,也包含了数据库(postgres
)、搜索引擎(elasticsearch
)、缓存(redis
),通过对这样一个环境进行可观测性的验证,我们可以充分了解datadog的功能。
通过以下命令下载该项目后:
git clone https://github.com/elastic/apm-integration-testing
cd apm-integration-testing
可以在docker环境下启动多个应用程序:
./scripts/compose.py start --release \
--no-elasticsearch --no-kibana --with-opbeans-java \
--with-opbeans-go --with-opbeans-python --with-opbeans-node --with-opbeans-rum
当这个程序运行之后,我们可以立即停止,compose.py
会在当前目录下生产一个docker-compose.yml
文件。
在这个案例中,我打算在K8S上运行整个环境,因此,我使用了
kompose convert
将docker-compose.yml
文件转成系列K8S的yaml
文件
然后,创建 相应 K8S 资源
kubectl create -f k8s-pgdata-persistentvolumeclaim.yaml
kubectl create -f postgres-claim0-persistentvolumeclaim.yaml
kubectl cr