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

Log dropped telemetry item count on shutdown #2331

Merged
merged 17 commits into from
Sep 21, 2021
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
Prev Previous commit
Next Next commit
Use GetType().Name
  • Loading branch information
mic-max committed Sep 20, 2021
commit a4935a0f8bacd5127f7d1e859bbfac0023f913c4
2 changes: 1 addition & 1 deletion src/OpenTelemetry/BatchExportProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ protected override bool OnShutdown(int timeoutMilliseconds)
this.shutdownDrainTarget = this.circularBuffer.AddedCount;
this.shutdownTrigger.Set();

OpenTelemetrySdkEventSource.Log.DroppedExportProcessorItems(nameof(BatchExportProcessor<T>), typeof(T).Name, this.exporter.GetType().Name, this.droppedCount);
OpenTelemetrySdkEventSource.Log.DroppedExportProcessorItems(this.GetType().Name, this.exporter.GetType().Name, this.droppedCount);

if (timeoutMilliseconds == Timeout.Infinite)
{
Expand Down
16 changes: 8 additions & 8 deletions src/OpenTelemetry/Internal/OpenTelemetrySdkEventSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,20 @@ public void MissingPermissionsToReadEnvironmentVariable(SecurityException ex)
}

[NonEvent]
public void DroppedExportProcessorItems(string exportProcessorName, string itemName, string exporterName, long droppedCount)
public void DroppedExportProcessorItems(string exportProcessorName, string exporterName, long droppedCount)
{
if (droppedCount > 0)
{
if (this.IsEnabled(EventLevel.Warning, EventKeywords.All))
{
this.ExistsDroppedExportProcessorItems(exportProcessorName, itemName, exporterName, droppedCount);
this.ExistsDroppedExportProcessorItems(exportProcessorName, exporterName, droppedCount);
}
}
else
{
if (this.IsEnabled(EventLevel.Informational, EventKeywords.All))
{
this.NoDroppedExportProcessorItems(exportProcessorName, itemName, exporterName);
this.NoDroppedExportProcessorItems(exportProcessorName, exporterName);
}
}
}
Expand Down Expand Up @@ -328,16 +328,16 @@ public void MissingPermissionsToReadEnvironmentVariable(string exception)
this.WriteEvent(30, exception);
}

[Event(31, Message = "'{0}<{1}>' exporting to '{2}' dropped '0' items.", Level = EventLevel.Informational)]
[Event(31, Message = "'{0}' exporting to '{1}' dropped '0' items.", Level = EventLevel.Informational)]
public void NoDroppedExportProcessorItems(string exportProcessorName, string itemName, string exporterName)
cijothomas marked this conversation as resolved.
Show resolved Hide resolved
{
this.WriteEvent(31, exportProcessorName, itemName, exporterName);
this.WriteEvent(31, exportProcessorName, exporterName);
}

[Event(32, Message = "'{0}<{1}>' exporting to '{2}' dropped '{3}' item(s) due to buffer full.", Level = EventLevel.Warning)]
public void ExistsDroppedExportProcessorItems(string exportProcessorName, string itemName, string exporterName, long droppedCount)
[Event(32, Message = "'{0}' exporting to '{1}' dropped '{2}' item(s) due to buffer full.", Level = EventLevel.Warning)]
public void ExistsDroppedExportProcessorItems(string exportProcessorName, string exporterName, long droppedCount)
{
this.WriteEvent(32, exportProcessorName, itemName, exporterName, droppedCount);
this.WriteEvent(32, exportProcessorName, exporterName, droppedCount);
}

#if DEBUG
Expand Down