Repository navigation
v0.8.0
Upgrading needs a few manual NATS steps: see docs/upgrading.md.
Added
Cosmo.configurewithconfig.server_middleware: a middleware chain around every job executionconfig.client_middleware: a middleware chain around every job enqueue, to change the payload or stop the publishconfig.error_handlers: callables given every error Cosmo rescues, jobs and stream batches includedconfig.logger = ...andconfig.log_level = ...inCosmo.configure; a logger withouttraceno longer raises- Built-in config defaults: Cosmo runs without
config/cosmo.yml, and a user file is deep-merged over the defaults;
cosmo --initwrites them into the project config.replicas,config.dead(retention, or off),config.scheduled.enabled, andconfig.batches.expiryin
Cosmo.configurefor Cosmo's own service streamsCosmo::Job::Requeue: a middleware raises it to redeliver a job later instead of failing it- Metrics tab in the web UI: per job class runs, failures, average execution and wait time, and a per-day chart;
config.metrics.enabledandconfig.metrics.retentioninCosmo.configure - The web UI's batches table shows each batch's progress and pending jobs
- The web UI's processes table groups workers by jobs, streams, or both
Changed
- Breaking: the
scheduledanddeadstreams are Cosmo's, created bycosmo --setup: listing them under
setup.jobs/consumers.jobsraisesConfigError, as doesbatch_expiry(nowconfig.batches.expiry). Listing
your ownsetup.jobsreplaces the built-indefaultstream - Breaking: the
deadstream usesworkqueueretention instead oflimits. NATS can't change retention in place,
so delete an existing one (nats stream rm dead, dropping its jobs) beforecosmo --setup - Breaking: Cosmo's internal streams and KV buckets are named
_cosmo<domain>:_cosmostatsis_cosmototals, and
thecosmo_jobs_batches,cosmo_jobs_busy,cosmo_processes, andcosmo_jobs_limitsbuckets are_cosmobatches,
_cosmobusy,_cosmoprocesses, and_cosmolimits; nothing is migrated automatically - Breaking: batch counters moved from
_cosmostatsto their own_cosmobatchesstream, which expires them after
config.batches.expiry; batches still open during the upgrade lose their progress counters - Breaking:
Config.setandConfig.to_hare removed: streams and settings go incosmo.yml, code-level setup in
Cosmo.configure, and command-line flags now win over both - Breaking: Sentry is the
Cosmo::Middleware::Sentrymiddleware, which only traces:require "cosmo/middleware/sentry",
add it to the server middleware, and registerCosmo::Middleware::Sentry::ERROR_HANDLERinconfig.error_handlersto
capture exceptions;cosmo/sentry/autoandCosmo::Sentry::JobProcessorMiddlewareare removed - Breaking: jobs are enqueued through
Cosmo::Job::Enqueuer.enqueue;Publisher.publish_job,Publisher.publish_batch,
andJob::Data#to_argsare removed, andJob::Data#subjectreturns the subject as a string - The web UI's Failed total counts every failed execution, retries included, instead of only jobs that gave up
- A job class's
limit:is enforced byCosmo::Middleware::Limit, the first entry of the server middleware chain,
instead of the job processor - Stream processor errors are logged at error level instead of debug
Fixed
- Stream consumers sharing one NATS stream no longer share one empty-fetch backoff, which made an idle consumer hold
back the busy ones; backoff is kept per consumer - The jobs page passes
pageandlimiton to the processes table