Saturn.OpenTelemetry
0.5.1-alpha
dotnet add package Saturn.OpenTelemetry --version 0.5.1-alpha
NuGet\Install-Package Saturn.OpenTelemetry -Version 0.5.1-alpha
<PackageReference Include="Saturn.OpenTelemetry" Version="0.5.1-alpha" />
paket add Saturn.OpenTelemetry --version 0.5.1-alpha
#r "nuget: Saturn.OpenTelemetry, 0.5.1-alpha"
// Install Saturn.OpenTelemetry as a Cake Addin #addin nuget:?package=Saturn.OpenTelemetry&version=0.5.1-alpha&prerelease // Install Saturn.OpenTelemetry as a Cake Tool #tool nuget:?package=Saturn.OpenTelemetry&version=0.5.1-alpha&prerelease
Saturn.OpenTelemetry
Includes a small Telemetry
wrapper for the dotnet ActivitySource
, to make it more compatible
with other OpenTelemetry applications in other languages.
Table of Contents
About
Saturn.OpenTelemetry
is a library that extends the Saturn
Web Application framework with functionality to integrate OpenTelemetry for distributed tracing and metrics. This means that you can easily add observability to your Saturn applications, allowing you to monitor and analyze the performance and behavior of your services.
Inspired by the OpenTelemetry .NET SDK, but adapted to work seamlessly with Saturn's functional programming model and F# syntax.
Getting Started
Add the Saturn.OpenTelemetry
NuGet package to your project:
dotnet add package Saturn.OpenTelemetry
Basic use case:
open Saturn
open Saturn.OpenTelemetry
// General OpenTelemetry Configuration
let otelConfig: OtelConfig = {
Endpoint = "http://localhost:4317"
AppId = "Example"
Namespace = "Saturn"
Version = "1.0.0"
}
// Add OpenTelemetry to the Saturn pipeline
let app = application {
use_router webAppRouter
url "http://0.0.0.0:8085/"
use_otel (
configure_otel {
// These are required
settings otelConfig
// These are optional and can be used to enable specific features
// use_efcore
// use_redis
// use_openfga
}
)
use_static "static"
memory_cache
use_gzip
}
// Start the application and Initialize OpenTelemetry
[<EntryPoint>]
let main _ =
Telemetry.init otelConfig.AppId
run app
0
LGTM stack locally
You can deploy the LGTM stack locally for development purposes.
docker run -p 3002:3000 -p 4317:4317 -p 4318:4318 --rm -ti grafana/otel-lgtm
This will spin up a container listening for OTEL traces on port 4317 and 4318 and can be accessed on port 3002.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- FSharp.Core (>= 8.0.401)
- OpenFga.Sdk (>= 0.5.1)
- OpenTelemetry (>= 1.9.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.9.0)
- OpenTelemetry.Extensions.Hosting (>= 1.9.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.9.0)
- OpenTelemetry.Instrumentation.EntityFrameworkCore (>= 1.0.0-beta.12)
- OpenTelemetry.Instrumentation.Http (>= 1.9.0)
- OpenTelemetry.Instrumentation.Process (>= 0.5.0-beta.7)
- OpenTelemetry.Instrumentation.Runtime (>= 1.9.0)
- OpenTelemetry.Instrumentation.StackExchangeRedis (>= 1.9.0-beta.1)
- Saturn (>= 0.17.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.5.1-alpha | 71 | 10/19/2024 |
0.5.0-alpha | 45 | 10/7/2024 |
0.4.0-alpha | 49 | 9/29/2024 |
0.3.0-alpha | 50 | 9/25/2024 |
0.2.0-alpha | 40 | 9/25/2024 |