Oban Web (a view of Oban's inner workings that you host within your app) - Info, News & Updates Thread

Oban.Web is a view of Oban’s inner workings that you host directly within your Phoenix application. Powered by Oban Metrics and Phoenix Live View, it is distributed, lightweight, and fully real-time.

Check out the live demo.


You can read the original announcement on the Oban blog (complete with embedded videos)


The first Oban Web v2.10 release candidate is out! Oban Web v2.10 brings a few long-awaited
features like realtime charts, auto-complete powered filtering, keyboard shortcuts, and massive
performance improvements for high throughput systems.

:crystal_ball: Realtime Charts

Charts for realtime metrics are enabled out of the box without any external dependencies. Charts are helpful for monitoring health and troubleshooting from within Oban Web because not all apps can, or will run an extra time-series or metrics database. And, because they’re displayed alongside the original jobs, you can identify outliers in aggregate and then drill into individual jobs.

Highlights

  • Select between execution counts, full counts, execution time, and wait time
  • Aggregate time series by state, node, worker, or queue label
  • Rollup metrics by time from 1s to 2m, spanning 90s to 3h of historical data
  • Measure execution and wait times across percentiles, from 100th down to 50th at standard
    intervals

:mag: Filtering with Auto-complete

Filtering is entirely overhauled with a new auto-complete interface, new qualifier syntax, and vastly more performant queries. Full text searching with unindexable operators such as ilike and tsvector was removed in favor of highly optimized exact-match queries. With the new query syntax, all searching is faster, and searching nested args is over 100x faster thanks to index usage.

One additional performance improvement for large oban_jobs tables is threshold querying. Only the most recent 100k jobs (approximately) are filtered to minimize load on the application’s database. The 100k limit can be disabled or configured for each state, i.e., you could restrict filtering completed jobs but access the full history of cancelled jobs.

Highlights

  • Filter by args, meta, node, priority, queue, tags, and worker
  • Typeahead with keyboard shortcuts for focusing, selecting, and completing suggestions
  • Highly optimized suggestion queries across a configurable number of recent jobs
  • Locally cached for immediate feedback and minimal load on your application database
  • Auto-completion of nested args and meta keys and values at any depth

:stopwatch: Metrics

The foundation of charts, filtering, optimized counts, and realtime monitoring is the new Oban.Met package. It introduces a distributed time-series data store and replaces both Oban.Plugins.Gossip and Oban.Web.Plugins.Stats with zero-config implementations that are much more efficient.

Highlights

  • Telemetry-powered execution tracking for time-series data replicated between nodes, filterable by label, arbitrarily mergeable over windows of time, and compacted for more extended playback.
  • Centralized counting across queues and states with exponential backoff to minimize load and data replication between nodes.
  • Ephemeral data storage via data replication with handoff between nodes. All nodes have a shared view of the cluster’s data, and new nodes are caught up when they come online.

In the future, Oban.Met modules will be public, documented, and available from your applications.

:mending_heart: Upgrading

Most apps can upgrade by pinning to the latest release and removing unused plugins from their configuration. Oban Met starts supervised collectors automatically in fitting environments, and the old plugins aren’t necessary.

plugins: [
- Oban.Plugins.Gossip,
- Oban.Web.Plugins.Stats,
...

Point deps to the release candidate once the plugins are removed:

{:oban_web, "2.10.0-rc.2", repo: :oban}

:yellow_heart: Until Next Time

We’ve planned some of these features since the first sketch of an Oban dashboard and are delighted
to share them finally. Please Play with the demo, try giving the RC a spin, and share your
feedback with us!

See the complete Web Changelog for a full list of changes, enhancements, and bug fixes.

15 Likes

Oban Web v2.10.0 final is out! As always, the live demo is available for you to play with.

The release candidate phase is over; this is a general release with bug fixes and a few small enhancements. Thanks to everybody who tested the RC and gave bug reports and feedback :yellow_heart:

The full changelog of each RC and the final point-0 release are inlined below:

v2.10.0 — 2023-10-12

Enhancements

  • [Jobs] Append and submit filter suggestions on click

    Previously, clicking a suggested value injected it into the input but didn’t submit it as a filter. That was unexpected, and led to an odd “deletion” of previous values when typing multiple filters at once. Clicking on a suggested value immediately submits it as a filter now.

  • [Jobs] Improved json path suggestions

    Auto submission exposed an issue with json path completion, i.e. path suggestions lacked a final : or . to indicate if it was a full qualifier or part of a path. Now it’s clear whether an args or meta suggestion is part of a nested object path (.), or a final key (:).

  • [Jobs] Add filtering by a list of ids, e.g. ids:1,2,3

    It turns out this is a commonly used feature, especially in a staging environment and by testing teams.

Bug Fixes

  • [Resolver] Only use a conservative query limit for completed jobs

    Due to the loose application of threshold queries, the 100k limit caused confusion for other states with only a handful of jobs, e.g. retryable. Now the limit is only applied to completed jobs by default and :infinity for all other states.

  • [Jobs] Parse entire term as an integer when filtering

    Values, such as UUIDs that start with a digit, were incorrectly considered an integer and couldn’t be used in filtering.

  • [Job Details] Prevent cancelled/discarded jobs showing completed

    The timeline component incorrectly displayed jobs that weren’t completed or executing as completed.

v2.10.0-rc.3 — 2023-09-24

Enhancements

  • [Resolver] Prevent dashboard access with :forbidden access

    The dashboard now offers authentication by checking access on mount via resolve_access/1. Returning {:forbidden, path} will halt mounting and redirect to the specified path.

    By combining resolver_user/1 and resolve_access/1 callbacks it’s possible to build an authentication solution around the dashboard. For example, this resolver extracts the current_user from the conn’s assigns map and then scopes their access based on role. If it is a standard user or nil then they’re redirected to /login when the dashboard mounts.

    defmodule MyApp.Resolver do
      @behaviour Oban.Web.Resolver
    
      @impl true
      def resolve_user(conn) do
        conn.assigns.current_user
      end
    
      @impl true
      def resolve_access(user) do
        case user do
          %{admin?: true} -> :all
          %{staff?: true} -> :read_only
          _ -> {:forbidden, "/login"}
        end
      end
    end
    
  • [Jobs] Change default sort direction for completed states

    Completed, cancelled, and discarded states used an unintuitive sort preference with oldest jobs first. Now it’s restored to the historic ( and more intuitive) order of newest jobs first.

  • [Deps] Loosen constraints to allow Phoenix LiveView v0.20 and above

  • [Deps] Require a minimum of Oban Met v0.1.2 and above

Bug Fixes

  • [Chart] Correct count estimation for values between 1k and 10k

  • [Job Details] Make detail times relative on demand.

    Job details always showed - because the old relative_ timestamp fields were removed. Now details show the correct relative timestamp, including a fix to correctly show the timing and duration for completed jobs.

  • [Chart] Use sum for exec counts and max for full counts to display accurate information when rolling up values by periods greater than 1s. Previously, full counts were summed across time windows.

v2.10.0-rc.2 — 2023-08-22

Let’s try this one more time…

  • [Assets] Inline assets and track them as external resources rather than loading on them at runtime.

v2.10.0-rc.1 — 2023-08-22

Bug Fixes

  • [Assets] Correctly resolve assets directory across all build environments.

    A change to loading assets dynamically at runtime broke path resolution in release builds.

2 Likes