Skip to content

Commit b8087ca

Browse files
authored
Exclude /admin/health subpaths from otel (#11499)
1 parent f1e7275 commit b8087ca

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private HealthReport MergeReports(HealthReport left, HealthReport? right)
104104

105105
private static partial class Log
106106
{
107-
[LoggerMessage(0, LogLevel.Debug, "Script host does not have a health check service. Skipping script host health checks.")]
107+
[LoggerMessage(0, LogLevel.Trace, "Script host does not have a health check service. Skipping script host health checks.")]
108108
public static partial void ScriptHostNoHealthCheckService(ILogger logger);
109109

110110
[LoggerMessage(1, LogLevel.Warning, "Duplicate health check entry '{HealthCheck}' found when merging health check reports. Keeping the first entry.")]

src/WebJobs.Script/Diagnostics/OpenTelemetry/OpenTelemetryConfigurationExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,23 +138,23 @@ private static IOpenTelemetryBuilder ConfigureTracing(this IOpenTelemetryBuilder
138138
return false;
139139
}
140140

141-
// Exclude GET admin/warmup
141+
// Exclude GET /admin/warmup
142142
if (string.Equals(context.Request.Method, HttpMethods.Get, StringComparison.OrdinalIgnoreCase)
143143
&& context.Request.Path.Equals("/admin/warmup", StringComparison.OrdinalIgnoreCase))
144144
{
145145
return false;
146146
}
147147

148-
// Exclude GET admin/host/status
148+
// Exclude GET /admin/host/status
149149
if (string.Equals(context.Request.Method, HttpMethods.Get, StringComparison.OrdinalIgnoreCase)
150150
&& context.Request.Path.Equals("/admin/host/status", StringComparison.OrdinalIgnoreCase))
151151
{
152152
return false;
153153
}
154154

155-
// Exclude GET /admin/health
155+
// Exclude GET /admin/health and its sub-paths
156156
if (string.Equals(context.Request.Method, HttpMethods.Get, StringComparison.OrdinalIgnoreCase)
157-
&& context.Request.Path.Equals("/admin/health", StringComparison.OrdinalIgnoreCase))
157+
&& context.Request.Path.StartsWithSegments("/admin/health", StringComparison.OrdinalIgnoreCase))
158158
{
159159
return false;
160160
}

0 commit comments

Comments
 (0)