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

Align Span interface with changes in Otel Span interface #12566

Closed
mydea opened this issue Jun 19, 2024 · 0 comments · Fixed by #12898
Closed

Align Span interface with changes in Otel Span interface #12566

mydea opened this issue Jun 19, 2024 · 0 comments · Fixed by #12898

Comments

@mydea
Copy link
Member

mydea commented Jun 19, 2024

There are three methods in the OTEL Span interface that we do not have in our own, leading to technical incompatibility - see https://github.com/open-telemetry/opentelemetry-js/blob/main/api/src/trace/span.ts

  • addLink - should noop in SentrySpan
  • addLinks - should noop in SentrySpan
  • recordException - should probably capture an exception??

Without this, you technically can't pass something typed as Span from @sentry/types into some API that expects an OTEL span.

mydea added a commit that referenced this issue Jun 20, 2024
With this PR, you can now pass a `parentSpan` optionally to `startSpan*`
APIs to create a span as a child of a specific span:


```js
const span = Sentry.startInactiveSpan({ name: 'xxx', parentSpan: parent });

Sentry.startSpan({ name: 'xxx', parentSpan: parent }, () => {});

Sentry.startSpanManual({ name: 'xxx', parentSpan: parent }, () => {});
```

With this, it should be easier to understand how you can manually work
with spans in v8.

Closes #12539

ref #12566, which I
noticed while working on this. For now I just cast the span which should
be fine, but is not ideal.
@chargome chargome self-assigned this Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants