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
Copy file name to clipboardExpand all lines: Expecto.Tests/OpenTelemetry.fs
+41-9Lines changed: 41 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,38 @@ module OpenTelemetry =
4
4
openSystem
5
5
openSystem.Diagnostics
6
6
openSystem.Collections.Generic
7
-
openSystem.Threading
8
7
openImpl
9
-
8
+
openSystem.Runtime.CompilerServices
9
+
typeActivitywith
10
+
/// <summary>Sets code semantic conventions for <c>code.function.name</c>, <c>code.filepath</c>, and <c>code.lineno</c> </summary>
11
+
/// <paramname="name_space">Optional: The current namespace. Will default to using <c>Reflection.MethodBase.GetCurrentMethod().DeclaringType</c></param>
12
+
/// <paramname="memberName">Optional: The current function Don't set this. This uses <c>CallerMemberName.</c></param>
13
+
/// <paramname="path">Optional: The current filepath. Don't set this. This uses <c>CallerFilePath.</c></param>
14
+
/// <paramname="line">Optional: The current line number. Don't set this. This uses <c>CallerLineNumber.</c></param>
15
+
member inlinex.SetSource(
16
+
?nameSpace :string,
17
+
[<CallerMemberName>]?memberName:string,
18
+
[<CallerFilePath>]?path:string,
19
+
[<CallerLineNumber>]?line:int)=
20
+
ifnot(isNull x)then
21
+
if x.GetTagItem "code.function.name"=nullthen
22
+
letnameSpace=
23
+
nameSpace
24
+
|> Option.defaultWith (fun()->
25
+
Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName.Split("+")// F# has + in type names that refer to anonymous functions, we typically want the first named type
0 commit comments