|
3 | 3 |
|
4 | 4 | using System.Diagnostics.Tracing;
|
5 | 5 | using Microsoft.Extensions.Configuration;
|
| 6 | +using OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ExportClient.Grpc; |
6 | 7 | using OpenTelemetry.Internal;
|
7 | 8 |
|
8 | 9 | namespace OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation;
|
@@ -92,6 +93,15 @@ public void GrpcRetryDelayParsingFailed(string? grpcStatusDetailsHeader, Excepti
|
92 | 93 | {
|
93 | 94 | this.GrpcRetryDelayParsingFailed(grpcStatusDetailsHeader ?? "null", ex.ToInvariantString());
|
94 | 95 | }
|
| 96 | + } |
| 97 | + |
| 98 | + [NonEvent] |
| 99 | + public void ExportFailure(string endpoint, string message, Status status) |
| 100 | + { |
| 101 | + if (Log.IsEnabled(EventLevel.Error, EventKeywords.All)) |
| 102 | + { |
| 103 | + this.ExportFailure(endpoint, message, status.StatusCode.ToString(), status.Detail); |
| 104 | + } |
95 | 105 | }
|
96 | 106 |
|
97 | 107 | [Event(2, Message = "Exporter failed send data to collector to {0} endpoint. Data will not be sent. Exception: {1}", Level = EventLevel.Error)]
|
@@ -206,12 +216,12 @@ public void ExportSuccess(string endpoint, string message)
|
206 | 216 | public void GrpcStatusWarning(string endpoint, string statusCode)
|
207 | 217 | {
|
208 | 218 | this.WriteEvent(22, endpoint, statusCode);
|
209 |
| - } |
| 219 | + } |
210 | 220 |
|
211 |
| - [Event(23, Message = "Export failed for {0}. Message: {1}. Status code: {2}", Level = EventLevel.Error)] |
212 |
| - public void ExportFailure(string endpoint, string message, string statusCode) |
| 221 | + [Event(23, Message = "Export failed for {0}. Message: {1}. Status Code: {2}. Detail: {3}.", Level = EventLevel.Error)] |
| 222 | + public void ExportFailure(string endpoint, string message, string statusCode, string detail) |
213 | 223 | {
|
214 |
| - this.WriteEvent(23, endpoint, message, statusCode); |
| 224 | + this.WriteEvent(23, endpoint, message, statusCode, detail); |
215 | 225 | }
|
216 | 226 |
|
217 | 227 | [Event(24, Message = "Failed to parse gRPC retry delay from header grpcStatusDetailsHeader: '{0}'. Exception: {1}", Level = EventLevel.Warning)]
|
|
0 commit comments