log retry count from client request (#21827)

This PR is to log retry param from service call made by the driver in
server side. There will be another PR to logs retry for downstream
request.

---------

Co-authored-by: Lin Lin <linlin1@microsoft.com>
This commit is contained in:
Lin Lin 2024-07-16 14:01:32 -07:00 коммит произвёл GitHub
Родитель bd32470c70
Коммит 98e991c61f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -69,6 +69,7 @@ export enum HttpProperties {
responseFinishToCloseLatencyMs = "responseFinishToCloseLatencyMs", responseFinishToCloseLatencyMs = "responseFinishToCloseLatencyMs",
status = "status", status = "status",
url = "url", url = "url",
retryCount = "retryCount",
} }
/** /**

Просмотреть файл

@ -120,6 +120,10 @@ export function jsonMorganLoggerMiddleware(
[BaseTelemetryProperties.correlationId]: getCorrelationIdWithHttpFallback(req, res), [BaseTelemetryProperties.correlationId]: getCorrelationIdWithHttpFallback(req, res),
[CommonProperties.serviceName]: serviceName, [CommonProperties.serviceName]: serviceName,
[CommonProperties.telemetryGroupName]: "http_requests", [CommonProperties.telemetryGroupName]: "http_requests",
[HttpProperties.retryCount]: Number.parseInt(
typeof req.query.retry === "string" ? req.query.retry : "0",
10,
),
...additionalProperties, ...additionalProperties,
...getTelemetryContextPropertiesWithHttpInfo(req, res), ...getTelemetryContextPropertiesWithHttpInfo(req, res),
}; };