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

[OTLP] include status code in failure log #6154

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -93,7 +93,7 @@ public override ExportClientResponse SendExportRequest(byte[] buffer, int conten
grpcStatusDetailsHeader = GrpcProtocolHelpers.GetHeaderValue(trailingHeaders, GrpcStatusDetailsHeader);
}

OpenTelemetryProtocolExporterEventSource.Log.ExportFailure(this.Endpoint.ToString(), "Export failed due to unexpected status code.");
OpenTelemetryProtocolExporterEventSource.Log.ExportFailure(this.Endpoint.ToString(), "Export failed due to unexpected status code.", (int)status.StatusCode);

return new ExportClientGrpcResponse(
success: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ public void GrpcStatusWarning(string endpoint, string statusCode)
this.WriteEvent(22, endpoint, statusCode);
}

[Event(23, Message = "Export failed for {0}. Message: {1}", Level = EventLevel.Error)]
public void ExportFailure(string endpoint, string message)
[Event(23, Message = "Export failed for {0}. Message: {1}. Status code: {2}", Level = EventLevel.Error)]
public void ExportFailure(string endpoint, string message, int statusCode)
{
this.WriteEvent(23, endpoint, message);
this.WriteEvent(23, endpoint, message, statusCode);
}

[Event(24, Message = "Failed to parse gRPC retry delay from header grpcStatusDetailsHeader: '{0}'. Exception: {1}", Level = EventLevel.Warning)]
Expand Down
Loading