Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

florimondmanca/ddtrace-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ddtrace-examples

Example applications built to try out Datadog APM.

Examples

To run these examples (without having to deploy to a cloud host), make sure you have the Datadog Agent installed and running locally. (Personally, I installed the Agent on my Mac following the instructions here.)

Traces may take a few minutes to show up in the APM UI.

Flask

ddtrace-run python -m apps.flask

ASGI

(e.g. Starlette.)

ddtrace-run uvicorn apps.starlette:app

How it works

The Flask application, which is taken from the Tracing Quickstart guide, is auto-instrumented by dd-trace-py. Running with ddtrace-run ... automatically patches flask, which has the effect of sending traces to Datadog on each HTTP request.

The ASGI application is instrumented via the TraceMiddleware provided by ddtrace-asgi. It, too, sends traces to Datadog on each HTTP request made to the application.