Add APM Server extension tests

Update extension README
parent 2d90bfce
...@@ -23,6 +23,7 @@ before_script: ...@@ -23,6 +23,7 @@ before_script:
- sed -i -e 's/\(xpack.monitoring.elasticsearch.username:\) elastic/\1 logstash_system/g' -e 's/\(xpack.monitoring.elasticsearch.password:\) changeme/\1 testpasswd/g' logstash/config/logstash.yml - sed -i -e 's/\(xpack.monitoring.elasticsearch.username:\) elastic/\1 logstash_system/g' -e 's/\(xpack.monitoring.elasticsearch.password:\) changeme/\1 testpasswd/g' logstash/config/logstash.yml
- sed -i 's/\(password =>\) "changeme"/\1 "testpasswd"/g' logstash/pipeline/logstash.conf - sed -i 's/\(password =>\) "changeme"/\1 "testpasswd"/g' logstash/pipeline/logstash.conf
- sed -i 's/\(elasticsearch.password:\) changeme/\1 testpasswd/g' extensions/app-search/config/app-search.yml - sed -i 's/\(elasticsearch.password:\) changeme/\1 testpasswd/g' extensions/app-search/config/app-search.yml
- sed -i 's/\(password:\) changeme/\1 testpasswd/g' extensions/apm-server/config/apm-server.yml
script: script:
# Core Elastic Stack # Core Elastic Stack
...@@ -35,18 +36,29 @@ script: ...@@ -35,18 +36,29 @@ script:
- docker-compose logs elasticsearch - docker-compose logs elasticsearch
- docker-compose logs kibana - docker-compose logs kibana
- docker-compose logs logstash - docker-compose logs logstash
- docker-compose down -v - docker-compose stop logstash kibana
# Extensions # Extensions
- docker-compose up -d elasticsearch
- sleep 30
- .travis/elasticsearch-setup-passwords.exp
# App Search # App Search
- docker-compose -f docker-compose.yml -f extensions/app-search/app-search-compose.yml up -d app-search - docker-compose -f docker-compose.yml -f extensions/app-search/app-search-compose.yml up -d app-search
- .travis/run-tests-app-search.sh - .travis/run-tests-app-search.sh
- docker-compose -f docker-compose.yml -f extensions/app-search/app-search-compose.yml ps - docker-compose -f docker-compose.yml -f extensions/app-search/app-search-compose.yml ps
- docker-compose -f docker-compose.yml -f extensions/app-search/app-search-compose.yml logs app-search - docker-compose -f docker-compose.yml -f extensions/app-search/app-search-compose.yml logs app-search
- docker-compose -f docker-compose.yml -f extensions/app-search/app-search-compose.yml down -v - docker-compose -f docker-compose.yml -f extensions/app-search/app-search-compose.yml stop app-search
# APM Server
- docker-compose -f docker-compose.yml -f extensions/apm-server/apm-server-compose.yml up -d apm-server
- .travis/run-tests-apm-server.sh
- docker-compose -f docker-compose.yml -f extensions/apm-server/apm-server-compose.yml ps
- docker-compose -f docker-compose.yml -f extensions/apm-server/apm-server-compose.yml logs apm-server
- docker-compose -f docker-compose.yml -f extensions/apm-server/apm-server-compose.yml stop apm-server
# Tear down
- >-
docker-compose
-f docker-compose.yml
-f extensions/app-search/app-search-compose.yml
-f extensions/apm-server/apm-server-compose.yml
down -v
# Swarm # Swarm
- docker swarm init - docker swarm init
......
#!/usr/bin/env bash
set -eu
set -o pipefail
source "$(dirname ${BASH_SOURCE[0]})/lib/testing.sh"
declare MODE=""
log 'Waiting for readiness of APM Server'
poll_ready apm-server 'http://localhost:8200/'
# APM Server extension # APM Server extension
Adds a container for Elasticsearch APM server. Forwards caught errors and traces to Elasticsearch to enable their The APM Server receives data from APM agents and transforms them into Elasticsearch documents that can be visualised in
visualisation in Kibana. Kibana.
## Usage ## Usage
If you want to include the APM server, run Docker Compose from the root of the repository with an additional command To include APM Server in the stack, run Docker Compose from the root of the repository with an additional command line
line argument referencing the `apm-server-compose.yml` file: argument referencing the `apm-server-compose.yml` file:
```console ```console
$ docker-compose -f docker-compose.yml -f extensions/apm-server/apm-server-compose.yml up $ docker-compose -f docker-compose.yml -f extensions/apm-server/apm-server-compose.yml up
``` ```
## Connecting an agent to APM-Server Meanwhile, you can navigate to the **APM** application in Kibana and follow the setup instructions to get started.
## Connecting an agent to APM Server
The most basic configuration to send traces to APM server is to specify the `SERVICE_NAME` and `SERVICE_URL`. Here is an The most basic configuration to send traces to APM server is to specify the `SERVICE_NAME` and `SERVICE_URL`. Here is an
example Python FLASK configuration: example Python Flask configuration:
```python ```python
import elasticapm import elasticapm
...@@ -36,19 +38,21 @@ app.config['ELASTIC_APM'] = { ...@@ -36,19 +38,21 @@ app.config['ELASTIC_APM'] = {
} }
``` ```
More configuration settings can be found under the **Configuration** section for each language: More configuration settings can be found for each language in the following documentation page: [Install APM
https://www.elastic.co/guide/en/apm/agent/index.html agents][apm-agents].
## Checking connectivity and importing default APM dashboards ## Checking connectivity and importing default APM dashboards
From the Kibana Dashboard: 1. On the Kibana home page, click `Add APM` under the _Observability_ panel.
2. Click `Check APM Server status` to confirm the server is up and running.
1. `Add APM` button under _Add Data to Kibana_ section 3. Click `Check agent status` to verify your agent has registered properly.
2. Ignore all the install instructions and press `Check APM Server status` button. 4. Click `Load Kibana objects` to create an index pattern for APM.
3. Press `Check agent status` 5. Click `Launch APM` to be taken to the APM dashboard.
4. Press `Load Kibana objects` to get the default dashboards
5. Lastly press the `APM dashboard` to the bottom right.
## See also ## See also
[Running APM Server on Docker](https://www.elastic.co/guide/en/apm/server/current/running-on-docker.html) [Running APM Server on Docker][apm-docker]
[apm-agents]: https://www.elastic.co/guide/en/apm/get-started/current/agents.html
[apm-docker]: https://www.elastic.co/guide/en/apm/server/current/running-on-docker.html
...@@ -6,10 +6,17 @@ services: ...@@ -6,10 +6,17 @@ services:
context: extensions/apm-server/ context: extensions/apm-server/
args: args:
ELK_VERSION: $ELK_VERSION ELK_VERSION: $ELK_VERSION
command:
# Disable strict permission checking on 'apm-server.yml' configuration file
# https://www.elastic.co/guide/en/beats/libbeat/current/config-file-permissions.html
- --strict.perms=false
volumes: volumes:
- ./extensions/apm-server/config/apm-server.yml:/usr/share/apm-server/apm-server.yml:ro - type: bind
source: ./extensions/apm-server/config/apm-server.yml
target: /usr/share/apm-server/apm-server.yml
read_only: true
ports: ports:
- "8200:8200" - '8200:8200'
networks: networks:
- elk - elk
depends_on: depends_on:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment