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

[Error Handling] Backend - Event Log System #2254

Closed
2 tasks done
Tracked by #2040
xoscar opened this issue Mar 27, 2023 · 4 comments
Closed
2 tasks done
Tracked by #2040

[Error Handling] Backend - Event Log System #2254

xoscar opened this issue Mar 27, 2023 · 4 comments
Assignees

Comments

@xoscar
Copy link
Collaborator

xoscar commented Mar 27, 2023

NOTE: This ticket is partially blocked until the following tasks are completed:

This ticket is part of the epic #2040 to improve the UX/UI when running a test

Acceptance Criteria:

AC1
As a client triggering a new test run
I should be able to subscribe for live events from the server side using a WebSocket
And get live information about what is happening with the run

AC2
As a client that triggered a run
And I need to display the full list of events up until that point
I should be able to fetch the list from an endpoint to get the event history

AC3
As a developer working on adding event logs to the test run process
I should be able to use a wrapper subscription which will be listening to events happening at the test run level
And push those events to both the WebSocket and store them in the database

AC4
As a developer working on adding event logs to the test run process
I should be able to add extra information depending on the event (polling, data store connection)

AC5
As a developer working on adding event logs to the test run process
The event system should be extendable to add new event types depending on the requirements and updates

To find more information about the technical design for this task check out the following comment

@danielbdias danielbdias self-assigned this Mar 28, 2023
@danielbdias danielbdias changed the title [Error Handlig] Backend - Event Log System [Error Handling] Backend - Event Log System Mar 28, 2023
@mathnogueira
Copy link
Member

Build/re-use Websocket subscriber for Test events

I don't think this is the right approach TBH. One of the requirements for the epic is that Tracetest generates telemetry based on those events. This means that every time an event is created, it should have a span with that information too. The implication for that is that we get a new context.Context and have to use it in order to link the spans to their correct parents.

I don't think it's possible to have the subscriber manage those contexts in an easy way. I rather have a facade instead. This is how I imagine it (simplified version)

// facade.go
// ...
func (f facade) Emit(ctx context.Context, event Event) (context.Context, error) {
  span, ctx := f.tracer.Start(ctx, event.Name)
  // populate span with event data
  f.db.InsertEvent(ctx, event)
  f.subscriber.Publish(ctx, event)
}

@mathnogueira
Copy link
Member

mathnogueira commented Mar 30, 2023

Should we add events to the otlp ingest endpoint? It's possible to get the testID and runID based on the traceID. @xoscar @jorgeepc @danielbdias @schoren

I can see why to add it, but I'm not sure if it adds any extra visibility when comparable to the polling events

@danielbdias
Copy link
Contributor

danielbdias commented Apr 5, 2023

At first glance, we could add it to have visibility in debugging, and to understand what happened during a test run.
We can do that on a v2, along with the Trace Stop event

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

No branches or pull requests

4 participants