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

Initial sketch of streaming tail workers #2852

Open
wants to merge 33 commits into
base: main
Choose a base branch
from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Oct 7, 2024

Implements the key pieces of the new streaming tail workers model. Does not yet introduce the changes to make it active. This PR focuses on the core data model and restructuring of parts of the current tail workers impl to accomodate both models. Look at the tests (specifically trace-streaming-test.c++) to get a good feel for how the streaming trace is structured.

Among other changes included here...

  1. Enables tail workers in local dev. A workerd worker can now be configured to push tail events to a tail worker locally. In the current form this only supports the Version 1 tail workers but will soon support the streaming tail workers also.
  2. Adds an autogate that will be used to gate the use of the new streaming tail workers functionality

@jasnell jasnell force-pushed the jsnell/stream-trace-workers-part-1 branch 2 times, most recently from 31ff8c6 to 2dcbac7 Compare October 7, 2024 17:50
src/workerd/io/trace-common.h Outdated Show resolved Hide resolved
src/workerd/io/trace-common.h Outdated Show resolved Hide resolved
src/workerd/io/trace-common.c++ Show resolved Hide resolved
src/workerd/io/trace-common.c++ Show resolved Hide resolved
src/workerd/io/trace-common.h Show resolved Hide resolved
src/workerd/io/trace-common.h Outdated Show resolved Hide resolved
src/workerd/server/server.c++ Outdated Show resolved Hide resolved
src/workerd/server/server.c++ Show resolved Hide resolved
src/workerd/io/trace-common-test.c++ Outdated Show resolved Hide resolved
src/workerd/io/trace-common.h Outdated Show resolved Hide resolved
@jasnell jasnell force-pushed the jsnell/stream-trace-workers-part-1 branch 2 times, most recently from 794cdc2 to e40d411 Compare October 7, 2024 22:15
@jasnell jasnell marked this pull request as ready for review October 8, 2024 00:14
@jasnell jasnell requested review from a team as code owners October 8, 2024 00:14
@kentonv
Copy link
Member

kentonv commented Oct 8, 2024

Can we please get a design doc showing what the API looks like from the application developer's perspective? It's hard to figure that out from a PR.

@jasnell
Copy link
Member Author

jasnell commented Oct 8, 2024

Can we please get a design doc showing what the API looks like from the application developer's perspective...

There's already an internal wiki doc discussing this that has already been shared with you previously. Check your email. Was shared about a month ago and updated yesterday

src/workerd/io/trace.c++ Outdated Show resolved Hide resolved
@danlapid
Copy link
Contributor

Overall LGTM

@jasnell jasnell force-pushed the jsnell/stream-trace-workers-part-1 branch 2 times, most recently from 8fde2e2 to cb7e8ba Compare October 11, 2024 19:27
@jasnell
Copy link
Member Author

jasnell commented Oct 11, 2024

@danlapid ... thanks for the review! I updated a couple of those. On the naming concern, I'm going to leave the names as they are for now. Those will be trivial to change later if necessary before this goes live.

Adds the ability for a workerd worker configuration to specify
a tail worker configuration. This is useful for testing tail
worker development locally, which up to now has not been possible.
* Collapse Info events into the Onset
* Remove ActorFlushInfo
* Other cleanups
No need to express it explicitly. Can be inferred if necessary
based on span outcome.
Original thought on these is that using an optional numeric key
would allow for more efficient encoding. However, it makes the
implementation more complicated so let's just use string keys.
@jasnell jasnell force-pushed the jsnell/stream-trace-workers-part-1 branch from 463db3b to af4a3ff Compare October 18, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants