sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Improve docs for `extractTraceparentData` function

Open abrahamq opened this issue 5 years ago • 4 comments

  • [x] Review the documentation: https://docs.sentry.io/
  • [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues have seen this issue but it doesn't contain much more info.
  • [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases
  • [x] Provide a link to the affected event from your Sentry account - https://sentry.io/organizations/tierra/issues/2081900024/?project=1841969&query=is%3Aunresolved

Package + Version

  • [ ] @sentry/browser
  • [x] @sentry/node - 5.29.0
  • [ ] raven-js
  • [ ] raven-node (raven for node)
  • [x] other: @sentry/tracing - 5.29.0

Version:

5.29.0

Description

I'm trying to write a graphql-middleware to integrate with our app. Following the instructions here I tried to modify the express middleware already in sentry for this use; however, when I try to call Span.fromTraceparent I receive the titular error. I've looked through the compiled javascript and that function is nowhere to be found even though it is present on the typedoc here: https://getsentry.github.io/sentry-javascript/classes/tracing.span-2.html#fromtraceparent

Thanks!

abrahamq avatar Dec 09 '20 21:12 abrahamq

Here's a minimal repo, if that helps: https://github.com/abrahamq/minimal-sentry-repo

abrahamq avatar Dec 10 '20 16:12 abrahamq

You can use the extractTraceparentData function. Like so:

https://github.com/getsentry/sentry-javascript/blob/dcdb1130586e3a4d42b3611b41952f329a8da94e/packages/node/src/handlers.ts#L59-L69

We need to improve the documentation here.

AbhiPrasad avatar Sep 30 '21 16:09 AbhiPrasad

@lobsterkatie

instead of documenting this internal helper function, we should consider adding according to spec the proper public APIs

smeubank avatar Aug 01 '22 14:08 smeubank

Related: https://github.com/getsentry/sentry-docs/issues/2984

See discussion of continueFromHeaders and iterHeaders (the spec API Steven mentions above) here.

lobsterkatie avatar Aug 01 '22 16:08 lobsterkatie