.NET Worker Service and BackgroundService applications.
Worker services do not have an ASP.NET HTTP middleware pipeline, so setup is slightly different from an HTTP API.
Use Foveus in worker services to capture:
ILoggerlogs- logged exceptions
- outbound HTTP telemetry
- metrics
- trace propagation
- SDK shutdown flushing
- supported messaging instrumentation hooks
Full automatic per-job execution capture for arbitrary
BackgroundService loops is not yet implemented. Foveus can capture worker telemetry today, but it does not automatically wrap every worker loop, queue message, or scheduled job as a separate execution unless supported instrumentation is used or the app records lifecycle events.Install the SDK
Install the Foveus SDK package.During private beta, your package names or package source may be different. Use the package names and feed URL provided during onboarding.
Basic setup
Add Foveus to your worker host.app.UseFoveus() in a worker service.
app.UseFoveus() is ASP.NET Core middleware and only applies to HTTP applications.
Configure the worker
Add aFoveus section to your configuration.
Mode to live.
What works today
In worker services, Foveus can capture:| Capability | Status |
|---|---|
ILogger logs | Supported |
| Logged exceptions | Supported |
Outbound HttpClient telemetry through IHttpClientFactory | Supported |
| Trace and execution header propagation on outbound HTTP | Supported |
| SDK shutdown flushing | Supported |
Source classification as worker | Supported |
| MassTransit instrumentation hooks | Supported when configured |
| Automatic per-job execution capture for arbitrary worker loops | Not fully supported yet |
Logging from workers
If your worker usesILogger, Foveus can capture logs through the SDK logger provider.
Exceptions
Logged exceptions can be sent to Foveus.- exception type
- exception message
- stack trace
- structured log properties
- service name
- environment
- source
Outbound HTTP telemetry
Foveus can instrument outboundHttpClient calls created through IHttpClientFactory.
MassTransit instrumentation
Foveus has MassTransit integration hooks. When configuring MassTransit, call:MassTransit instrumentation requires the application to call
cfg.AddFoveusInstrumentation(context). It is not automatic unless configured.Serilog workers
If your worker uses Serilog, useFoveus.Serilog.
Install:
EnableFoveusLoggerProvider to false in Serilog-first apps to avoid duplicate logs.
See Serilog integration.
Job lifecycle logging
Because automatic per-job execution capture is not fully implemented for arbitrary workers yet, log the lifecycle of important jobs. Use structured logs.What does not work yet
Worker service support is still evolving. Foveus does not yet automatically:- wrap every
BackgroundServiceloop as a separate execution - know when an arbitrary worker job starts, succeeds, fails, or completes
- capture inbound request or response bodies in pure workers
- capture queue or job context for every queue library automatically
- create full job execution boundaries for arbitrary worker code
Recommended worker setup
For a production worker:Troubleshooting
Logs do not appear
Check that:AddFoveus(builder.Configuration)is called- the API key is valid
- the dashboard is showing the right mode
- the worker is actually writing logs
- the log level allows the event
- the service can reach Foveus
Logs are duplicated
If the worker uses Serilog, disable the built-in Foveus logger provider.Outbound HTTP is not captured
Check that:- the worker uses
IHttpClientFactory - Foveus is registered before clients are used
- the call is not excluded by configuration
- the service can reach the outbound target
- the SDK version supports outbound HTTP instrumentation
Worker jobs do not show as separate executions
That is expected for arbitraryBackgroundService loops today.
Full automatic per-job execution capture is not yet implemented.
Log job lifecycle events or use supported instrumentation hooks such as MassTransit where available.
What to do next
- Configure the SDK: SDK configuration
- Use Serilog: Serilog integration
- Review FoveusOptions: FoveusOptions
- Review performance overhead: Performance overhead