Skip to content

Commit 4f83e23

Browse files
committed
Set error.type attribute on failure spans
The semantic conventions mark error.type as Conditionally Required on failure. For FbException, use the SQLSTATE code; for other exceptions, use the full exception type name.
1 parent 4781900 commit 4f83e23

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/FirebirdSql.Data.FirebirdClient/Trace/FbActivitySource.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ internal static void CommandException(Activity activity, Exception exception, bo
128128
? fbException.SQLSTATE
129129
: exception.Message;
130130

131+
activity.SetTag("error.type", exception is FbException fbEx
132+
? fbEx.SQLSTATE ?? exception.GetType().FullName
133+
: exception.GetType().FullName);
134+
131135
activity.SetStatus(ActivityStatusCode.Error, errorDescription);
132136
activity.Dispose();
133137
}

0 commit comments

Comments
 (0)