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

Event stream filters in console #2231

Closed
kschiffer opened this issue Mar 25, 2020 · 18 comments
Closed

Event stream filters in console #2231

kschiffer opened this issue Mar 25, 2020 · 18 comments
Labels
c/console This is related to the Console needs/ux This needs UX design / approval ui/web This is related to a web interface

Comments

@kschiffer
Copy link
Contributor

kschiffer commented Mar 25, 2020

Summary

We should provide filtering features for our data view / event stream.

Why do we need this?

  • Closing v2 feature gap
  • Supporting advance use cases for data monitoring
  • Mitigate event flooding

What is already there? What do you see now?

Event streaming for all our entities.

What is missing? What do you want to see?

Filtering options to improve utility of the event stream

I've done a wireframe about this a while ago:
Event filters
Some related discussion can be viewed here: https://github.com/TheThingsIndustries/lorawan-stack/issues/1071

We should discuss which forms of filters are viable.

Environment

v3.7.0

How do you propose to implement this?

I think we can make use of a special store selector selectFilteredEvents(filter) which selects event based on a defined filter object.

Can you do this yourself and submit a Pull Request?

Anyone please feel free to pickup.

@kschiffer kschiffer self-assigned this Mar 25, 2020
@kschiffer kschiffer added c/console This is related to the Console ui/web This is related to a web interface labels Mar 25, 2020
@kschiffer kschiffer added this to the Next Up milestone Mar 25, 2020
@kschiffer kschiffer assigned bafonins and unassigned kschiffer May 19, 2020
rvolosatovs pushed a commit to rvolosatovs/lorawan-stack-fork that referenced this issue Sep 15, 2020
@kschiffer kschiffer added the needs/ux This needs UX design / approval label Feb 15, 2021
@kschiffer kschiffer modified the milestones: Next Up, February 2021 Feb 15, 2021
@kschiffer kschiffer added the blocking Another issue or pull request is waiting for this label Feb 15, 2021
@kschiffer
Copy link
Contributor Author

With regards to #3713 (comment) we need to expand the functionality here a bit. There are scenarios where applications have hundreds or thousands of end-devices. This will crash the Console altogether when the event view is open. Hence, it is necessary to enforce some filter for heavy-load situations.

Such filters could be:

  • Limit the entity scope for application event streams to max 20 (or so) end devices
  • Only show the forward event type for uplinks downlinks and similar outfiltering of auxiliary event

We could use different levels of enforced filtering and use it for some predefined "events per second"-thresholds.

Ideas welcome cc @bafonins @htdvisser @johanstokking

@htdvisser
Copy link
Contributor

htdvisser commented Feb 16, 2021

The number of registered end devices isn't necessarily an indication of the amount of traffic, so I don't think it would be a good idea to do different things depending on the number of registered end devices.

My suggestion would be to extend the API to allow filtering on event name. Every events view in the Console would then give the user some UI where they can check/uncheck events they're interested in. The event names that are selected by default can then be adapted to show the most relevant events for a given entity.

