DataDog/apm-toy-app

Name: apm-toy-app

Owner: Datadog, Inc.

Description: A simple dockerized app to trace.

Forked from: gabsn/apm-toy-app

Created: 2017-08-18 16:04:07.0

Updated: 2017-08-18 16:04:09.0

Pushed: 2017-08-16 16:02:47.0

Homepage:

Size: 1621

Language: PLpgSQL

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

apm-toy-app

A simple app to trace.

full_trace

Prerequisites
  1. Install docker and docker-compose (you can try sudo pip install docker-compose)
  2. (Optional) Install go and its dependency management tool
  3. You need a Datadog account. If you don't have one, just use the free trial.
Get the app running
  1. Get your Datadog API key (Integrations > APIs in the app) and paste it here

Note: each time you'll change your API key, you'll need to rebuild the datadog-agent docker image.

  1. Get your Datadog API key (Integrations > APIs) and paste it here

  2. Run the app

    er-compose up
    

    This command should launch a minimal golang server along with redis, postgres and the datadog-agent.

  3. Go to http://localhost:8080/, you should get something like that:

     hits) - City: Utrecht, 234323 inhabitants
    

    Each time you hit this URL, the golang server will return a different city and its population from postgres and will also tell you how many times you hit this endpoint.

Check the datadog-agent status
  1. Connect to the container running the datadog-agent
    er exec -it apmtoyapp_datadog_1 bash
    
  2. Run the info command of the agent
    ice datadog-agent info
    
  3. Check that postgres and redis are properly reporting metrics
    ks
    ==
    
    gres (5.16.0)
    -------------
    instance #0 [OK]
    Collected 15 metrics, 0 events & 1 service check
    
    sdb (5.16.0)
    ------------
    instance #0 [OK]
    Collected 36 metrics, 0 events & 1 service check
    Dependencies:
      - redis: 2.10.5
    
  4. Go in the Datadog app, Metrics > Explorer and check you can see your metrics in the app.

metrics explorer

Possible issues

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.