-
Notifications
You must be signed in to change notification settings - Fork 303
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
Console support for event streams #28
Comments
For UX, it's going to be streaming in the browser, pretty much like with the V2 Console today. In terms of memory, I think it would be wise to have a maximum duration (maybe also count) or entries to keep in memory. When you start the stream, there may already be history available (either duration or count is selectable) if the server supports it. For technicalities, see https://github.com/TheThingsIndustries/lorawan-stack/issues/1640 |
I tried several approaches to implement in the console, however none of the seem to work. Approaches:
Note, that the Every request gets into the |
This turns out to be caused by the Gzip middleware not flushing response chunks. I created a PR to fix this: labstack/echo#1317 @bafonins can you try what you did with gzip disabled ( |
Yes, I just verified that the problem is indeed with the |
Summary:
The console should support displaying real-time event streams.
All entities trigger events when they are created/updated/deleted:
LoRaWAN traffic also triggers messages while being processed by the stack. This is specifically useful for debugging EndDevices.
Why do we need this?
The purpose of event streams is mostly to let users trace messages through the stack, typically for debugging. Users will go to a single entity page and navigate to the events section. The console will then display some historical events if available (history is not stored by default) and add events as they come in. Users will be able to inspect event details. Users will be able to filter events by event name, and some other fields.
What is already there? What do you see now?
We have the Events API (see api doc). The
Events.Stream
RPC is mapped to HTTP on aPOST /api/v3/events
(note thePOST
). The request contains the identifiers of entities (plural) that the caller is interested in. All event names are selected, and it is not (yet) possible to filter event names server-side. Matching events are streamed as newline-delimited JSON objects in the response.NOTE: In the future we may add a websocket version of this endpoint, but for now we're only working with this.
We also have the
ttn-lw-cli events
command that subscribes to the events stream (over gRPC).The Event message contains the following fields:
name
(string) of the event. An example isapplication.api-key.create
. This name has a translation with keyevent:application.api-key.create
.time
(timestamp) of the event.identifiers
one or more entity identifiers of entities related to the event (for example, an OAuth authorize event involves a user and an OAuth client)data
(optional object) details of the event, can be different for each event typecorrelation_ids
(list of strings) used for correlating this event to other events. In the future we may define an API for getting historical events by correlation ID, but that's currently not possible yet.origin
(string) origin of the event (typically the hostname of the instance/container), so may not say much.What is missing? What do you want to see?
name
(after events are received)identifiers
(after events are received)correlation_ids
(after events are received)Original issue: https://github.com/TheThingsIndustries/lorawan-stack/issues/1071 by @bafonins
The text was updated successfully, but these errors were encountered: