otel spans not flushed in _after?

Open
#682 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
aws, python

Research direction

Inspect datadog_wrapper's _after method and compare how it flushes ddtrace-generated spans with spans from opentelemetry-api. Reproduce an uncaught exception using Datadog Lambda Layer 86 and Python 3.11.14; the work is done when those spans reliably reach Datadog.

Written by the indexing model from the issue text.

Description

Expected Behavior

Spans from uncaught exceptions should still reliably reach datadog.

Actual Behavior

Many spans from uncaught errors are lost before they can be sent.

This needs further investigation, but I suspect it's because datadog_wrapper's _after method specifically flushes ddtrace-generated spans but not opentelemetry-api ones? Maybe it needs to also call TracerProvider.force_flush if applicable?

Specifications

  • Datadog Lambda Layer version: 86
  • Python version: 3.11.14

Stacktrace

Paste here
Dominant language
Python
Stars
102
Forks
52
Avg merge
5d 19h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DataDog/datadog-lambda-python

All issues in DataDog/datadog-lambda-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.