Skip to content

feat(otel): add support for span events#3776

Merged
zarirhamza merged 15 commits into
masterfrom
munir/add-span-events
Jul 18, 2024
Merged

feat(otel): add support for span events#3776
zarirhamza merged 15 commits into
masterfrom
munir/add-span-events

Conversation

@mabdinur

@mabdinur mabdinur commented Jul 10, 2024

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Ensures span events generated via the OpenTelemetry SDK are copied from OpenTelemetry Spans to the underlying Datadog span. With change opentelemetry span events are no longer ignored. These events will be sent to the Datadog Agent.
  • Implements Span.record_exception. This ensures the status of the underlying Datadog span is updated when an exception is recorded on an OpenTelemetry Span.

Motivation:

The OpenTelemetry API supports setting Events on spans. Currently these events are ignored by the ddtrace library. To fully support the OpenTelemetry API the ddtrace library must support sending span events to the Datadog Agent.

Additional Notes:

How to test the change?

Unit tests + DataDog/system-tests#2735

Unsure? Have a question? Request a review!

@github-actions github-actions Bot added otel OpenTelemetry-related changes tracing labels Jul 10, 2024
@mabdinur
mabdinur force-pushed the munir/add-span-events branch from be2749a to 2e3e798 Compare July 10, 2024 20:30
Comment thread spec/datadog/opentelemetry_spec.rb Outdated
Comment thread spec/datadog/opentelemetry_spec.rb Outdated
@mabdinur
mabdinur force-pushed the munir/add-span-events branch from 080e3b0 to 78f8b78 Compare July 10, 2024 20:36
Comment thread lib/datadog/tracing/span_event.rb Outdated
@mabdinur
mabdinur force-pushed the munir/add-span-events branch from 589abcf to 5beeb47 Compare July 10, 2024 20:38
Comment thread spec/datadog/tracing/transport/serializable_trace_spec.rb Outdated
Comment thread spec/datadog/tracing/transport/serializable_trace_spec.rb Outdated
Comment thread spec/datadog/tracing/transport/serializable_trace_spec.rb Outdated
Comment thread spec/datadog/tracing/transport/serializable_trace_spec.rb Outdated
Comment thread spec/datadog/tracing/transport/serializable_trace_spec.rb Outdated
@mabdinur
mabdinur force-pushed the munir/add-span-events branch from 9230214 to 6d71a35 Compare July 11, 2024 20:26
@mabdinur
mabdinur marked this pull request as ready for review July 11, 2024 20:26
@mabdinur
mabdinur requested a review from a team as a code owner July 11, 2024 20:26
Comment thread lib/datadog/tracing/span_event.rb Outdated
Comment thread spec/datadog/tracing/transport/serializable_trace_spec.rb Outdated
@codecov-commenter

codecov-commenter commented Jul 11, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.91%. Comparing base (161e3eb) to head (da8c243).
⚠️ Report is 5424 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #3776    +/-   ##
========================================
  Coverage   97.91%   97.91%            
========================================
  Files        1246     1248     +2     
  Lines       74999    75154   +155     
  Branches     3627     3636     +9     
========================================
+ Hits        73435    73590   +155     
  Misses       1564     1564            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread lib/datadog/tracing/span_event.rb Outdated
Comment thread spec/datadog/opentelemetry_spec.rb Outdated
Comment thread spec/datadog/opentelemetry_spec.rb Outdated
Comment thread spec/datadog/tracing/transport/serializable_trace_spec.rb Outdated
@mabdinur
mabdinur force-pushed the munir/add-span-events branch from e2b667a to f78f874 Compare July 12, 2024 20:00
Comment thread lib/datadog/tracing/span_event.rb Outdated
Comment thread spec/datadog/opentelemetry_spec.rb Outdated
Comment thread lib/datadog/opentelemetry/sdk/span_processor.rb Outdated
Comment thread lib/datadog/opentelemetry/sdk/trace/span.rb Outdated
Comment thread lib/datadog/tracing/span_event.rb Outdated
Comment thread lib/datadog/tracing/transport/serializable_trace.rb Outdated
@mabdinur mabdinur changed the title feat(otel): support span events feat(otel): support for span events Jul 16, 2024
@mabdinur mabdinur changed the title feat(otel): support for span events feat(otel): add support for span events Jul 16, 2024
@github-actions
github-actions Bot requested a review from a team as a code owner July 16, 2024 15:52
@mabdinur
mabdinur force-pushed the munir/add-span-events branch from bb92318 to c1cd64f Compare July 16, 2024 16:45
Comment thread lib/datadog/opentelemetry/sdk/trace/span.rb Outdated
Comment thread lib/datadog/tracing/span_operation.rb
Comment thread lib/datadog/tracing/span_event.rb
Comment thread lib/datadog/opentelemetry/sdk/trace/span.rb Outdated
@pr-commenter

pr-commenter Bot commented Jul 17, 2024

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2024-07-18 17:53:28

Comparing candidate commit da8c243 in PR branch munir/add-span-events with baseline commit 161e3eb in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics.

Comment thread lib/datadog/opentelemetry/sdk/trace/span.rb Outdated
Comment thread lib/datadog/opentelemetry/sdk/trace/span.rb
Comment thread lib/datadog/tracing/span.rb
Comment thread lib/datadog/tracing/span_event.rb
Comment thread lib/datadog/tracing/span_event.rb
Comment thread lib/datadog/tracing/span_event.rb Outdated
Comment thread lib/datadog/tracing/span_operation.rb
Comment thread lib/datadog/tracing/span_operation.rb
Comment thread lib/datadog/tracing/transport/serializable_trace.rb Outdated
@mabdinur
mabdinur force-pushed the munir/add-span-events branch from 7784672 to b6e3c5e Compare July 17, 2024 19:04
@mabdinur
mabdinur force-pushed the munir/add-span-events branch from b6e3c5e to 54c757e Compare July 17, 2024 19:11
Comment thread spec/datadog/opentelemetry_spec.rb
@mabdinur
mabdinur force-pushed the munir/add-span-events branch 2 times, most recently from f01655f to c9d6455 Compare July 18, 2024 16:26
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 18, 2024

Copy link
Copy Markdown
Contributor

Library Vulnerabilities

✅ No library vulnerabilities found (scanned da8c243).

Code Vulnerabilities

Warning badge  Notice badge  Info badge

Code Quality Violations

Notice badge  Info badge

@mabdinur
mabdinur force-pushed the munir/add-span-events branch from c9d6455 to 64e29a1 Compare July 18, 2024 16:51
@datadog-datadog-staging-us1-all

datadog-datadog-staging-us1-all Bot commented Jul 18, 2024

Copy link
Copy Markdown

Code Vulnerabilities

Warning badge  Notice badge  Info badge

Code Quality Violations

Notice badge  Info badge

@zarirhamza
zarirhamza merged commit 2f089cd into master Jul 18, 2024
@zarirhamza
zarirhamza deleted the munir/add-span-events branch July 18, 2024 18:13
@github-actions github-actions Bot added this to the 2.3.0 milestone Jul 18, 2024
@TonyCTHsu TonyCTHsu mentioned this pull request Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

otel OpenTelemetry-related changes tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants