SeliseBlocks.ObservabilityDriver 10.0.0-preview.2

This is a prerelease version of SeliseBlocks.ObservabilityDriver.
dotnet add package SeliseBlocks.ObservabilityDriver --version 10.0.0-preview.2
                    
NuGet\Install-Package SeliseBlocks.ObservabilityDriver -Version 10.0.0-preview.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SeliseBlocks.ObservabilityDriver" Version="10.0.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SeliseBlocks.ObservabilityDriver" Version="10.0.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="SeliseBlocks.ObservabilityDriver" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SeliseBlocks.ObservabilityDriver --version 10.0.0-preview.2
                    
#r "nuget: SeliseBlocks.ObservabilityDriver, 10.0.0-preview.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SeliseBlocks.ObservabilityDriver@10.0.0-preview.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SeliseBlocks.ObservabilityDriver&version=10.0.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SeliseBlocks.ObservabilityDriver&version=10.0.0-preview.2&prerelease
                    
Install as a Cake Tool

SeliseBlocks.ObservabilityDriver

NuGet package that exposes the Monitor and Health APIs from blocks-observability as a single injectable service: IObservabilityDriverService. Consuming services (e.g. blocks-logic) can host these endpoints locally without depending on the full observability stack.

The driver mirrors the public surface of MonitorController and HealthController.


Install

<PackageReference Include="SeliseBlocks.ObservabilityDriver" />

With Central Package Management, also add to Directory.Packages.props:

<PackageVersion Include="SeliseBlocks.ObservabilityDriver" Version="10.0.0-preview.2" />

Register

using Blocks.Extensions.DependencyInjection;

services.RegisterBlocksObservabilityServices();

Then inject IObservabilityDriverService into your controllers.

public class MonitorController(IObservabilityDriverService observability) : ControllerBase
{
    [HttpGet, Authorize]
    public Task<PaginatedResponse> GetMonitorList(
        [FromQuery] string projectKey,
        [FromQuery] string? monitorSourceType,
        [FromQuery] int pageNumber = 0,
        [FromQuery] int pageSize = 10)
        => observability.GetMonitorListAsync(projectKey, monitorSourceType, pageNumber, pageSize);
}

API Reference

All methods are on IObservabilityDriverService and are awaitable. Return types come from DomainService.Shared.Models / DomainService.Monitor.Models. BaseApiResponse is the standard observability response wrapper ({ Data, Message, StatusCode, IsSuccess }).

Monitor

# Method HTTP equivalent Returns
1 GetMonitorListAsync GET /Monitor/GetMonitorList PaginatedResponse
2 GetMonitorListByRepoIdAsync GET /Monitor/GetMonitorListByRepoId BaseApiResponse
3 GetMonitorByIdAsync GET /Monitor/GetMonitorById BaseApiResponse
4 SaveMonitorAsync POST /Monitor/SaveMonitor BaseApiResponse
5 UpdateMonitorAsync POST /Monitor/UpdateMonitor BaseApiResponse
6 DeleteMonitorAsync DELETE /Monitor/DeleteMonitor BaseApiResponse
7 GetIncidentListAsync GET /Monitor/GetIncidentList PaginatedResponse
8 GetMonitorDetailsAsync GET /Monitor/GetMonitorDetails MonitorDetailsResponse
9 GetMonitorResponseTimeAsync GET /Monitor/GetMonitorResponseTime BaseApiResponse
10 GetMonitorDownTimeAsync GET /Monitor/GetMonitorDownTime BaseApiResponse
11 IsExternalServiceConfiguredAsync GET /Monitor/IsExternalServiceConfigured BaseApiResponse

Health

# Method HTTP equivalent Returns
12 SaveHealthAsync POST /Health/SaveHealth BaseApiResponse
13 UpdateHealthAsync POST /Health/UpdateHealth BaseApiResponse
14 HandlePingAsync GET /Health/Ping/{itemId} Task (no payload)
15 DeleteHealthAsync DELETE /Health/DeleteHealth BaseApiResponse

Endpoint details

1. GetMonitorListAsync

Paginated list of monitor configurations for a project, optionally filtered by monitor source type.