For the Application overview, we can then filter on application.** and as.**, so that we only see application layer events, not all Network Server MAC events (for those, you'd have to open a specific end device)

@kschiffer
Copy link
Contributor Author

Blocked on #3817

@kschiffer kschiffer added blocked This can't continue until another issue or pull request is done and removed blocking Another issue or pull request is waiting for this labels Feb 16, 2021
@htdvisser htdvisser modified the milestones: February 2021, March 2021 Mar 1, 2021
@johanstokking johanstokking modified the milestones: March 2021, Next Up Mar 1, 2021
@kschiffer
Copy link
Contributor Author

kschiffer commented May 6, 2021

I had originally planned to fix this with a general overhaul of the event stream via #3817, but I think it's necessary to make some quick adjustments now to make the event stream less verbose. A simple solution here is to add a verbose switch to the event stream, which will enable users to filter out many events that only add noise to the event output.

I propose the following list of events to be shown by default, when verbosity is deactivated:

as.down.data.decode.fail
as.down.data.encode.fail
as.down.data.forward
as.packages.loraclouddmsv1.fail
as.packages.loracloudglsv3.fail
as.pubsub.fail
as.up.data.decode.fail
as.up.data.forward
gs.down.send
gs.down.tx.fail
gs.gateway.connect
gs.gateway.disconnect
gs.status.fail
gs.status.forward
gs.up.fail
gs.up.receive
js.join.accept
js.join.reject
ns.down.data.schedule.fail
ns.down.join.schedule.fail
ns.up.join.cluster.fail
ns.up.join.interop.fail
organization.*
user.*
gateway.*
application.*
end_device.*

I've selected these events based on what is likely of direct interest to users. This includes

  • any failure event
  • one event per received data message, which is the as.up/down.data.forward
  • one event per join request/reject
  • one event per received message for gateways
  • gateway metrics (though i find that these are often sent many times repeatedly)
  • any entity registry event (these are usually not very frequent)

Please review this list @htdvisser @johanstokking @neoaggelos @adriansmares, so I can finalize the list and coordinate implementation.

@neoaggelos
Copy link
Contributor

The list of events LGTM in general with one exception: I would swap gs.status.forward with gs.status.receive, since the status messages are important for the GS, not the upstream hosts (at the moment at least). This also gives us 1 instead of 2 events per status message (we get one gs.status.forward per upstream host).

@htdvisser
Copy link
Contributor

I think it would also be useful to have these:

  • *.end_device.* -- end device updates on the NS/AS/JS are mostly useful when we also have history, because then you can compare behavior before/after the update.
  • as.{up,down}.data.decode.warning -- we shouldn't ignore warnings
  • as.{up,down}.data.drop -- dropped uplinks/downlinks in the AS are almost always abnormal
  • as.up.join.drop -- neither are dropped joins in the AS
  • as.down.data.queue.invalid/as.down.data.queue.lost (maybe, @adriansmares?)
  • *.api-key.* -- these are security events
  • *.collaborator.* -- these too
  • ns.mac.*.answer.reject -- these indicate a problem in the MAC state, shouldn't be hidden
  • ns.up.data.process -- this is the first event that contains a de-duplicated uplink

@kschiffer
Copy link
Contributor Author

as.{up,down}.data.decode.warning -- we shouldn't ignore warnings

It's not ignoring them, just hiding them by default. I decided to filter warnings out by default, since this also what you'd expect when not being in verbose mode.

  • as.{up,down}.data.drop -- dropped uplinks/downlinks in the AS are almost always abnormal
  • as.up.join.drop -- neither are dropped joins in the AS

👌

  • *.api-key.* -- these are security events
  • *.collaborator.* -- these too

I guess that's fine since they also shouldn't be very frequent.

  • ns.mac.*.answer.reject -- these indicate a problem in the MAC state, shouldn't be hidden

👌

  • ns.up.data.process -- this is the first event that contains a de-duplicated uplink

I don't know I'd really have just one event for uplink messages, which is the one from the AS which also contains the decoded payload.

Remember that we are really trying to reduce the noise with this filter, so I think we should hide anything that is not typically of interest when viewing the event stream. Anything else can be viewed as usual when activating verbose mode.

@htdvisser htdvisser added this to the v3.15.2 milestone Sep 23, 2021
@htdvisser
Copy link
Contributor

As discussed with @kschiffer, we'll add support for filtering events by name on the backend.

I'll pick up the API and backend implementation after which @kschiffer will update the Console.

@htdvisser
Copy link
Contributor

@kschiffer I just pushed the backend work to feature/2231-event-filter.

I can imagine that for the frontend it can be useful to know the full list of event names. In pkg/events/grpc/grpc.go you'll see how the EventsServer builds that list. We could write a little tool to extract the names into a JS/JSON file (similar to the one that creates messages.json).

@NicolasMrad NicolasMrad modified the milestones: v3.15.2, v3.16.0 Oct 6, 2021
@kschiffer kschiffer added the in progress We're working on it label Nov 9, 2021
@htdvisser htdvisser modified the milestones: v3.16.0, v3.16.1 Nov 15, 2021
@htdvisser
Copy link
Contributor

@kschiffer did you still want to implement the rest of this or did you only want to pick up the part in #4831?

@kschiffer kschiffer added needs/ux This needs UX design / approval get back to in backlog, need revisiting and removed in progress We're working on it labels Nov 16, 2021
@kschiffer
Copy link
Contributor Author

I can stay assigned here. I've removed the milestone for now.

@NicolasMrad NicolasMrad removed this from the v3.16.1 milestone Nov 22, 2021
@kschiffer
Copy link
Contributor Author

kschiffer commented Jun 29, 2022

Let's schedule this and aim for completion in Q3.

@kschiffer kschiffer added this to the 2022 Q3 milestone Jun 29, 2022
@kschiffer kschiffer removed the get back to in backlog, need revisiting label Jun 29, 2022
@NicolasMrad NicolasMrad modified the milestones: 2022 Q3, 2023 Q1 Oct 10, 2022
@NicolasMrad NicolasMrad modified the milestones: 2023 Q1, 2023 Q2 Apr 12, 2023
@KrishnaIyer KrishnaIyer added needs/triage We still need to triage this and removed needs/triage We still need to triage this labels Jul 5, 2023
@KrishnaIyer KrishnaIyer removed this from the 2023 Q2 milestone Jul 5, 2023
@KrishnaIyer
Copy link
Member

We have basic filtering of events (verbose). The proposal here is great if we have a General "events" page on the console and we can then do some filtering there. If we have such a page, then indeed we can look at this generic filtering system.

However, the way most users (including me) use the console is to navigate to the target gateway, application or end device and look into the events there. Here, we can make a few informed choices about the filtering in each of those pages (contexts). That is handled here: #7342

@KrishnaIyer KrishnaIyer closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/console This is related to the Console needs/ux This needs UX design / approval ui/web This is related to a web interface
Projects
None yet
Development

No branches or pull requests

8 participants