File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 502502 </ItemGroup >
503503
504504 <ItemGroup >
505+ <PackageReference Include =" OpenTelemetry.Exporter.OpenTelemetryProtocol" Version =" 1.1.0" />
506+ <PackageReference Include =" OpenTelemetry.Exporter.Zipkin" Version =" 1.1.0" />
505507 <PackageReference Include =" System.Runtime.Loader" Version =" $(SystemRuntimeLoaderVersion)" />
506508 <PackageReference Include =" System.Collections.Immutable" Version =" $(SystemCollectionsImmutableVersion)" />
507509 <PackageReference Include =" System.Diagnostics.DiagnosticSource" Version =" $(SystemdiagnosticsDiagnosticSourceVersion)" />
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ open FSharp.Compiler.Text
3535open FSharp.Compiler .Text .Range
3636open FSharp.Compiler .TcGlobals
3737open FSharp.Compiler .BuildGraph
38+ open OpenTelemetry
39+ open OpenTelemetry.Resources
3840
3941[<AutoOpen>]
4042module EnvMisc =
@@ -1199,6 +1201,27 @@ type BackgroundCompiler
11991201
12001202 static member ActualCheckFileCount = actualCheckFileCount
12011203
1204+ module Foo =
1205+ open FSharp.Compiler .Diagnostics .Activity
1206+ open OpenTelemetry.Trace
1207+
1208+ let init () =
1209+ use tracerProvider =
1210+ Sdk.CreateTracerProviderBuilder()
1211+ .AddSource( activitySourceName)
1212+ .SetResourceBuilder( ResourceBuilder.CreateDefault() .AddService( serviceName = " fsc" , serviceVersion = " 42.42.42.42" ))
1213+ .AddOtlpExporter()
1214+ .AddZipkinExporter()
1215+ .Build();
1216+ use mainActivity = activitySource.StartActivity( " main" )
1217+
1218+ let forceCleanup () =
1219+ mainActivity.Dispose()
1220+ activitySource.Dispose()
1221+ tracerProvider.Dispose()
1222+
1223+ forceCleanup
1224+
12021225[<Sealed; AutoSerializable( false ) >]
12031226// There is typically only one instance of this type in an IDE process.
12041227type FSharpChecker
@@ -1226,6 +1249,8 @@ type FSharpChecker
12261249 enableBackgroundItemKeyStoreAndSemanticClassification,
12271250 enablePartialTypeChecking
12281251 )
1252+
1253+ do Foo.init() |> ignore
12291254
12301255 static let globalInstance = lazy FSharpChecker.Create()
12311256
Original file line number Diff line number Diff line change 22<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
33<Project Sdk =" Microsoft.NET.Sdk" >
44
5- <PropertyGroup >
6- <TargetFrameworks Condition =" '$(ProtoTargetFramework)' != ''" >$(ProtoTargetFramework)</TargetFrameworks >
7- <TargetFrameworks Condition =" '$(ProtoTargetFramework)' == ''" >net6.0;net472;</TargetFrameworks >
8- <TargetFrameworks Condition =" '$(OS)' == 'Unix'" >net6.0</TargetFrameworks >
95 <PropertyGroup Condition =" '$(BUILD_PROTO)' != 'true'" >
106 <TargetFrameworks Condition =" '$(OS)' != 'Unix'" >net472;net7.0</TargetFrameworks >
117 <TargetFrameworks Condition =" '$(OS)' == 'Unix'" >net7.0</TargetFrameworks >
You can’t perform that action at this time.
0 commit comments