client-ts icon indicating copy to clipboard operation
client-ts copied to clipboard

[tracing] Propagate TraceID to the backend. Create a new setupEnv span. Fix span hierarchy

Open sgirones opened this issue 3 years ago • 5 comments

This PR tackles three main issues:

  • Propagate TraceID to the backend: this change enables Datadog APM to link the SDK traces with the backend traces and logs
  • Use a dedicated span for the setup actions: this change traces the setup actions performed by every test suite and links the setup span to the suite span

TODO:

  • [x] Fix span hierarchy: Actions performed inside each test case are linked to the suite span instead of the test span. The test span created in the beforeEach hook needs to be activated before the test code runs.

sgirones avatar Aug 31 '22 12:08 sgirones

⚠️ No Changeset found

Latest commit: 78d5497987553dc1fdaecf6a05d5b0476a1116b6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "@xata.io/client" specified in the `linked` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@xata.io/codegen" specified in the `linked` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

changeset-bot[bot] avatar Aug 31 '22 12:08 changeset-bot[bot]

size-limit report 📦

Path Size
packages/client/dist/index.mjs 10.92 KB (+0.39% 🔺)
packages/client/dist/index.cjs 11.98 KB (+0.57% 🔺)
packages/codegen/dist/index.mjs 2.01 MB (0%)
packages/codegen/dist/index.cjs 2.01 MB (0%)

github-actions[bot] avatar Aug 31 '22 12:08 github-actions[bot]

Your pull request has been published to npm.

You can install it by running:

npm install @xata.io/[email protected]

To test the CLI, run:

npx @xata.io/[email protected]

github-actions[bot] avatar Aug 31 '22 12:08 github-actions[bot]

Looking good! The hierarchy of spans is maintained till the backend 👌

One downside with the final refactor is that we lost the parent Span, and now we have a bunch of top-level spans that belong to the same suite but we don't have a way to point to "all of them".

sgirones avatar Sep 06 '22 18:09 sgirones

I will look at it! Thanks @sgirones

SferaDev avatar Sep 06 '22 20:09 SferaDev