Improve docs for `extractTraceparentData` function
- [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!
Here's a minimal repo, if that helps: https://github.com/abrahamq/minimal-sentry-repo
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.
@lobsterkatie
instead of documenting this internal helper function, we should consider adding according to spec the proper public APIs
Related: https://github.com/getsentry/sentry-docs/issues/2984
See discussion of continueFromHeaders and iterHeaders (the spec API Steven mentions above) here.