Skip to main content
Install the Foveus .NET SDK to capture executions from your API or worker service. The SDK connects your service to Foveus and sends execution telemetry to your workspace.

Install the package

Add the SDK package to your service.
dotnet add package Foveus.SDK
During private beta, your package name or package source may be different. Use the package name and feed URL provided during onboarding.

Configure the SDK

You can configure Foveus in three ways.

Minimal setup

Use this for local testing or quick validation.
builder.Services.AddFoveus("fov_test_...");
Do not hardcode API keys in production code. Use this only for quick local testing.

Configuration-based setup

For most applications, configure Foveus from appsettings.json, environment variables, or your secret manager.
builder.Services.AddFoveus(builder.Configuration);
Add a Foveus section to your configuration.
{
  "Foveus": {
    "ApiKey": "fov_test_...",
    "ServiceName": "orders-api",
    "Environment": "test",
    "Mode": "test"
  }
}

Options-based setup

Use options when you want to configure Foveus directly in code.
builder.Services.AddFoveus(options =>
{
    options.ApiKey = builder.Configuration["Foveus:ApiKey"];
    options.ServiceName = "orders-api";
    options.Environment = "test";
    options.Mode = "test";
});

Add the middleware

For ASP.NET Core APIs, add the Foveus middleware after building the app.
app.UseFoveus();
The middleware captures HTTP executions and sends telemetry to Foveus.
Place Foveus after middleware that establishes request context, authentication, or correlation IDs if your service depends on those values.

Choose a service name

Use a stable service name that identifies the logical service.
options.ServiceName = "orders-api";
Avoid embedding the deployment environment in the service name.
// Avoid
options.ServiceName = "orders-api-production";

// Prefer
options.ServiceName = "orders-api";
options.Environment = "production";
options.Mode = "live";
This keeps your service data easier to search and compare across environments.

Set the environment

Use Environment for the deployment environment. Examples:
local
development
test
staging
production
options.Environment = "staging";

Set the mode

Use Mode for the Foveus data mode.
ModeUse for
testSandbox, development, QA, and onboarding
liveProduction telemetry
options.Mode = "test";
Use test while validating your setup. Use live when your service is ready to send production telemetry.

Store your API key safely

Do not commit API keys to source control. For local development, use user secrets:
dotnet user-secrets set "Foveus:ApiKey" "fov_test_..."
For deployed services, use your hosting provider’s secret manager. Examples:
  • Azure App Configuration or Key Vault
  • AWS Secrets Manager
  • Google Secret Manager
  • Kubernetes secrets
  • Render environment variables

Verify installation

Start your service and call an endpoint.
curl http://localhost:5000/orders
Open Foveus and go to Executions. Search by service:
service:orders-api
If the SDK is configured correctly, you should see recent executions from your service.

Troubleshooting

No executions appear

Check that:
  • your API key is valid
  • your service can reach Foveus
  • ServiceName is set
  • Mode matches the dashboard mode you are viewing
  • your request reached the middleware
  • your selected time range includes the request time

The service name looks wrong

If you see service names like orders-api-production, update your configuration:
options.ServiceName = "orders-api";
options.Environment = "production";
options.Mode = "live";

Context search does not find a value

Execution Context Search uses indexed execution context. It does not scan arbitrary raw request bodies. If you recently enabled context indexing, trigger a new request. Newly indexed context applies to new ingested executions.

Next steps