Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional logging for ODD notifications #38

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public TargetDeliveryResponse ExecuteRequest(TargetDeliveryRequest deliveryReque
var ruleSet = this.ruleLoader.GetLatestRules();
if (ruleSet == null)
{
TargetClient.Logger?.LogWarning("Decisioning rules not loaded, returning empty response");
var deliveryResponse = new DeliveryResponse(
(int)HttpStatusCode.ServiceUnavailable,
deliveryRequest.DeliveryRequest.RequestId,
Expand Down Expand Up @@ -203,11 +204,16 @@ private void HandleDetails(

private void SendNotifications(TargetDeliveryRequest request, TargetDeliveryResponse targetResponse, List<Notification> notifications, TelemetryEntry telemetryEntry)
{
TargetClient.Logger?.LogDebug("Sending notifications for requestId: {requestId} sessionId: {sessionId}", request.DeliveryRequest.RequestId, request.SessionId);

if (notifications.Count == 0 && telemetryEntry == null)
{
TargetClient.Logger?.LogDebug("No notifications to send");
return;
}

TargetClient.Logger?.LogDebug("Notifications: {notifications}", string.Join(", ", notifications));

var deliveryRequest = request.DeliveryRequest;
var locationHint = request.LocationHint ?? this.clusterLocator.GetLocationHint();
var telemetry = telemetryEntry != null ? new Telemetry(new List<TelemetryEntry> { telemetryEntry }) : null;
Expand Down
1 change: 1 addition & 0 deletions Source/Adobe.Target.Client/Service/TargetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ private TargetDeliveryResponse GetTargetDeliveryResponse(TargetDeliveryRequest r
{
if (response == null)
{
this.logger?.LogWarning("Null response for requestId: {requestId}, sessionId: {sessionId}", request.DeliveryRequest.RequestId, request.SessionId);
return new TargetDeliveryResponse(request, null, HttpStatusCode.ServiceUnavailable);
}

Expand Down
Loading