|
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;
|
@@ -94,6 +95,15 @@ public void GrpcRetryDelayParsingFailed(string? grpcStatusDetailsHeader, Excepti
|
94 | 95 | }
|
95 | 96 | }
|
96 | 97 |
|
| 98 | + [NonEvent] |
| 99 | + public void ExportFailure(Uri endpoint, string message, Status status) |
| 100 | + { |
| 101 | + if (Log.IsEnabled(EventLevel.Error, EventKeywords.All)) |
| 102 | + { |
| 103 | + this.ExportFailure(endpoint.ToString(), message, status.ToString()); |
| 104 | + } |
| 105 | + } |
| 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)]
|
98 | 108 | public void FailedToReachCollector(string rawCollectorUri, string ex)
|
99 | 109 | {
|
@@ -208,10 +218,10 @@ public void GrpcStatusWarning(string endpoint, string statusCode)
|
208 | 218 | this.WriteEvent(22, endpoint, statusCode);
|
209 | 219 | }
|
210 | 220 |
|
211 |
| - [Event(23, Message = "Export failed for {0}. Message: {1}", Level = EventLevel.Error)] |
212 |
| - public void ExportFailure(string endpoint, string message) |
| 221 | + [Event(23, Message = "Export failed for {0}. Message: {1}. {2}.", Level = EventLevel.Error)] |
| 222 | + public void ExportFailure(string endpoint, string message, string statusString) |
213 | 223 | {
|
214 |
| - this.WriteEvent(23, endpoint, message); |
| 224 | + this.WriteEvent(23, endpoint, message, statusString); |
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