aaronontheweb avatar

Aspire Service Defaults

Sets up a shared ServiceDefaults project for .NET Aspire apps, which is the standard pattern for centralizing cross-cutting concerns. You get OpenTelemetry (logging, tracing, metrics), health checks with separate readiness and liveness endpoints, service discovery, and HTTP resilience policies all wired up in one AddServiceDefaults() call. Every service in your Aspire app references this project instead of duplicating the same observability boilerplate. The implementation is straightforward: excludes health check endpoints from traces, configures OTLP export when available, and adds standard resilience handlers to all HttpClients. Health endpoints only expose in development by default, which is sensible. If you're building anything beyond a single-service Aspire app, you want this.

skills.sh installs
497
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add aaronontheweb/dotnet-skills --skill aspire-service-defaults --agent claude-code

Installs into .claude/skills of the current project.

Files

Aspire Service Defaults

When to Use This Skill

Use this skill when:

  • Building Aspire-based distributed applications
  • Need consistent observability (logging, tracing, metrics) across services
  • Want shared health check configuration
  • Configuring HttpClient resilience and service discovery

What is ServiceDefaults?

ServiceDefaults is a shared project that provides common configuration for all services in an Aspire application:

  • OpenTelemetry - Logging, tracing, and metrics
  • Health Checks - Readiness and liveness endpoints
  • Service Discovery - Automatic service resolution
  • HTTP Resilience - Retry and circuit breaker policies

Every service references this project and calls AddServiceDefaults().


Project Structure

src/
  MyApp.ServiceDefaults/
    Extensions.cs
    MyApp.ServiceDefaults.csproj
  MyApp.Api/
    Program.cs  # Calls AddServiceDefaults()
  MyApp.Worker/
    Program.cs  # Calls AddServiceDefaults()
  MyApp.AppHost/
    Program.cs

ServiceDefaults Project

Project File

Sponsors

Details

Repository
github.com/aaronontheweb/dotnet-skills
Categories
Sales & Marketing, .NET & C#
First seen
Jun 3, 2026

More from aaronontheweb/dotnet-skills

All 34
1evoscientist avatarresearch-ideationevoscientist/evoskillsEnd-to-end research ideation pipeline: literature grounding → multi-track idea generation (3 personas: innovator/pragmatist/critic) → iterative refinement → ELO497skills.sh installs
2longbridge avatarlongbridge-competitive-analysislongbridge/skillsCompetitive landscape analysis — builds a competitive structure research framework covering market positioning (Porter five-forces), peer cross-comparison (PE/P497skills.sh installs
3longbridge avatarlongbridge-business-querylongbridge/skillsMain business composition and operating data — revenue breakdown by segment, gross margin by business line, and operating metrics (ROE / ROA / ROIC / working ca496skills.sh installs
4longbridge avatarlongbridge-company-tearsheetlongbridge/skillsCompany tear sheet / one-pager via Longbridge Securities — generates a high-density 1–2 page company snapshot: business overview, key financials (revenue / net 495skills.sh installs
5longbridge avatarlongbridge-insresearchlongbridge/skillsInstitutional research and analyst ratings — buy/hold/sell distribution, consensus price target, EPS/revenue forecasts, and rating change history. ESG and credi495skills.sh installs
6longbridge avatarlongbridge-finance-querylongbridge/skillsCross-market financial metrics batch query — revenue, net profit, ROE, debt ratio, free cash flow, gross margin for one or more symbols across HK / US / A-share494skills.sh installs