diff --git a/server/routerlicious/packages/services-telemetry/src/resources.ts b/server/routerlicious/packages/services-telemetry/src/resources.ts index ef6ec065350..2d6ce15852d 100644 --- a/server/routerlicious/packages/services-telemetry/src/resources.ts +++ b/server/routerlicious/packages/services-telemetry/src/resources.ts @@ -69,6 +69,7 @@ export enum HttpProperties { responseFinishToCloseLatencyMs = "responseFinishToCloseLatencyMs", status = "status", url = "url", + retryCount = "retryCount", } /** diff --git a/server/routerlicious/packages/services-utils/src/morganLoggerMiddleware.ts b/server/routerlicious/packages/services-utils/src/morganLoggerMiddleware.ts index e19b7633861..de407f642a1 100644 --- a/server/routerlicious/packages/services-utils/src/morganLoggerMiddleware.ts +++ b/server/routerlicious/packages/services-utils/src/morganLoggerMiddleware.ts @@ -120,6 +120,10 @@ export function jsonMorganLoggerMiddleware( [BaseTelemetryProperties.correlationId]: getCorrelationIdWithHttpFallback(req, res), [CommonProperties.serviceName]: serviceName, [CommonProperties.telemetryGroupName]: "http_requests", + [HttpProperties.retryCount]: Number.parseInt( + typeof req.query.retry === "string" ? req.query.retry : "0", + 10, + ), ...additionalProperties, ...getTelemetryContextPropertiesWithHttpInfo(req, res), };