You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With an Activity that includes an ActivityLink without any tags, the console exporter throws a NullReferenceException when stopping/disposing the Activity.
What is the expected behavior?
The console output shows all activity information including the "Resource associated with Activity".
What is the actual behavior?
The link is included in the output, but not the "Resource associated with Activity" afterwards. A NullReferenceException is thrown, which is caught by the SDK and included in the diagnostics log:
2022-11-03T15:44:00.6954123Z:Unknown error in SpanProcessor event '{0}': '{1}'.{OnExport}{System.NullReferenceException: Object reference not set to an instance of an object.
at OpenTelemetry.Exporter.ConsoleActivityExporter.Export(Batch`1& batch)
at OpenTelemetry.SimpleExportProcessor`1.OnExport(T data)}
Visual Studio breaks for the exception by default, but execution can be resumed (this is configurable).
The problem is in ConsoleActivityExporter.cs where it has a foreach to enumerate the tags without first checking for null. In the same file, it looks like it may also have an issue with events that don't have any tags, but I haven't testing that case. The code should probably switch to using activityLink.EnumerateTags() (like in #3580).
The text was updated successfully, but these errors were encountered:
Bug Report
Symptom
With an
Activity
that includes anActivityLink
without any tags, the console exporter throws aNullReferenceException
when stopping/disposing theActivity
.What is the expected behavior?
The console output shows all activity information including the "Resource associated with Activity".
What is the actual behavior?
The link is included in the output, but not the "Resource associated with Activity" afterwards. A
NullReferenceException
is thrown, which is caught by the SDK and included in the diagnostics log:Visual Studio breaks for the exception by default, but execution can be resumed (this is configurable).
Reproduce
Additional Context
The problem is in ConsoleActivityExporter.cs where it has a
foreach
to enumerate the tags without first checking fornull
. In the same file, it looks like it may also have an issue with events that don't have any tags, but I haven't testing that case. The code should probably switch to usingactivityLink.EnumerateTags()
(like in #3580).The text was updated successfully, but these errors were encountered: