From 3a604e5954cdbb7978901eca103097801c8d4cd2 Mon Sep 17 00:00:00 2001 From: Jimmy Byrd Date: Fri, 24 Feb 2023 22:53:34 -0500 Subject: [PATCH] OpenTelemetry settings --- release/package.json | 19 +++++++++++++++++++ src/Core/LanguageService.fs | 5 +++++ 2 files changed, 24 insertions(+) diff --git a/release/package.json b/release/package.json index 261091da..fd50875e 100644 --- a/release/package.json +++ b/release/package.json @@ -665,6 +665,25 @@ "description": "Automatically shows the MSBuild output panel when MSBuild functionality is invoked", "type": "boolean" }, + "FSharp.notifications.trace": { + "default": false, + "description": "Enables more verbose notifications using System.Diagnostics.Activity to view traces from FSharp.Compiler.Service.", + "type" : "boolean" + }, + "FSharp.notifications.traceNamespaces": { + "default": [ + "BoundModel.TypeCheck", + "BackgroundCompiler." + ], + "description": "The set of System.Diagnostics.Activity names to watch.", + "type" : "array", + "required": ["FSharp.notifications.trace"] + }, + "FSharp.openTelemetry.enabled": { + "default": false, + "description": "Enables OpenTelemetry exporter. See https://opentelemetry.io/docs/reference/specification/protocol/exporter/ for environment variables to configure for the exporter. Requires Restart.", + "type": "boolean" + }, "FSharp.pipelineHints.enabled": { "default": true, "description": "Enables PipeLine hints, which are like LineLenses that appear along each step of a chain of piped expressions", diff --git a/src/Core/LanguageService.fs b/src/Core/LanguageService.fs index 475bd6df..e7471811 100644 --- a/src/Core/LanguageService.fs +++ b/src/Core/LanguageService.fs @@ -675,6 +675,9 @@ Consider: let enableAdaptiveLspServer = "FSharp.enableAdaptiveLspServer" |> Configuration.get false + let openTelemetryEnabled = + "FSharp.openTelemetry.enabled" |> Configuration.get false + let enableProjectGraph = "FSharp.enableMSBuildProjectGraph" |> Configuration.get false @@ -807,6 +810,8 @@ Consider: yield "--project-graph-enabled" if enableAdaptiveLspServer then yield "--adaptive-lsp-server-enabled" + if openTelemetryEnabled then + yield "--otel-exporter-enabled" if verbose then yield "--verbose" if fsacSilencedLogs <> null && fsacSilencedLogs.Length > 0 then