Elastic Components Notes
elasticsearch components
apm server
running an apm-server for testing purposes in your local machine (here is mac)
$GOPATH/bin/apm-server run -v -e -c ~/citrix/testing-apm/apm-server.yml -E apm-server.expvar.enabled=true
config:
https://www.elastic.co/guide/en/apm/server/current/configuration-monitor.html#_bulk_max_size_6 https://www.elastic.co/guide/en/apm/server/current/elasticsearch-output.html https://www.elastic.co/guide/en/apm/server/current/apm-server-configuration.html https://www.elastic.co/guide/en/apm/server/current/running-on-docker.html
troubleshooting
https://www.elastic.co/guide/en/apm/server/current/common-problems.html https://www.elastic.co/guide/en/apm/server/current/common-problems.html#queue-full https://www.elastic.co/guide/en/apm/server/current/common-problems.html#request-timed-out https://www.elastic.co/guide/en/apm/server/master/common-problems.html#io-timeout
sizing:
https://www.elastic.co/guide/en/apm/server/current/sizing-guide.html https://www.elastic.co/guide/en/apm/server/current/processing-performance.html https://www.elastic.co/guide/en/apm/server/current/tune-apm-server.html https://www.elastic.co/guide/en/apm/get-started/7.6/transaction-spans.html
testing/stressing:
https://github.com/elastic/hey-apm https://github.com/elastic/apm-server/issues/1414
agent:
https://www.elastic.co/guide/en/apm/agent/python/4.x/configuration.html
test an apm server
Make 2 files for running the server and the hey-apm benchmarking tool for it
cat << EOF >> benchmark-apm-server.sh
source ./apm-server.env
$GOPATH/bin/hey-apm -apm-secret ${APMSERVER_TOKEN} -run 60s
EOF
cat << EOF >> start_apm-server.sh
#!/usr/bin/env bash
source ./apm-server.env
$GOPATH/bin/apm-server run -v -e -c ~/citrix/testing-apm/apm-server.yml -E apm-server.expvar.enabled=true
EOF
The environment variables for the apm server are like:
export APMSERVER_TOKEN="eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJlbGFzdGljIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImRlZmF1bHQtdG9rZW4tdzd2MmYiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGVmYXVsdCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjRiZDU0OGJlLTliZjYtMTFlOS05ZmEyLTAwMGQzYTFiNmE2OSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDplbGFzdGljOmRlZmF1bHQifQ.cN1Zrs432WghqwAqLgz7tWXN_aXuC4B_fqE7J6Yu0ppLBPwfNtbuNJaw7Q1a2XIYjNga7iEZ-p2EfjNjRYXkchNwVXNPwpUeiNc800x9PAYcbZHP6wKWor-Rxdz9ralBotk55nhM5le6OOXemooH11Nuheiwp1IpcYwigeEodF_Kvl1re5PKpAvyZ6LRWEw5b1-etLez5zpACjBuqDkWtjNaw0kgzbflUorllG1ajxImIvevsyfCpVJ2ukUuV73i4c444gnoKUk6T1nB1hf4onhZO5jcbRiM84CSIuSqIqq1Aczcs-daOD_bn7B259v5tkATOfDA0tc26uSG1QBX78KWwuWj05IqvSe_AjWe0myXfYh9IKIiBMEQelWNYsoCHmqFnLTgl8XZkcyKC-0fCQZXSc0tjDXJeXcsL_a3rzyLuQS05vz4K88N1Z5iL5jXRR2n7BQ37sFhbnRYeXIuE_lLJv8TF1hpUgxmJvI76kTrCGILMATqSpt4pU04uroiG_pMNsCkrhr1WD1fonZz9fC9bSQj_hdlzK9dj-O-elZiX-0gRECspgEobtlrJtCKGeGH0Rw2b_-KQA1mdmqJIgT8xlPSkfqqXhKEYjqBemvdWCjJ5GqIRlVXJua47Poy5vEZgDrgXxPTIZAJ0AqAEFwc-GgbxoS98cXXvtJqYQI"
export ES_HOST="elasticsearch-es:9200"
export ES_PASSWORD="password"
and a sample apm-server.yml configuration file
apm-server:
host: 0.0.0.0:8200
rum:
enabled: true
secret_token: ${APMSERVER_TOKEN}
output.elasticsearch:
hosts:
- ${ES_HOST}
password: ${ES_PASSWORD}
protocol: https
ssl.certificate_authorities:
- ca.pem
username: elastic
ssl.verification_mode: none
bulk_max_size: 10000
worker: 15
output.file:
enabled: false
filename: apm-server
number_of_files: 5
path: ./apm-server/data
rotate_every_kb: 10000
queue.mem.events: 100000
monitoring.enabled: true