The easiest way to test is to use this docker-compose.yml
file to set up APM Server, Kibana and Elasticsearch:
---
networks:
default:
name: apm-integration-testing
services:
apm-server:
cap_add:
- CHOWN
- DAC_OVERRIDE
- SETGID
- SETUID
cap_drop:
- ALL
command:
- apm-server
- "-e"
- "--httpprof"
- ":6060"
- "-E"
- apm-server.frontend.enabled=true
- "-E"
- apm-server.frontend.rate_limit=100000
- "-E"
- apm-server.host=0.0.0.0:8200
- "-E"
- apm-server.read_timeout=1m
- "-E"
- apm-server.shutdown_timeout=2m
- "-E"
- apm-server.write_timeout=1m
- "-E"
- logging.json=true
- "-E"
- logging.metrics.enabled=false
- "-E"
- setup.kibana.host=kibana:5601
- "-E"
- setup.template.settings.index.number_of_replicas=0
- "-E"
- setup.template.settings.index.number_of_shards=1
- "-E"
- setup.template.settings.index.refresh_interval=1ms
- "-E"
- xpack.monitoring.elasticsearch=true
- "-E"
- xpack.monitoring.enabled=true
- "-E"
- apm-server.instrumentation.enabled=true
- "-E"
- setup.dashboards.enabled=true
- "-E"
- output.elasticsearch.enabled=true
- "-E"
- output.elasticsearch.hosts=[elasticsearch:9200]
container_name: localtesting_6.5.0_apm-server
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
healthcheck:
interval: 5s
retries: 12
test:
- CMD
- curl
- "--write-out"
- "'HTTP %{http_code}'"
- "--fail"
- "--silent"
- "--output"
- "/dev/null"
- http://localhost:8200/healthcheck
image: docker.elastic.co/apm/apm-server:6.5.0-SNAPSHOT
labels:
- co.elatic.apm.stack-version=6.5.0
logging:
driver: json-file
options:
max-file: '5'
max-size: 2m
ports:
- 127.0.0.1:8200:8200
- 127.0.0.1:6060:6060
elasticsearch:
container_name: localtesting_6.5.0_elasticsearch
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- discovery.type=single-node
- ES_JAVA_OPTS=-XX:UseAVX=2 -Xms1g -Xmx1g
- path.data=/usr/share/elasticsearch/data/6.5.0
- xpack.security.enabled=false
- xpack.license.self_generated.type=trial
- xpack.monitoring.collection.enabled=true
healthcheck:
interval: '20'
retries: 10
test:
- CMD-SHELL
- curl -s http://localhost:9200/_cluster/health | grep -vq '"status":"red"'
image: docker.elastic.co/elasticsearch/elasticsearch:6.5.0-SNAPSHOT
labels:
- co.elatic.apm.stack-version=6.5.0
logging:
driver: json-file
options:
max-file: '5'
max-size: 2m
ports:
- 127.0.0.1:9200:9200
ulimits:
memlock:
hard: -1
soft: -1
volumes:
- esdata:/usr/share/elasticsearch/data
kibana:
container_name: localtesting_6.5.0_kibana
depends_on:
elasticsearch:
condition: service_healthy
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
SERVER_NAME: kibana.example.org
XPACK_MONITORING_ENABLED: 'true'
XPACK_XPACK_MAIN_TELEMETRY_ENABLED: 'false'
healthcheck:
interval: 5s
retries: 20
test:
- CMD
- curl
- "--write-out"
- "'HTTP %{http_code}'"
- "--fail"
- "--silent"
- "--output"
- "/dev/null"
- http://kibana:5601/api/status
image: docker.elastic.co/kibana/kibana:6.5.0-SNAPSHOT
labels:
- co.elatic.apm.stack-version=6.5.0
logging:
driver: json-file
options:
max-file: '5'
max-size: 2m
ports:
- 127.0.0.1:5601:5601
version: '2.1'
volumes:
esdata:
driver: local
pgdata:
driver: local