-
Notifications
You must be signed in to change notification settings - Fork 127
add config to enable apm-server #1593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,6 +112,10 @@ services: | |
| - "../certs/fleet-server:/etc/ssl/elastic-agent" | ||
| ports: | ||
ChrsMark marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - "127.0.0.1:8220:8220" | ||
| {{ $apm_server_enabled := fact "apm_server_enabled" }} | ||
| {{ if eq $apm_server_enabled "true" }} | ||
ChrsMark marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - "127.0.0.1:8200:8200" | ||
| {{ end }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea to add this to the Fleet Server agent 👍 maybe at some point we can keep it always enabled and/or reuse it for actual performance monitoring of the testing framework. Another option would be to create another agent, but this will probably bring unnecessary complexity. |
||
|
|
||
| fleet-server_is_ready: | ||
| image: tianon/true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| set -euxo pipefail | ||
|
|
||
| VERSION=${1:-default} | ||
| APM_SERVER_ENABLED=${APM_SERVER_ENABLED:-false} | ||
|
|
||
| cleanup() { | ||
| r=$? | ||
|
|
@@ -13,6 +14,11 @@ cleanup() { | |
| # Take down the stack | ||
| elastic-package stack down -v | ||
|
|
||
| if [ "${APM_SERVER_ENABLED}" = true ]; then | ||
| # Create an apm-server profile and use it | ||
| elastic-package profiles delete with-apm-server | ||
| fi | ||
|
|
||
| exit $r | ||
| } | ||
|
|
||
|
|
@@ -34,7 +40,22 @@ if [ "${VERSION}" != "default" ]; then | |
| EXPECTED_VERSION=${VERSION} | ||
| fi | ||
|
|
||
| if [ "${APM_SERVER_ENABLED}" = true ]; then | ||
| # Create an apm-server profile and use it | ||
| profile=with-apm-server | ||
| elastic-package profiles create -v ${profile} | ||
| elastic-package profiles use ${profile} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice idea to use profiles for this 👍 |
||
|
|
||
| # Create the config and enable apm-server | ||
| cat ~/.elastic-package/profiles/${profile}/config.yml.example - <<EOF > ~/.elastic-package/profiles/${profile}/config.yml | ||
| stack.apm_server_enabled: true | ||
| EOF | ||
| fi | ||
|
|
||
| OUTPUT_PATH_STATUS="build/elastic-stack-status/${VERSION}" | ||
| if [ "${APM_SERVER_ENABLED}" = true ]; then | ||
| OUTPUT_PATH_STATUS="build/elastic-stack-status/${VERSION}_with_apm_server" | ||
| fi | ||
| mkdir -p ${OUTPUT_PATH_STATUS} | ||
|
|
||
| # Initial status empty | ||
|
|
@@ -71,4 +92,8 @@ elastic-package stack status -v 2> ${OUTPUT_PATH_STATUS}/running.txt | |
| clean_status_output "${OUTPUT_PATH_STATUS}/expected_running.txt" > ${OUTPUT_PATH_STATUS}/expected_no_spaces.txt | ||
| clean_status_output "${OUTPUT_PATH_STATUS}/running.txt" > ${OUTPUT_PATH_STATUS}/running_no_spaces.txt | ||
|
|
||
| if [ "${APM_SERVER_ENABLED}" = true ]; then | ||
| curl http://localhost:8200/ | ||
| fi | ||
|
|
||
| diff -q ${OUTPUT_PATH_STATUS}/running_no_spaces.txt ${OUTPUT_PATH_STATUS}/expected_no_spaces.txt | ||
Uh oh!
There was an error while loading. Please reload this page.