Task<PaginatedResponse> GetMonitorListAsync(
    string projectKey,
    string? monitorSourceType,
    int pageNumber = 0,
    int pageSize = 10);
  • Query string: ?projectKey=A8D3007A36F840DCAFDE6F4AE68EE897&monitorSourceType=DeployedServices&pageNumber=0&pageSize=10

2. GetMonitorListByRepoIdAsync

Monitor configurations (with downtime) scoped to a single repository.

Task<BaseApiResponse> GetMonitorListByRepoIdAsync(string projectKey, string repoId);
  • Query string: ?projectKey=A8D3007A36F840DCAFDE6F4AE68EE897&repoId=repo-123

3. GetMonitorByIdAsync

Fetch a single monitor configuration.

Task<BaseApiResponse> GetMonitorByIdAsync(string monitorId);
  • Query string: ?monitorId=66f1c2b9e8d4a712d4c5e1f0

4. SaveMonitorAsync

Create a new monitor configuration.

Task<BaseApiResponse> SaveMonitorAsync(SaveMonitorConfigurationRequest request);

Sample body (SaveMonitorConfigurationRequest):

{
  "projectKey": "A8D3007A36F840DCAFDE6F4AE68EE897",
  "repoId": "repo-123",
  "repoName": "blocks-logic",
  "externalServiceId": null,
  "externalServiceName": null,
  "name": "Logic API health",
  "url": "https://dev-logic.blocksdevelopers.com/health",
  "monitorType": "Http",
  "protocolType": "Https",
  "httpMethodType": "GET",
  "authorizationType": "None",
  "intervalInSeconds": 60,
  "timeoutInSeconds": 10,
  "isActive": true,
  "monitorSourceType": "DeployedServices",
  "expectedContent": "OK",
  "customHttpHeaders": null,
  "customPayload": null,
  "successHttpResponseCodes": ["200", "204"],
  "regions": ["eu-west-1"],
  "emails": ["oncall@example.com"]
}

5. UpdateMonitorAsync

Update an existing monitor configuration. Same fields as SaveMonitorConfigurationRequest plus itemId.

Task<BaseApiResponse> UpdateMonitorAsync(UpdateMonitorConfigurationRequest request);

Sample body (UpdateMonitorConfigurationRequest):

{
  "itemId": "66f1c2b9e8d4a712d4c5e1f0",
  "projectKey": "A8D3007A36F840DCAFDE6F4AE68EE897",
  "repoId": "repo-123",
  "repoName": "blocks-logic",
  "name": "Logic API health",
  "url": "https://dev-logic.blocksdevelopers.com/health",
  "monitorType": "Http",
  "protocolType": "Https",
  "httpMethodType": "GET",
  "authorizationType": "None",
  "intervalInSeconds": 120,
  "timeoutInSeconds": 15,
  "isActive": true,
  "monitorSourceType": "DeployedServices",
  "expectedContent": "OK",
  "successHttpResponseCodes": ["200"],
  "regions": ["eu-west-1", "us-east-1"],
  "emails": ["oncall@example.com"]
}

6. DeleteMonitorAsync

Delete a monitor configuration by id.

Task<BaseApiResponse> DeleteMonitorAsync(string itemId);
  • Query string: ?itemId=66f1c2b9e8d4a712d4c5e1f0

7. GetIncidentListAsync

Paginated incident history for a monitor.

Task<PaginatedResponse> GetIncidentListAsync(string monitorId, int pageNumber = 0, int pageSize = 10);
  • Query string: ?monitorId=66f1c2b9e8d4a712d4c5e1f0&pageNumber=0&pageSize=10

8. GetMonitorDetailsAsync

Aggregated incident duration / details for a monitor.

Task<MonitorDetailsResponse> GetMonitorDetailsAsync(string monitorId);
  • Query string: ?monitorId=66f1c2b9e8d4a712d4c5e1f0

9. GetMonitorResponseTimeAsync

Response-time ping log for a monitor over an optional date range. Dates accept ISO 8601 strings.

Task<BaseApiResponse> GetMonitorResponseTimeAsync(string monitorId, string? startDate, string? endDate);
  • Query string: ?monitorId=66f1c2b9e8d4a712d4c5e1f0&startDate=2026-05-01T00:00:00Z&endDate=2026-05-11T23:59:59Z

