Skip to content

Commit f7f9504

Browse files
committed
Add comments to HealthCheckData
1 parent aae0cde commit f7f9504

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

src/WebJobs.Script/Diagnostics/HealthChecks/HealthCheckData.cs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,59 @@ internal partial class HealthCheckData
1818
// exposed to the HealthCheckResult through IReadOnlyDictionary.
1919
private readonly Dictionary<string, object> _data = [];
2020

21-
public string Source
21+
/// <summary>
22+
/// Gets or sets the area of the health check data failure.
23+
/// </summary>
24+
/// <remarks>
25+
/// This is the area that has failed. Such as "configuration", "connectivity", etc.
26+
/// </remarks>
27+
public string Area
2228
{
2329
get => GetOrDefault<string>();
2430
set => Set(value);
2531
}
2632

33+
/// <summary>
34+
/// Gets or sets the configuration section related to the health check data.
35+
/// </summary>
36+
/// <remarks>
37+
/// Useful for when the component being checked is related to a specific configuration section.
38+
/// </remarks>
2739
public string ConfigurationSection
2840
{
2941
get => GetOrDefault<string>();
3042
set => Set(value);
3143
}
3244

45+
/// <summary>
46+
/// Gets or sets the status code related to the health check data.
47+
/// For HTTP related related checks, this is the HTTP status code.
48+
/// </summary>
3349
public int StatusCode
3450
{
3551
get => GetOrDefault<int>();
3652
set => Set(value);
3753
}
3854

55+
/// <summary>
56+
/// Gets or sets the error code related to the health check data.
57+
/// </summary>
58+
/// <remarks>
59+
/// For Azure SDK related checks, this is typically the RequestFailedException.ErrorCode value.
60+
/// </remarks>
3961
public string ErrorCode
4062
{
4163
get => GetOrDefault<string>();
4264
set => Set(value);
4365
}
4466

67+
/// <summary>
68+
/// Sets exception details into the health check data.
69+
/// </summary>
70+
/// <param name="ex">The exception to set details from.</param>
71+
/// <remarks>
72+
/// This will set various properties based on the type of exception.
73+
/// </remarks>
4574
public void SetExceptionDetails(Exception ex)
4675
{
4776
ArgumentNullException.ThrowIfNull(ex);

src/WebJobs.Script/Diagnostics/HealthChecks/WebJobsStorageHealthCheck.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private static HealthCheckData GetData(Exception ex, string source)
176176
{
177177
HealthCheckData data = new()
178178
{
179-
Source = source,
179+
Area = source,
180180
ConfigurationSection = ConfigSection,
181181
};
182182

0 commit comments

Comments
 (0)