RousselTMLEARNING

TP · Datadog: from discovery to expertise

Lab: Python APM and log-trace correlation

What you will learn in this TP
  • Instrument with ddtrace
  • Read the service page
  • Correlate logs and traces

Introduction #

What you will learn in this section
  • Instrument with ddtrace
  • Read the service page
  • Correlate logs and traces

Context. Developers want to go from an error log to the full trace of the request, and vice versa.

Prerequisites: Lab 1 completed, Python 3  ·  Estimated time: 45 min

Linked traces and logs.

Hands-on #

Guided steps, with their solutions.

  1. 1. Write the API

    Why? A slow route that sometimes fails produces interesting traces.

    Create app.py.
  2. 2. Run with ddtrace

    Why? ddtrace-run instruments Flask and injects the IDs into the logs.

    Install ddtrace and run the API with unified tagging.
  3. 3. Generate traffic

    Why? You need requests, including errors, to populate the service page.

    Send 300 requests.
  4. 4. Read the service page

    Why? RED metrics and deployments appear automatically.

    Open APM > Services > paiement-api. Note the error rate and the p95 latency, then open an error trace.
  5. 5. Correlate

    Why? The injected IDs link the two signals.

    Send app.log to Datadog (agent log configuration on this file, service:paiement-api), then go from a trace to its logs and from an error log to its trace.

Difficulty level : ●●●○○ (3/5)

My progress

  • ⏱ Estimated time : ≈ 45 min

Sign in to track your progress and take notes. Sign in

💬 Recent discussions about this course

Ask a question about this lesson →See all discussions about this course

Recommended Articles

Datadog APM and OpenTelemetry: traces, services and correlation with logs

Instrument applications for Datadog APM (dd-trace, single step instrumentation, OpenTelemetry), u...

Logs with OpenTelemetry: data model, appenders, correlation and collection

Master the log signal: the LogRecord data model, the Logs Bridge API and appenders (Logback, Log4...

Advanced Datadog APM: sampling, retention, profiler and Software Catalog

Go further with Datadog APM: ingestion control and sampling, retention filters, trace metrics, Co...

Correlating traces, metrics, logs and profiles with OpenTelemetry

Link the four signals to diagnose quickly: shared resource, trace_id in logs, exemplars on metric...

Elastic Observability: logs, infrastructure, APM and synthetics

Elastic Observability features: log exploration, infrastructure inventory with Elastic Agent and ...

OpenTelemetry traces in Elasticsearch and Kibana APM

Instrument applications with OpenTelemetry or EDOT SDKs, send traces to Elasticsearch, get Kibana...

Advanced Datadog logs: indexes, exclusion filters, Flex Logs, archives and Sensitive Data Scanner

Control the cost and compliance of Datadog logs: pipelines and processors, indexes and retention,...

Datadog: the SaaS observability platform at a glance

What Datadog is, its products (infrastructure, logs, APM, RUM, synthetics, security), its concept...

RUM and Synthetic Monitoring with Datadog: synthetic transaction monitoring and user experience

Measure user experience with Datadog: browser and mobile RUM, Core Web Vitals, Session Replay, li...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!