Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenTracing doc #2188

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Fix OpenTracing doc #2188

wants to merge 1 commit into from

Conversation

maxep
Copy link
Member

@maxep maxep commented Feb 7, 2025

What and why?

The following statement in OpenTracing doc is not true: If span has nil parent, it becomes the child of the active span.

// As `span3` has the explicit parent (nil) it won't become the child of the active span:
let span3 = tracer.startSpan(operationName: "another root", childOf: nil)

How?

Update the doc and mention startRootSpan instead.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes
  • Add Objective-C interface for public APIs (see our guidelines [internal]) and run make api-surface)

@maxep maxep requested review from a team as code owners February 7, 2025 14:24
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Feb 7, 2025

Datadog Report

Branch report: maxep/fix-opentracing-doc
Commit report: 91aff61
Test service: dd-sdk-ios

✅ 0 Failed, 136 Passed, 3648 Skipped, 25.57s Total duration (2m 3.32s time saved)

Copy link
Member

@ncreated ncreated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👍

@@ -52,10 +52,10 @@ public protocol OTSpan {
/// let span1 = tracer.startSpan(operationName: "root").setActive()
///
/// // As `span2` has no explicit parent, it becomes the child of the active `span1`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The span2 is now the active span right?
As span2 has no explicit parent, it becomes the active span

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants