This playground provides an environment to showcase: (a) tracing Python micro-services, (b) how adding delay to services (upstream and downstream) affects the latency metric, trace.<SPAN_NAME>, and (c) Datadog's Remote Configuration features.
It spins up three containers, a Redis instance, and a Datadog Agent:
upstream
which will appear asupstream-flask
in Datadog.downstream
which will appear asdownstream-flask
.traffic
sends requests toupstream-flask
to simulate traffic.
There's limited setup, we just need to add and API key:
- Head over to the API keys page (US or EU depending on your organizations's Datadog site).
- Create a new API key and give it a name of your choice.
- Substitute
your API key
in the command below with the key you just created — it does not require quotation marks. - Similarly, substitute
<datadoghq.com|datadoghq.eu>
with the respective site (e.gDD_SITE=datadoghq.eu
).
make init DD_API_KEY=<your API key> DD_SITE=<datadoghq.com|datadoghq.eu>
Now that we've added an API key, let's double-check that we can start up the services (i.e. containers) defined in our Docker Compose file. To start up the services, run:
make up
About a couple of minutes after doing this, you should see traces coming through in your Datadog account.
If you'd like to take a look at the logs, you can run:
make logs
To stop the services, run:
make destroy
GET http://localhost:8100/delay/<float>
— will add a delay of<float>
to the upstream service (e.g.GET http://localhost:8100/delay/0.25
will set a delay of 0.25 in the upstream service).GET http://localhost:8110/delay/<float>
- same behavior as above but for the downstream service.