-
Notifications
You must be signed in to change notification settings - Fork 873
[Examples] Add F# example #6875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6875 +/- ##
==========================================
- Coverage 87.33% 87.08% -0.26%
==========================================
Files 263 263
Lines 12387 12387
==========================================
- Hits 10818 10787 -31
- Misses 1569 1600 +31
Flags with carried forward coverage won't be shown. Click here to find out more. |
6dbd1b8 to
768ebf1
Compare
baronfel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good, but I have a couple tiny notes to clean it up a bit.
Add an example for an ASP.NET Core application using F#.
f2e58ca to
5f82e17
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a new F# ASP.NET Core Web API example demonstrating OpenTelemetry logging, metrics, and tracing, aligning with the existing C# AspNetCore example and wiring it into the repo solution/build.
Changes:
- Introduces a new F# example app (project, program, controller, instrumentation helper, model) with OTLP/Console/Prometheus switching via configuration.
- Adds supporting example assets (README, appsettings, docker-compose for grafana/otel-lgtm).
- Wires the new example into the solution and central package versions.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/FSharp/docker-compose.yaml | Adds docker-compose to run grafana/otel-lgtm dependencies for the example. |
| examples/FSharp/appsettings.json | Adds configuration for exporters, OTLP endpoint, and instrumentation options. |
| examples/FSharp/WeatherForecast.fs | Adds the sample model used by the controller. |
| examples/FSharp/README.md | Documents running the F# example and optional OTLP export + Docker deps. |
| examples/FSharp/Program.fs | Configures OpenTelemetry logging/metrics/tracing and ASP.NET Core pipeline. |
| examples/FSharp/InstrumentationSource.fs | Adds ActivitySource/Meter/counter holder for manual instrumentation. |
| examples/FSharp/Examples.FSharp.fsproj | Adds the new F# example project and dependencies. |
| examples/FSharp/Controllers/WeatherForecastController.fs | Adds the sample controller emitting telemetry and logs. |
| OpenTelemetry.slnx | Adds the new F# example project to the solution. |
| Directory.Packages.props | Adds central package version entry for FSharp.Core. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Changes
Add an example for an ASP.NET Core application using F#.
This was inspired by a conversation @alanwest and myself had at OTel Unplugged with an end-user who wondered why there wasn't an F# SDK for OpenTelemetry.
The example here is based on the AspNetCore example, and then converted with the help of GitHub Copilot. I'm no F# developer, so it might not be as idiomatic as it could be.
While working on this I found some issues with the Docker Compose setup copied from the ASP.NET Core example
so I'm going to park this for now while I fix that#6877.Feedback welcome.
Merge requirement checklist
Unit tests added/updatedAppropriateCHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)