Customize HealthCheck for ExternalServiceResource
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 201
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
I would like to customize the HttpHeaders being used in the HttpHealthCheck for an ExternalServiceResource.
In my scenario, I need to set a user-agent string. I could envision other folks needing to set an API key in a header
### Describe the solution you'd like
Allow a collection of key-value pairs to be passed in to the `WithHttpHealthChecks` method that represent the additional HTTP header key-value pairs
### Additional context
I'm working with the US National Weather Service REST API and they require a user-agent to be set in order to interact with their API. I've got this configured in my HttpClient registration in the web application, but this header is also needed to support a health check against their API
Contributor guide
Research direction
Start by locating ExternalServiceResource, WithHttpHealthChecks, and HttpHealthCheck in the Aspire source. Trace how health-check options are passed into the HTTP request, then add coverage for custom key-value headers and confirm that the configured headers are sent during the health check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100