Skip to content
New issue

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

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

Already on GitHub? # to your account

Minor span tracing improvements #350

Merged
merged 3 commits into from
Jun 18, 2023

Conversation

ObsidianMinor
Copy link
Collaborator

@ObsidianMinor ObsidianMinor commented Feb 7, 2023

src/workerd/io/trace.h Outdated Show resolved Hide resolved
@ObsidianMinor ObsidianMinor force-pushed the fixup/tracing-apis branch 2 times, most recently from 1a6bddb to 66b2b51 Compare May 30, 2023 01:18
@kentonv
Copy link
Member

kentonv commented May 31, 2023

Why do we need to be able to create subspans after the span has ended? I think the original design expected that would never happen.

@ObsidianMinor
Copy link
Collaborator Author

There's nothing saying it's invalid, and you can technically do it today by making a separate SpanParent to make the child instead of the SpanBuilder after it's ended. I guess I intended it more as a consistency thing.

@ObsidianMinor
Copy link
Collaborator Author

A real example would probably be something like, operation A spawns operation B, but operation A actually ends before operation B has technically "started" because of runtime shenanigans.

@Warfields Warfields self-requested a review May 31, 2023 20:34
src/workerd/io/trace.h Show resolved Hide resolved
@@ -302,22 +303,24 @@ SpanBuilder::~SpanBuilder() noexcept(false) {
}

void SpanBuilder::end() {
Copy link
Contributor

Choose a reason for hiding this comment

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

(Optional) We may want a test on the new span behavior in 8d7e51e, to prevent possible regressions in the future.

WORKSPACE Outdated
type = "tgz",
urls = ["https://github.com/capnproto/capnproto/tarball/b2afb7f8fe393466a38e2fd2ad98482c34aafcee"],
urls = ["https://github.com/capnproto/capnproto/tarball/d0f22701fd3e5a95c108ee1bdc0af7f444d67794"],
Copy link
Member

Choose a reason for hiding this comment

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

Update to final version.

Copy link
Member

@kentonv kentonv left a comment

Choose a reason for hiding this comment

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

Looks good other than merge conflicts and updating the capnp dependency.

Encapsulating the entire span in a state containing
the observer and span and setting it null on `end()`
prevents the creation of subspans after the span has
ended.
@ObsidianMinor ObsidianMinor merged commit dc28092 into cloudflare:main Jun 18, 2023
@ObsidianMinor ObsidianMinor deleted the fixup/tracing-apis branch June 18, 2023 21:01
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants