Skip to content

Implement Health Checks for Activity Service #139

@willvelida

Description

@willvelida

Parent Issue

Part of #119 - Implement Custom Health Probes and Dependency Health Checks

Overview

Apply the proven health check pattern from #136 (Weight API) to the Activity Service (background worker).

Scope

  • src/Biotrackr.Activity.Svc/
  • infra/apps/activity-service/main.bicep

Tasks

1. Install Health Check Packages

Add to Biotrackr.Activity.Svc.csproj:

<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.CosmosDb" Version="8.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.AzureKeyVault" Version="8.0.1" />

2. Implement Health Check Endpoints

Apply proven pattern from #136:

  • Health checks for self, Cosmos DB (lightweight), Key Vault
  • Reuse FitbitApiHealthCheck implementation
  • Configure /health/live, /health/ready, /health/startup endpoints

3. Update Bicep Configuration

Update infra/apps/activity-service/main.bicep:

  • Apply same probe configuration as Weight Service

4. Add Integration Tests

  • Verify health endpoints return correct status codes
  • Test dependency failure scenarios

Acceptance Criteria

  • Health check packages installed
  • /health/live, /health/ready, /health/startup endpoints implemented
  • Cosmos DB, Key Vault, Fitbit API health checks configured
  • Bicep probe configuration updated
  • Integration tests pass
  • Deployed to dev environment and validated

Dependencies

References

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions