Browse Source

update steps

master
Brett Langdon 7 years ago
parent
commit
ee5ec758d8
No known key found for this signature in database GPG Key ID: E6600FB894DB3D19
7 changed files with 102 additions and 64 deletions
  1. +18
    -2
      dash-apm-python/index.json
  2. +15
    -37
      dash-apm-python/step_4.md
  3. +0
    -25
      dash-apm-python/step_5.md
  4. +0
    -0
      dash-apm-python/step_6.md
  5. +0
    -0
      dash-apm-python/step_7.md
  6. +44
    -0
      dash-apm-python/step_8.md
  7. +25
    -0
      dash-apm-python/step_9.md

+ 18
- 2
dash-apm-python/index.json View File

@ -16,12 +16,28 @@
"text": "step_3.md"
},
{
"title": "Enable trace and logs",
"title": "Adding custom metadata",
"text": "step_4.md"
},
{
"title": "Enable process agent",
"title": "Introducing errors",
"text": "step_5.md"
},
{
"title": "Introducing latencies",
"text": "step_6.md"
},
{
"title": "Adding manual spans",
"text": "step_7.md"
},
{
"title": "Enable trace and logs",
"text": "step_8.md"
},
{
"title": "Enable process agent",
"text": "step_9.md"
}
],
"intro": {


+ 15
- 37
dash-apm-python/step_4.md View File

@ -1,44 +1,22 @@
# Enable Datadog logs agent
We can attach our own custom application metadata to spans.
Add the following environment variables to the `agent` service in `docker-compose.yml`.
Open `frontend/frontend/api.py` file.
`DD_LOGS_ENABLED=true`{{copy}}
`DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true`{{copy}}
Add the following code after the `app = Flask('api')` on line 16.
Our service should look like:
``` python
@app.before_request
def add_user_id():
# Get the current user's id
user_id = get_user_id()
```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
```
# Get the current root span (the `flask.request` span)
span = tracer.current_root_span()
span.set_tag('user_id', user_id)
```{{copy}}
# Enable trace id injection into logs
Restart services `docker-compose up`{{execute interrupt}}
Add the following environment variable to the `frontend`, `node`, `pumps`,
and `sensors` services in `docker-compose.yml`.
Finally, open the service page for `frontend` to view the new metadata on traces.
`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
https://app.datadoghq.com/apm/resource/frontend/flask.request/

+ 0
- 25
dash-apm-python/step_5.md View File

@ -1,25 +0,0 @@
To enable the Datadog process agent add the following environment variable
to the `agent` service.
`DD_PROCESS_AGENT_ENABLED=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
- DD_PROCESS_AGENT_ENABLED=true
```
Next, restart our docker services:
`docker-compose up`{{execute interrupt}}
Finally, open the process dashboard:
https://app.datadoghq.com/process

+ 0
- 0
dash-apm-python/step_6.md View File


+ 0
- 0
dash-apm-python/step_7.md View File


+ 44
- 0
dash-apm-python/step_8.md View File

@ -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:
`docker-compose up`{{execute interrupt}}
Finally, open logs dashboard:
https://app.datadoghq.com/logs

+ 25
- 0
dash-apm-python/step_9.md View File

@ -0,0 +1,25 @@
To enable the Datadog process agent add the following environment variable
to the `agent` service.
`DD_PROCESS_AGENT_ENABLED=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
- DD_PROCESS_AGENT_ENABLED=true
```
Next, restart our docker services:
`docker-compose up`{{execute interrupt}}
Finally, open the process dashboard:
https://app.datadoghq.com/process

Loading…
Cancel
Save