Documentation

QueueHawk.Agent configuration reference

Every option on QueueHawkOptions, what it does, its default, and when you'd actually change it. All options are optional except ApiKey.

Program.cs
builder.Services.AddQueueHawk(options =>
{
    options.ApiKey = builder.Configuration["QueueHawk:ApiKey"];
    options.Environment = "Production";
    // every option below is optional and has a sensible default
});
OptionDescriptionDefault
ApiKeyIdentifies your QueueHawk tenant/application. The only required option — get one by creating a free application at queuehawk.com.(required)
EnvironmentFree-text label shown in the dashboard, e.g. "Production" or a client name for multi-tenant hosting. Not validated against anything server-side — a mismatch with your ASP.NET Core hosting environment name is never rejected."Default"
IncludeJobPayloadsSends job argument values, not just metadata. Off by default because payloads can carry PII or business data — see below.false
OnBeforeSendCallback invoked per captured event, before it's buffered, to rewrite or drop it — used for redacting exception content. See below.null
MaxStackTraceLengthTruncates Exception.ToString() (which includes the stack trace) to this many characters before sending.4000
BatchIntervalSecondsHow often the background dispatcher flushes buffered events over HTTPS. Lower values reduce latency to the dashboard; higher values reduce request volume.5
HeartbeatIntervalSecondsHow often each Hangfire server process reports a heartbeat — the signal QueueHawk uses to detect a worker that's alive but has stopped picking up jobs.30
EnabledGlobal on/off switch. When false, no Hangfire filter is registered and no background services capture or send anything — useful for disabling the agent entirely in local development.true
MaxBufferedEventsSize of the local in-memory ring buffer between the Hangfire filter and the dispatcher. Once full, the oldest buffered event is dropped first — the agent never blocks job execution or grows unbounded memory to avoid losing an event.5000
IngestionBaseUrlHostname the agent sends events and heartbeats to. Override only for local testing or a self-hosted ingestion endpoint — production integrations should leave this at the default."https://ingest.queuehawk.com"

Job payloads: off by default

IncludeJobPayloads controls whether the actual argument values passed into a Hangfire job — not just its type and method name — are sent to QueueHawk. It defaults to false because job arguments routinely carry customer data: a SendInvoice(Guid customerId, decimal amount) job's arguments are exactly the kind of thing that shouldn't leave your infrastructure without a deliberate decision to send it. Turning it on is global, not per job type — there's currently no way to opt in for one job type and not another.

Redacting exception content with OnBeforeSend

Job payloads and exception content are handled differently on purpose. Exception messages and stack traces are sent by default (only length-truncated via MaxStackTraceLength) — an alert with no exception detail isn't much of an alert. But an exception message is free text written by whatever code threw it, and it can occasionally echo something sensitive: a validation error that quotes a rejected email address, a database constraint violation that includes a row's key, a third-party SDK that logs a request URL with a query string attached.

OnBeforeSend is the hook for that case — a Func<JobEventDto, JobEventDto?> called for every captured state-change event, before it's written to the local buffer:

Program.cs
builder.Services.AddQueueHawk(options =>
{
    options.ApiKey = builder.Configuration["QueueHawk:ApiKey"];
    options.Environment = "Production";

    options.OnBeforeSend = jobEvent =>
    {
        // only Failed events carry exception content
        if (jobEvent.ExceptionMessage is null)
        {
            return jobEvent;
        }

        return jobEvent with
        {
            ExceptionMessage = Regex.Replace(
                jobEvent.ExceptionMessage,
                @"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}",
                "[REDACTED-EMAIL]"),
        };
    };
});

Longer write-up with more examples: Keeping PII out of exception messages before they ever leave your app.

Reliability guarantees that apply regardless of configuration

These aren't configurable — they're architectural properties of the agent that hold no matter how the options above are set:

Never throws into your job pipeline

Every agent operation — the Hangfire filter, the dispatcher, your own OnBeforeSend callback — is exception-guarded. A bug or a network failure inside the agent can never fail or crash a customer's Hangfire job.

Bounded memory

The local buffer never grows past MaxBufferedEvents. Once full, the oldest event is dropped first (ring-buffer semantics) rather than the agent consuming unbounded memory.

Push-only

The agent only makes outbound HTTPS calls to IngestionBaseUrl. Nothing needs to be opened inbound in your firewall for QueueHawk to work.

← How the integration works Read the redaction write-up →

One line to register, full control over what leaves your app

Free for one application, no card required.

Start free