Skip to content

Instantly share code, notes, and snippets.

View realparadyne's full-sized avatar

David realparadyne

  • England
  • 18:24 (UTC -12:00)
View GitHub Profile
@ninjarobot
ninjarobot / tracing-intro-appinsights.md
Last active August 17, 2023 15:17
Correlated tracing in F# with Application Insights

Tracing with Application Insights

Application logging is ubiquitous and invaluable for troubleshooting. Structured logging enables you to log formatted messages and the data fields separately so that you can see the messages but also filter on the data fields. Tracing takes this a step further, where you can correlate many log entries together as you follow a trace of execution through an application. Traces also include additional information about the execution process, such as the sequence of calls to dependencies and how long any given call may take.

Application Insights lets you see all of this data correlated together in an application. You can search for an error log and then see in the execution flow that the log entry was added right after a failed call to another service. Or you can see that a certain web request is slower than others because it spends a lot of time on many redundant data access calls.

What about OpenTelemetry?

@TheAngryByrd
TheAngryByrd / AsyncToTaskHelpers.fs
Created October 27, 2021 19:17
AsyncToTaskHelpers
type AsyncBuilder with
member inline __.Bind(t : Task<'a>, cont) = async.Bind(t |> Async.AwaitTask, cont)
member inline __.Bind(t : Task, cont) = async.Bind(t |> Async.AwaitTask, cont)
member inline __.ReturnFrom(t : Task<'a>) = async.ReturnFrom(t |> Async.AwaitTask)
member inline __.ReturnFrom(t : Task) = async.ReturnFrom(t |> Async.AwaitTask)
member inline __.Bind(t : ValueTask<'a>, cont) = async.Bind(t.AsTask() |> Async.AwaitTask, cont)
member inline __.Bind(t : ValueTask, cont) = async.Bind(t.AsTask() |> Async.AwaitTask, cont)
member inline __.ReturnFrom(t : ValueTask<'a>) = async.ReturnFrom(t.AsTask() |> Async.AwaitTask)
member inline __.ReturnFrom(t : ValueTask) = async.ReturnFrom(t.AsTask() |> Async.AwaitTask)
@JustinGrote
JustinGrote / AddFSharpType.fs
Created October 24, 2021 23:52
A version of Add-Type for F# in PowerShell
namespace AddFSharpType
module AddFSharpType =
open System.IO
open FSharp.Compiler.CodeAnalysis
open System
/// This is basically the compiler so we name it that way
let compiler = FSharpChecker.Create()
let AddFromFile (sourceFile : string) =