10. GetMonitorDownTimeAsync

Downtime log for a monitor over an optional date range.

Task<BaseApiResponse> GetMonitorDownTimeAsync(string monitorId, string? startDate, string? endDate);
  • Query string: ?monitorId=66f1c2b9e8d4a712d4c5e1f0&startDate=2026-05-01T00:00:00Z&endDate=2026-05-11T23:59:59Z

11. IsExternalServiceConfiguredAsync

Returns the monitor configuration tied to a given external service id, wrapped in BaseApiResponse. Data is null when no monitor exists.

Task<BaseApiResponse> IsExternalServiceConfiguredAsync(string externalServiceId);
  • Query string: ?externalServiceId=ext-service-9d1
  • Sample response:
{
  "data": {
    "itemId": "66f1c2b9e8d4a712d4c5e1f0",
    "projectKey": "A8D3007A36F840DCAFDE6F4AE68EE897",
    "externalServiceId": "ext-service-9d1",
    "isActive": true
  },
  "message": null,
  "statusCode": 0,
  "isSuccess": true
}

12. SaveHealthAsync

Create a new health check configuration.

Task<BaseApiResponse> SaveHealthAsync(SaveHealthConfigurationRequest request);

Sample body (SaveHealthConfigurationRequest):

{
  "projectKey": "A8D3007A36F840DCAFDE6F4AE68EE897",
  "name": "Logic API heartbeat",
  "repoId": "repo-123",
  "repoName": "blocks-logic",
  "externalServiceId": null,
  "isActive": true,
  "intervalInSeconds": 60,
  "gracePeriodInSeconds": 30,
  "monitorSourceType": "DeployedServices",
  "emails": ["oncall@example.com"]
}

13. UpdateHealthAsync

Update an existing health configuration. Same fields as SaveHealthConfigurationRequest plus itemId.

Task<BaseApiResponse> UpdateHealthAsync(UpdateHealthConfigurationRequest request);

Sample body (UpdateHealthConfigurationRequest):

{
  "itemId": "66f1c2b9e8d4a712d4c5e1f0",
  "projectKey": "A8D3007A36F840DCAFDE6F4AE68EE897",
  "name": "Logic API heartbeat",
  "repoId": "repo-123",
  "repoName": "blocks-logic",
  "externalServiceId": null,
  "isActive": true,
  "intervalInSeconds": 120,
  "gracePeriodInSeconds": 60,
  "monitorSourceType": "DeployedServices",
  "emails": ["oncall@example.com"]
}

14. HandlePingAsync

Record a heartbeat ping for a configured health check. Returns Task (no body).

Task HandlePingAsync(string itemId);
  • Path/route param: itemId
  • Sample call: GET /Health/Ping/66f1c2b9e8d4a712d4c5e1f0

15. DeleteHealthAsync

Delete a health configuration by id. Internally routed through the monitor configuration service (same as the original controller).

Task<BaseApiResponse> DeleteHealthAsync(string itemId);
  • Query string: ?itemId=66f1c2b9e8d4a712d4c5e1f0

Response shapes

BaseApiResponse (from DomainService.Shared.Models)

{
  "data": { },
  "message": "string",
  "statusCode": 200,
  "isSuccess": true
}

PaginatedResponse (from DomainService.Shared.Models)

Standard pagination envelope used by GetMonitorList and GetIncidentList.

{
  "items": [ ],
  "totalCount": 0,
  "pageNumber": 0,
  "pageSize": 10
}

MonitorDetailsResponse (from DomainService.Monitor.Models)

Incident-duration aggregation for a single monitor, returned by GetMonitorDetailsAsync.


Authorization

The original controllers decorate every action with [Authorize] (except Ping, which is public so external probes can hit it). The driver itself does not enforce auth — that's the consumer's controller's responsibility. Apply [Authorize] on the controller methods that wrap each driver call, exactly as the source controllers do.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SeliseBlocks.ObservabilityDriver:

Package Downloads
BlocksLogic

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.0-preview.2 303 5/21/2026
9.0.0-preview.1 78 5/11/2026