Skip to main content
Use the Foveus .NET SDK to connect your .NET service to Foveus. The SDK captures execution telemetry from your application and sends it to your Foveus workspace. For an ASP.NET Core API, this usually means capturing one execution per HTTP request. For workers and background services, Foveus captures logs, exceptions, outbound HTTP telemetry, metrics, and trace propagation. A worker has no execution boundary of its own: mark each unit of work with BeginExecution to record it as one execution. See Worker services.

Install the SDK

Install the package in your service.
During private beta, your package name or package source may be different. Use the package name and feed URL provided during onboarding.

Supported .NET versions

The SDK targets netstandard2.0, net6.0 and net8.0. The SDK has been runtime-tested on a .NET 10 host.
Several behaviours on this page require Foveus.SDK 1.1.0-beta.18 or later: disabling Foveus on invalid configuration, flushing queued telemetry on shutdown, BeginExecution, masking redacted query-string parameters, and reading Source, HttpTimeout, MaxRetryAttempts, RetryBaseDelay and MaxBodyCaptureSizeBytes from configuration. Earlier versions throw at startup on invalid configuration and discard queued telemetry on shutdown.

Minimal setup

For most services, start with your test API key.
Then add the middleware for ASP.NET Core APIs.
With this setup, Foveus uses safe defaults: The key decides the mode: a fov_test_ key sends to Test mode and a fov_live_ key sends to Live mode. There is no separate mode setting. You can override these values later.

Invalid configuration

If the API key is missing, empty or malformed, has an unknown prefix, ApiEndpoint is not an http or https URL, or a value is out of range, Foveus disables itself. It writes Foveus is disabled: <reason> to the console and to your application’s log, and your application keeps running without Foveus telemetry. A key that is revoked later is not a startup failure: ingestion requests fail with HTTP 401 at runtime.

Configuration-based setup

For most real applications, load configuration from appsettings.json, environment variables, or your secret manager.
Example configuration:
Override defaults when needed:
Environment is a free-text label for the deployment. It is not the ASP.NET Core environment. For production telemetry, use a live key.

What the SDK captures

The exact data depends on your configuration and application type. The SDK can capture:
  • HTTP executions
  • endpoint and method
  • request query values
  • request body context
  • response body context
  • execution duration
  • outcome and failure evidence
  • exception context
  • logs, if logging integration is configured
  • outbound HTTP telemetry for clients created through IHttpClientFactory
  • consumed MassTransit messages, when cfg.AddFoveusInstrumentation(context) is configured
  • metrics
  • SDK health and performance signals
The SDK does not capture database calls, SQL or EF Core, cache operations, Hangfire, Quartz, Kafka or Azure Service Bus. There is no OpenTelemetry integration.

HTTP executions

For ASP.NET Core APIs, the middleware captures requests as executions.
A request such as:
can appear in Foveus as an execution with:
  • service name
  • environment
  • mode
  • endpoint
  • method
  • duration
  • status
  • request context
  • response context
  • logs, if configured

Worker services

Foveus can also be used in .NET Worker Service and BackgroundService apps. Worker services use builder.Services.AddFoveus(...), but they do not call app.UseFoveus() because workers do not have an ASP.NET HTTP middleware pipeline. Basic worker setup:
Example configuration:
For worker services, Foveus can capture:
  • ILogger logs
  • logged exceptions
  • outbound HTTP telemetry
  • metrics
  • trace propagation
  • one execution per unit of work, when you mark it with BeginExecution
  • SDK shutdown flushing
  • MassTransit consumers, when cfg.AddFoveusInstrumentation(context) is configured
Foveus does not create execution boundaries automatically for arbitrary BackgroundService loops, and it does not capture scheduler, cron or Hangfire job identity. See Worker services.

Request and response context

Foveus can capture structured request and response context. By default, request bodies are captured and response bodies are not (CaptureResponseBodies is false). Context is captured for every failed request and for 1% of successful requests (ContextSamplingRate is 0.01). For example, if your response includes:
Foveus can index safe scalar fields for search.
Or:
Strings should use quotes. Numbers and booleans do not need quotes.
Execution Context Search uses indexed context fields. It does not scan arbitrary raw request or response bodies.

Logs

If logging integration is enabled, Foveus can correlate logs with executions. This helps you inspect logs for one request or operation instead of searching through unrelated log streams. If your service uses Serilog, use the dedicated Serilog integration. See Serilog integration.

Capture profiles

Use CaptureProfile to tune how much telemetry the SDK captures. Example:

Redaction and safety

The SDK redacts these headers by default: Authorization, Cookie, Set-Cookie, X-API-Key, X-Auth-Token and Authentication. In captured JSON request and response bodies, it redacts fields with these names by default: password, token, secret, key, creditCard, ssn, email, phone, address, accessToken, access_token, refreshToken, refresh_token, idToken, id_token, apiKey, api_key, clientSecret, client_secret, authorization, cardNumber, cvv, cvc, pin and otp. You can add domain-specific redacted fields.
Field names match exactly, ignoring case: password is redacted, userPassword is not. A string, number, boolean or null value is replaced with "***"; an object or array under a redacted key is not masked. Query-string parameters whose name is a redacted field are stored as ***; other parameters are stored as sent. Earlier SDK versions store the whole query string as sent. Log messages and exception messages are not redacted. See Redaction.
Redaction is a safety layer. Do not intentionally send secrets, credentials, card data, or highly sensitive personal data to Foveus.

Performance controls

The SDK is designed to keep overhead bounded. You can tune:
  • capture profile
  • context sampling
  • request and response body capture
  • maximum body size
  • path exclusions
  • batch size
  • batch interval
  • retry settings
  • queue size
For high-volume services, use HighThroughput or lower the sampling rate.

Common setup

Local development

The fov_test_ key sends telemetry to Test mode.

Staging

Production API

Production worker

Troubleshooting

No executions appear

Check that:
  • the API key is configured
  • the startup log does not contain Foveus is disabled: — if it does, fix the reason it gives
  • the service can reach Foveus
  • app.UseFoveus() is registered for ASP.NET Core APIs
  • the dashboard is showing the right mode
  • the time range includes the request
  • your service name matches your search

Worker logs appear, but jobs do not show as executions

That is expected when the work is not inside a BeginExecution scope. Foveus does not create execution boundaries for arbitrary BackgroundService loops. Wrap each unit of work in BeginExecution. Without it, logs have no execution and each outbound call is recorded as its own root execution. See Worker services.

The service name looks wrong

If you did not set ServiceName, Foveus uses your project assembly name. Override it if needed.

Response context is missing

Check that:
  • response body capture is enabled
  • the response body is within the capture size limit
  • the route is not excluded
  • sampling did not skip the context snapshot
  • redaction did not mask the field

Too much context is being captured

Use:
  • ExcludedPathPrefixes
  • ExcludedExactPaths
  • lower ContextSamplingRate
  • CaptureProfile: "HighThroughput"
  • lower body capture settings

Next steps