DEV Community

Cover image for 🐝 BusyBee: Fast & Observable Background Job Processing for .NET
Mikolaj Kaminski
Mikolaj Kaminski

Posted on

🐝 BusyBee: Fast & Observable Background Job Processing for .NET

Hello .NET folks 👋

We all use tons of amazing open‑source libraries every day. As a way of saying thank you to the community, I decided to build and share my own:

🚀 BusyBee — a lightweight, high‑performance background job processing library for .NET with built‑in OpenTelemetry support.


✨ Why BusyBee?

When building .NET apps, we often need to:

  • Run fire‑and‑forget jobs in the background
  • Process queues of tasks efficiently
  • Monitor and observe code execution in production

BusyBee makes this simple, fast, and observable.


⚡ Key Features

  • 🐝💨 Super fast in‑memory queues built on .NET Channels
  • ⚙️ Configurable: bounded/unbounded queues, overflow strategies, timeouts, parallelism
  • 📊 Built‑in observability: OpenTelemetry metrics + tracing ready out of the box
  • 🔌 ASP.NET Core DI integration
  • 🛑 Cancellation & timeouts support

🚀 Quick Start

Install BusyBee from NuGet:

dotnet add package BusyBee
Enter fullscreen mode Exit fullscreen mode

Register it in your DI container:

builder.Services.AddBusyBee();
Enter fullscreen mode Exit fullscreen mode

Enqueue jobs:

await queue.Enqueue(async (services, context, cancellationToken) =>
{
    var logger = services.GetRequiredService<ILogger<Program>>();
    logger.LogInformation("Processing job {JobId}", context.JobId);

    await Task.Delay(1000, cancellationToken);
}, cancellationToken);
Enter fullscreen mode Exit fullscreen mode

🔍 Observability with OpenTelemetry

One of BusyBee’s biggest advantages is first‑class OpenTelemetry support.

You can monitor jobs with traces and metrics in tools like Seq, Prometheus, or Grafana.

Enable OpenTelemetry in your app:

builder.Services.AddOpenTelemetry()
    .WithTracing(tracing => tracing
        .AddSource(BusyBee.Observability.TracingConstants.TraceSourceName)
        .AddConsoleExporter())
    .WithMetrics(metrics => metrics
        .AddMeter(BusyBee.Observability.MetricsConstants.MeterName)
        .AddPrometheusExporter());
Enter fullscreen mode Exit fullscreen mode

📸 Screenshots

Here’s BusyBee in action:

Traces and Logs in Seq

Even though job processing takes place in the background, the continuity of the traces is preserved. The example below shows the entire process from the moment of queuing to the completion of the job.

Seq traces screenshot

Metrics in Prometheus

BusyBee has a whole range of built-in metrics. Here's an example metric that shows the number of jobs processed in parallel over time. In this case, the level of parallelism is set to 5.

Prometheus metrics screenshot


🐝 Example App

Check out the DemoApp for a complete example with:

  • Simple Web API + Swagger
  • OpenTelemetry logging, tracing & metrics
  • Seq for centralized logging and tracing ingestion
  • Prometheus integration for metrics scrapping
  • Docker Compose setup

🙌 Get Involved

I’d love for you to:

  • 🐛 Try it out in your projects
  • 💡 Share feedback & ideas
  • 🔧 Contribute if you’d like
  • ⭐ And if you find it useful, please leave a star on GitHub — it really helps!

🎯 Final Thoughts

BusyBee is small, but it’s designed to make background job processing in .NET fast, simple, and observable.

If you’ve ever needed a lightweight alternative to heavy job frameworks, give it a try!

Let’s keep the .NET open‑source ecosystem buzzing 🐝⚡

Top comments (0)