Skip to content

Commit 1d3ac11

Browse files
[Exporter.Geneva] Add logging for successful exports (open-telemetry#1805)
Co-authored-by: Cijo Thomas <[email protected]> Co-authored-by: Cijo Thomas <[email protected]>
1 parent e0121e9 commit 1d3ac11

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/OpenTelemetry.Exporter.Geneva/Internal/ExporterEventSource.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ internal sealed class ExporterEventSource : EventSource
1616
private const int EVENT_ID_METRIC = 3; // Failed to send Metric
1717
private const int EVENT_ID_ERROR = 4; // Other common exporter exceptions
1818
private const int EVENT_ID_OTLP_PROTOBUF_METRIC = 5; // Failed to serialize metric
19+
private const int EVENT_ID_COMPLETED_EXPORT = 6; // Completed export
1920

2021
[NonEvent]
2122
public void FailedToSendTraceData(Exception ex)
@@ -103,4 +104,10 @@ public void FailedToSerializeMetric(string metricName, string error)
103104
{
104105
this.WriteEvent(EVENT_ID_OTLP_PROTOBUF_METRIC, metricName, error);
105106
}
107+
108+
[Event(EVENT_ID_COMPLETED_EXPORT, Message = "'{0}' completed data export.", Level = EventLevel.Informational)]
109+
public void ExportCompleted(string exporterName)
110+
{
111+
this.WriteEvent(EVENT_ID_COMPLETED_EXPORT, exporterName);
112+
}
106113
}

src/OpenTelemetry.Exporter.Geneva/MsgPackExporter/MsgPackLogExporter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ public ExportResult Export(in Batch<LogRecord> batch)
133133
}
134134
}
135135

136+
ExporterEventSource.Log.ExportCompleted(nameof(MsgPackLogExporter));
137+
136138
return result;
137139
}
138140

src/OpenTelemetry.Exporter.Geneva/MsgPackExporter/MsgPackTraceExporter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ public ExportResult Export(in Batch<Activity> batch)
166166
}
167167
}
168168

169+
ExporterEventSource.Log.ExportCompleted(nameof(MsgPackTraceExporter));
170+
169171
return result;
170172
}
171173

0 commit comments

Comments
 (0)