feat: Add observability examples to .NET examples repo#8
Draft
jsonbailey wants to merge 1 commit into
Draft
Conversation
Add a standalone console example under server-sdk/features/plugins/observability demonstrating the LaunchDarkly.Observability plugin (custom spans, metrics, and logs), and add the observability plugin to the OpenAI chat-completions AI framework example with OpenAI's experimental OpenTelemetry enabled. SDK-2665
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds examples demonstrating the
LaunchDarkly.Observabilityplugin. Resolves SDK-2665.What's included
New console example —
server-sdk/features/plugins/observabilityBased on the getting-started
HelloDotNetexample, with the observability plugin added:ObservabilityPluginon the SDK configuration viaPluginConfigurationBuilder.Host.CreateApplicationBuilder, blocking onWaitForShutdownso Ctrl+C shuts down cleanly and flushes telemetry.Observe.StartActivity— a console app has no framework auto-instrumentation, so spans must be created explicitly.Observe.RecordIncr) and a structured log (Observe.RecordLog) per evaluation and flag change.OpenAI chat-completions example —
server-sdk-ai/frameworks/openai/chat-completionsOPENAI_EXPERIMENTAL_ENABLE_OPEN_TELEMETRY=trueso the OpenAI SDK emits OpenTelemetry.OpenAI.ChatClientactivity source and meter with the plugin so the model call's spans andgen_ai.*token-usage metrics export to LaunchDarkly.Also updates
server-sdk/README.mdwith a Features table entry for the new example.Verification
dotnet build).gen_ai.*spans/metrics) confirmed exporting to a local OTLP sink.