From 1f6211eb938a2b607e6eaca4c58aa748963c2500 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Fri, 12 Jul 2019 19:53:54 -0400 Subject: [PATCH] add aliases --- dash-apm-python/background.sh | 1 + dash-apm-python/foreground.sh | 3 +++ dash-apm-python/index.json | 4 ++-- dash-apm-python/step_2.md | 2 +- dash-apm-python/step_3.md | 2 +- dash-apm-python/step_4.md | 2 +- dash-apm-python/step_5.md | 2 +- dash-apm-python/step_6.md | 2 +- dash-apm-python/step_7.md | 44 +++++++++++++++++++++++++++++++++++ dash-apm-python/step_8.md | 44 ----------------------------------- 10 files changed, 55 insertions(+), 51 deletions(-) diff --git a/dash-apm-python/background.sh b/dash-apm-python/background.sh index 818d324..319cf16 100644 --- a/dash-apm-python/background.sh +++ b/dash-apm-python/background.sh @@ -2,4 +2,5 @@ mkdir /tracing-workshop git clone https://github.com/brettlangdon/distributed-tracing-with-apm-workshop /tracing-workshop cd /tracing-workshop + docker-compose pull diff --git a/dash-apm-python/foreground.sh b/dash-apm-python/foreground.sh index 9c82e69..d0ab00e 100644 --- a/dash-apm-python/foreground.sh +++ b/dash-apm-python/foreground.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +alias start-services="docker-compose up" +alias restart-services="docker-compose up" + cd /tracing-workshop # clear the console diff --git a/dash-apm-python/index.json b/dash-apm-python/index.json index 7fef460..db91677 100644 --- a/dash-apm-python/index.json +++ b/dash-apm-python/index.json @@ -28,11 +28,11 @@ "text": "step_6.md" }, { - "title": "Adding manual spans", + "title": "Enable trace and logs", "text": "step_7.md" }, { - "title": "Enable trace and logs", + "title": "Adding manual spans", "text": "step_8.md" }, { diff --git a/dash-apm-python/step_2.md b/dash-apm-python/step_2.md index d660462..5fd595a 100644 --- a/dash-apm-python/step_2.md +++ b/dash-apm-python/step_2.md @@ -5,7 +5,7 @@ Copy the following command and replace `` with your API key and execute: Next, run the following command to start our docker services: -`docker-compose up`{{execute}} +`start-services`{{execute}} Next, open the web interface to verify the application is up and running: diff --git a/dash-apm-python/step_3.md b/dash-apm-python/step_3.md index 17934ce..c8345d6 100644 --- a/dash-apm-python/step_3.md +++ b/dash-apm-python/step_3.md @@ -15,7 +15,7 @@ frontend: Afterwards restart docker services: -`docker-compose up`{{execute interrupt}} +`restart-services`{{execute interrupt}} Finally, open trace analytics dashboard: diff --git a/dash-apm-python/step_4.md b/dash-apm-python/step_4.md index 8eb64b9..fc5bf45 100644 --- a/dash-apm-python/step_4.md +++ b/dash-apm-python/step_4.md @@ -15,7 +15,7 @@ def add_user_id(): span.set_tag('user_id', user_id) ```{{copy}} -Restart services `docker-compose up`{{execute interrupt}} +`restart-services`{{execute interrupt}} Finally, open the service page for `frontend` to view the new metadata on traces. diff --git a/dash-apm-python/step_5.md b/dash-apm-python/step_5.md index a998e27..8af5f5f 100644 --- a/dash-apm-python/step_5.md +++ b/dash-apm-python/step_5.md @@ -22,7 +22,7 @@ def simulate_sensors(): return jsonify(sensors) ```{{copy}} -Restart our services `docker-compose up`{{execute interrupt}}. +`restart-services`{{execute interrupt}}. Open the `/simulate_sensors` resource page for our `frontend` service. diff --git a/dash-apm-python/step_6.md b/dash-apm-python/step_6.md index 22b0d64..49bb68b 100644 --- a/dash-apm-python/step_6.md +++ b/dash-apm-python/step_6.md @@ -23,7 +23,7 @@ def simulate_all_sensors(): return [s.serialize() for s in sensors] ```{{copy}} -Restart our services `docker-compose up`{{execute interrupt}} +`restart-services`{{execute interrupt}} Open the service page for our `frontend` service. diff --git a/dash-apm-python/step_7.md b/dash-apm-python/step_7.md index e69de29..0187510 100644 --- a/dash-apm-python/step_7.md +++ b/dash-apm-python/step_7.md @@ -0,0 +1,44 @@ +# Enable Datadog logs agent + +Add the following environment variables to the `agent` service in `docker-compose.yml`. + +`DD_LOGS_ENABLED=true`{{copy}} +`DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true`{{copy}} + +Our service should look like: + +```yaml +agent: + environment: + - DD_API_KEY + - DD_APM_ENABLED=true + - DD_TAGS='env:apm-workshop' + - DD_LOGS_ENABLED=true + - DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true +``` + +# Enable trace id injection into logs + +Add the following environment variable to the `frontend`, `node`, `pumps`, +and `sensors` services in `docker-compose.yml`. + +`DD_LOGS_INTEGRATION=true`{{copy}} + +Our services should look like: + +```yaml +frontend: + environment: + - DATADOG_SERVICE_NAME=frontend + - DATADOG_TRACE_AGENT_HOSTNAME=agent + - DD_ANALYTICS_ENABLED=true + - DD_LOGS_INTEGRATION=true +``` + +Afterwards restart docker services: + +`restart-services`{{execute interrupt}} + +Finally, open logs dashboard: + +https://app.datadoghq.com/logs diff --git a/dash-apm-python/step_8.md b/dash-apm-python/step_8.md index 7c1c18e..e69de29 100644 --- a/dash-apm-python/step_8.md +++ b/dash-apm-python/step_8.md @@ -1,44 +0,0 @@ -# Enable Datadog logs agent - -Add the following environment variables to the `agent` service in `docker-compose.yml`. - -`DD_LOGS_ENABLED=true`{{copy}} -`DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true`{{copy}} - -Our service should look like: - -```yaml -agent: - environment: - - DD_API_KEY - - DD_APM_ENABLED=true - - DD_TAGS='env:apm-workshop' - - DD_LOGS_ENABLED=true - - DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true -``` - -# Enable trace id injection into logs - -Add the following environment variable to the `frontend`, `node`, `pumps`, -and `sensors` services in `docker-compose.yml`. - -`DD_LOGS_INTEGRATION=true`{{copy}} - -Our services should look like: - -```yaml -frontend: - environment: - - DATADOG_SERVICE_NAME=frontend - - DATADOG_TRACE_AGENT_HOSTNAME=agent - - DD_ANALYTICS_ENABLED=true - - DD_LOGS_INTEGRATION=true -``` - -Afterwards restart docker services: - -`docker-compose up`{{execute interrupt}} - -Finally, open logs dashboard: - -https://app.datadoghq.com/logs