Skip to content

Commit 37b7d3a

Browse files
OpenTelemetry proof of concept (#1060)
Co-authored-by: Chet Husk <[email protected]> Co-authored-by: Chet Husk <[email protected]>
1 parent 3e3cf83 commit 37b7d3a

File tree

13 files changed

+877
-187
lines changed

13 files changed

+877
-187
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Title>FsAutoComplete</Title>
55
<Product>FsAutoComplete</Product>
66
<PackageLicenseExpression Condition=" '$(PackAsTool)' != 'true' ">Apache-2.0</PackageLicenseExpression>
7-
<NoWarn>3186</NoWarn><!-- circumvent an error with the fake dependencymanager for paket: https://github.com/dotnet/fsharp/issues/8678 -->
7+
<NoWarn>3186,0042</NoWarn><!-- circumvent an error with the fake dependencymanager for paket: https://github.com/dotnet/fsharp/issues/8678 -->
88
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
99
<ChangelogFile>$(MSBuildThisFileDirectory)CHANGELOG.md</ChangelogFile>
1010
</PropertyGroup>

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,41 @@ This repository is prepared to use Gitpod for a web-based VSCode-style IDE. Clic
5454
* push this commit and tag to main
5555
* the CI pipeline will publish a release from the tag.
5656

57+
58+
## OpenTelemetry
59+
60+
FsAutocomplete is using [System.Diagnostics.Activity](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/distributed-tracing-instrumentation-walkthroughs) to create traces.
61+
62+
To export traces, run [Jaeger](https://www.jaegertracing.io/)
63+
64+
```bash
65+
docker run -d --name jaeger \
66+
-e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
67+
-e COLLECTOR_OTLP_ENABLED=true \
68+
-p 6831:6831/udp \
69+
-p 6832:6832/udp \
70+
-p 5778:5778 \
71+
-p 16686:16686 \
72+
-p 4317:4317 \
73+
-p 4318:4318 \
74+
-p 14250:14250 \
75+
-p 14268:14268 \
76+
-p 14269:14269 \
77+
-p 9411:9411 \
78+
jaegertracing/all-in-one:latest
79+
```
80+
Then configure your [environment](https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/)
81+
82+
```bash
83+
OTEL_EXPORTER_OTLP_ENDPOINT = "http://localhost:4317"
84+
```
85+
Start FsAutocomplete (either by `code .` or `dotnet fsautocomplete`)
86+
87+
Do some actions like opening documents, saving, getting tooltips, etc.
88+
89+
Then open `http://localhost:16686/` to inspect traces.
90+
91+
5792
## Communication protocol
5893

5994
FsAutoComplete supports [LSP](https://microsoft.github.io/language-server-protocol/) as a communication protocol.

paket.dependencies

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ source https://api.nuget.org/v3/index.json
88
#source: ./libs
99
storage: none
1010

11-
github TheAngryByrd/FsLibLog:f81cba440bf0476bb4e2262b57a067a0d6ab78a7 src/FsLibLog/FsLibLog.fs
11+
12+
github TheAngryByrd/FsLibLog:64f118ae8df2f2944ef69758052cb3b148b87e79 src/FsLibLog/FsLibLog.fs
13+
github TheAngryByrd/FsOpenTelemetry src/FsOpenTelemetry/FsOpenTelemetry.fs
1214

1315
nuget Fantomas.Client
1416
nuget FSharp.Compiler.Service
@@ -52,6 +54,7 @@ nuget AltCover
5254
nuget GitHubActionsTestLogger
5355
nuget Ionide.LanguageServerProtocol
5456
nuget Microsoft.Extensions.Caching.Memory
57+
nuget OpenTelemetry.Exporter.OpenTelemetryProtocol
5558

5659
group Build
5760
source https://api.nuget.org/v3/index.json

paket.lock

Lines changed: 82 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,21 @@ NUGET
3535
FSharp.Core (>= 6.0.1) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0))
3636
McMaster.NETCore.Plugins (>= 1.4) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0))
3737
FSharp.Compiler.Service (43.7.200)
38-
FSharp.Core (7.0)
38+
FSharp.Core (7.0.200)
3939
System.Buffers (>= 4.5.1)
4040
System.Collections.Immutable (>= 6.0)
41+
System.Diagnostics.DiagnosticSource (>= 6.0)
4142
System.Memory (>= 4.5.5)
4243
System.Reflection.Emit (>= 4.7)
4344
System.Reflection.Metadata (>= 6.0)
4445
System.Runtime.CompilerServices.Unsafe (>= 6.0)
4546
FSharp.Control.AsyncSeq (3.2.1)
4647
FSharp.Core (>= 4.7.2)
4748
Microsoft.Bcl.AsyncInterfaces (>= 5.0)
48-
FSharp.Control.Reactive (5.0.5) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0))
49+
FSharp.Control.Reactive (5.0.5) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
4950
FSharp.Core (>= 4.7.2)
5051
System.Reactive (>= 5.0 < 6.0)
51-
FSharp.Core (7.0) - content: none
52+
FSharp.Core (7.0.200) - content: none
5253
FSharp.Data.Adaptive (1.2.13)
5354
FSharp.Core (>= 4.7)
5455
System.Reflection.Emit.Lightweight (>= 4.6)
@@ -76,6 +77,21 @@ NUGET
7677
FSharp.Core (>= 4.7.2)
7778
GitHubActionsTestLogger (2.0.1)
7879
Microsoft.TestPlatform.ObjectModel (>= 17.2)
80+
Google.Protobuf (3.22)
81+
System.Memory (>= 4.5.3) - restriction: || (&& (== net6.0) (>= net45)) (&& (== net6.0) (< net5.0)) (&& (== net6.0) (< netstandard2.0)) (&& (== net7.0) (>= net45)) (&& (== net7.0) (< net5.0)) (&& (== net7.0) (< netstandard2.0)) (== netstandard2.0)
82+
System.Runtime.CompilerServices.Unsafe (>= 4.5.2) - restriction: || (&& (== net6.0) (< net5.0)) (&& (== net7.0) (< net5.0)) (== netstandard2.0)
83+
Grpc (2.46.6) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< netstandard2.1)) (== netstandard2.0)
84+
Grpc.Core (>= 2.46.6)
85+
Grpc.Core (2.46.6) - restriction: || (&& (== net6.0) (>= net45)) (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net45)) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< netstandard2.1)) (== netstandard2.0)
86+
Grpc.Core.Api (>= 2.46.6)
87+
System.Memory (>= 4.5.3)
88+
Grpc.Core.Api (2.51)
89+
System.Memory (>= 4.5.3)
90+
Grpc.Net.Client (2.51) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netstandard2.1))
91+
Grpc.Net.Common (>= 2.51)
92+
Microsoft.Extensions.Logging.Abstractions (>= 3.0.3)
93+
Grpc.Net.Common (2.51) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netstandard2.1))
94+
Grpc.Core.Api (>= 2.51)
7995
ICSharpCode.Decompiler (7.2.1.6856)
8096
Microsoft.Win32.Registry (>= 5.0)
8197
System.Collections.Immutable (>= 5.0)
@@ -85,25 +101,25 @@ NUGET
85101
FSharp.Core (>= 6.0)
86102
Newtonsoft.Json (>= 13.0.1)
87103
StreamJsonRpc (>= 2.10.44)
88-
Ionide.ProjInfo (0.61)
104+
Ionide.ProjInfo (0.61.2)
89105
FSharp.Core (>= 6.0.5) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
90-
Ionide.ProjInfo.Sln (>= 0.61) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
106+
Ionide.ProjInfo.Sln (>= 0.61.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
91107
Microsoft.Build (>= 17.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
92108
Microsoft.Build.Framework (>= 17.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
93109
SemanticVersioning (>= 2.0.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
94-
Ionide.ProjInfo.FCS (0.61)
95-
FSharp.Compiler.Service (>= 41.0.5 < 42.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
110+
Ionide.ProjInfo.FCS (0.61.2)
111+
FSharp.Compiler.Service (>= 41.0.5) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
96112
FSharp.Core (>= 6.0.5) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
97-
Ionide.ProjInfo (>= 0.61) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
98-
Ionide.ProjInfo.ProjectSystem (0.61)
99-
FSharp.Compiler.Service (>= 41.0.5 < 42.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
113+
Ionide.ProjInfo (>= 0.61.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
114+
Ionide.ProjInfo.ProjectSystem (0.61.2)
115+
FSharp.Compiler.Service (>= 41.0.5) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
100116
FSharp.Control.Reactive (>= 5.0.5) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
101117
FSharp.Core (>= 6.0.5) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
102-
Ionide.ProjInfo (>= 0.61) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
103-
Ionide.ProjInfo.FCS (>= 0.61) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
104-
Ionide.ProjInfo.Sln (>= 0.61) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
118+
Ionide.ProjInfo (>= 0.61.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
119+
Ionide.ProjInfo.FCS (>= 0.61.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
120+
Ionide.ProjInfo.Sln (>= 0.61.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
105121
Newtonsoft.Json (>= 13.0.1) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
106-
Ionide.ProjInfo.Sln (0.61)
122+
Ionide.ProjInfo.Sln (0.61.2)
107123
McMaster.NETCore.Plugins (1.4) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0))
108124
Microsoft.DotNet.PlatformAbstractions (>= 3.1.6) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netcoreapp2.1))
109125
Microsoft.Extensions.DependencyModel (>= 5.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netcoreapp2.1))
@@ -165,6 +181,18 @@ NUGET
165181
Microsoft.Extensions.Logging.Abstractions (>= 6.0)
166182
Microsoft.Extensions.Options (>= 6.0)
167183
Microsoft.Extensions.Primitives (>= 6.0)
184+
Microsoft.Extensions.Configuration (6.0.1)
185+
Microsoft.Extensions.Configuration.Abstractions (>= 6.0)
186+
Microsoft.Extensions.Primitives (>= 6.0)
187+
Microsoft.Extensions.Configuration.Abstractions (6.0)
188+
Microsoft.Extensions.Primitives (>= 6.0)
189+
Microsoft.Extensions.Configuration.Binder (6.0)
190+
Microsoft.Extensions.Configuration.Abstractions (>= 6.0)
191+
Microsoft.Extensions.DependencyInjection (6.0.1)
192+
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (== netstandard2.0)
193+
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
194+
System.Runtime.CompilerServices.Unsafe (>= 6.0)
195+
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (== netstandard2.0)
168196
Microsoft.Extensions.DependencyInjection.Abstractions (6.0)
169197
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (== netstandard2.0)
170198
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (== netstandard2.0)
@@ -174,13 +202,35 @@ NUGET
174202
System.Runtime.CompilerServices.Unsafe (>= 6.0)
175203
System.Text.Encodings.Web (>= 6.0)
176204
System.Text.Json (>= 6.0)
205+
Microsoft.Extensions.Logging (6.0)
206+
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (== netstandard2.0)
207+
Microsoft.Extensions.DependencyInjection (>= 6.0)
208+
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
209+
Microsoft.Extensions.Logging.Abstractions (>= 6.0)
210+
Microsoft.Extensions.Options (>= 6.0)
211+
System.Diagnostics.DiagnosticSource (>= 6.0)
177212
Microsoft.Extensions.Logging.Abstractions (6.0.2)
178213
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< net6.0)) (== netstandard2.0)
179214
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< net6.0)) (== netstandard2.0)
215+
Microsoft.Extensions.Logging.Configuration (6.0)
216+
Microsoft.Extensions.Configuration (>= 6.0)
217+
Microsoft.Extensions.Configuration.Abstractions (>= 6.0)
218+
Microsoft.Extensions.Configuration.Binder (>= 6.0)
219+
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
220+
Microsoft.Extensions.Logging (>= 6.0)
221+
Microsoft.Extensions.Logging.Abstractions (>= 6.0)
222+
Microsoft.Extensions.Options (>= 6.0)
223+
Microsoft.Extensions.Options.ConfigurationExtensions (>= 6.0)
180224
Microsoft.Extensions.Options (6.0)
181225
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
182226
Microsoft.Extensions.Primitives (>= 6.0)
183227
System.ComponentModel.Annotations (>= 5.0) - restriction: || (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (< netstandard2.1)) (== netstandard2.0)
228+
Microsoft.Extensions.Options.ConfigurationExtensions (6.0)
229+
Microsoft.Extensions.Configuration.Abstractions (>= 6.0)
230+
Microsoft.Extensions.Configuration.Binder (>= 6.0)
231+
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
232+
Microsoft.Extensions.Options (>= 6.0)
233+
Microsoft.Extensions.Primitives (>= 6.0)
184234
Microsoft.Extensions.Primitives (6.0)
185235
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netcoreapp3.1)) (== netstandard2.0)
186236
System.Runtime.CompilerServices.Unsafe (>= 6.0)
@@ -233,6 +283,20 @@ NUGET
233283
System.Runtime.CompilerServices.Unsafe (>= 5.0)
234284
Newtonsoft.Json (13.0.2)
235285
NuGet.Frameworks (6.3) - copy_local: false
286+
OpenTelemetry (1.3.2)
287+
Microsoft.Extensions.Logging (>= 3.1)
288+
Microsoft.Extensions.Logging.Configuration (>= 3.1)
289+
OpenTelemetry.Api (>= 1.3.2)
290+
System.Collections.Immutable (>= 1.4)
291+
System.Reflection.Emit.Lightweight (>= 4.7)
292+
OpenTelemetry.Api (1.3.2)
293+
System.Diagnostics.DiagnosticSource (>= 6.0 < 8.0)
294+
System.Reflection.Emit.Lightweight (>= 4.7)
295+
OpenTelemetry.Exporter.OpenTelemetryProtocol (1.3.2)
296+
Google.Protobuf (>= 3.19.4 < 4.0)
297+
Grpc (>= 2.44 < 3.0) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net462)) (&& (== net7.0) (< netstandard2.1)) (== netstandard2.0)
298+
Grpc.Net.Client (>= 2.43 < 3.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netstandard2.1))
299+
OpenTelemetry (>= 1.3.2)
236300
SemanticVersioning (2.0.2)
237301
Serilog (2.11)
238302
Serilog.Sinks.Async (1.5)
@@ -279,7 +343,7 @@ NUGET
279343
System.Numerics.Vectors (>= 4.4) - restriction: || (&& (== net6.0) (< netcoreapp2.0)) (&& (== net7.0) (< netcoreapp2.0)) (== netstandard2.0)
280344
System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= uap10.1)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (&& (== net7.0) (>= monotouch)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netcoreapp2.0)) (&& (== net7.0) (< netcoreapp2.1)) (&& (== net7.0) (< netstandard1.1)) (&& (== net7.0) (< netstandard2.0)) (&& (== net7.0) (>= uap10.1)) (&& (== net7.0) (>= xamarinios)) (&& (== net7.0) (>= xamarinmac)) (&& (== net7.0) (>= xamarintvos)) (&& (== net7.0) (>= xamarinwatchos)) (== netstandard2.0)
281345
System.Numerics.Vectors (4.5) - restriction: || (&& (== net6.0) (< netcoreapp2.0)) (&& (== net7.0) (< netcoreapp2.0)) (== netstandard2.0)
282-
System.Reactive (5.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0))
346+
System.Reactive (5.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0))
283347
System.Reflection.Emit (4.7)
284348
System.Reflection.Emit.ILGeneration (>= 4.7) - restriction: || (&& (== net6.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= uap10.1)) (&& (== net7.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net7.0) (< netstandard1.1)) (&& (== net7.0) (< netstandard2.0)) (&& (== net7.0) (>= uap10.1)) (== netstandard2.0)
285349
System.Reflection.Emit.ILGeneration (4.7) - restriction: || (&& (== net6.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= uap10.1)) (&& (== net7.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net7.0) (< netstandard1.1)) (&& (== net7.0) (< netstandard2.0)) (&& (== net7.0) (>= uap10.1)) (== netstandard2.0)
@@ -327,7 +391,9 @@ NUGET
327391
System.Collections.Immutable (>= 6.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
328392
GITHUB
329393
remote: TheAngryByrd/FsLibLog
330-
src/FsLibLog/FsLibLog.fs (f81cba440bf0476bb4e2262b57a067a0d6ab78a7)
394+
src/FsLibLog/FsLibLog.fs (64f118ae8df2f2944ef69758052cb3b148b87e79)
395+
remote: TheAngryByrd/FsOpenTelemetry
396+
src/FsOpenTelemetry/FsOpenTelemetry.fs (fb24e8d4dc8ad14187b9b4631854fc8f17fb244d)
331397
GROUP Build
332398
STORAGE: NONE
333399
RESTRICTION: || (== net6.0) (== net7.0)

0 commit comments

Comments
 (0)