Skip to content

Improve OTLP observability example: add usings, reorder steps, refresh versions - #55623

Draft
adegeo with Copilot wants to merge 3 commits into
mainfrom
copilot/update-otel-article
Draft

Improve OTLP observability example: add usings, reorder steps, refresh versions#55623
adegeo with Copilot wants to merge 3 commits into
mainfrom
copilot/update-otel-article

Conversation

Copilot AI commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

The OTLP/Aspire Dashboard example article required trial and error to follow: it omitted using directives, had readers ping-pong between later and earlier insertion points in Program.cs, referenced an outdated package version, and hardcoded a port that doesn't match what dotnet run actually outputs.

Article structure

  • Added a dedicated "Add using directives" step early in the walkthrough, backed by a new Snippet_Usings marker in Program.cs
  • Reordered steps to follow the source file top-to-bottom: metrics/activity definitions and OTel provider configuration (both of which precede builder.Build();) now come before the API endpoint step (which comes after builder.Build();), so readers no longer jump backward to insert earlier code
  • Updated internal step cross-references and renumbered the sub-headings (9.1/9.2/9.3) to match the new order

Content fixes

  • Bumped the OpenTelemetry package version references from 1.9.0 to 1.17.0, matching the sample .csproj
  • Replaced the hardcoded curl -k http://localhost:7275 example with guidance to read the actual listening port from the dotnet run console output, since it can differ per environment
// <Snippet_Usings>
using System.Diagnostics;
using System.Diagnostics.Metrics;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using OpenTelemetry.Exporter;
using OpenTelemetry.Logs;
using OpenTelemetry;
using Azure.Monitor.OpenTelemetry.AspNetCore;
// </Snippet_Usings>

Internal previews

File Preview link
docs/core/diagnostics/snippets/OTLP-Example/csharp/Program.cs Preview published page

Copilot AI lite review requested due to automatic review settings August 20, 2026 20:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Copilot AI and others added 2 commits August 20, 2026 20:12
Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
… versions and port guidance

Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Copilot AI changed the title [WIP] Update OTEL article with additional coding information Improve OTLP observability example: add usings, reorder steps, refresh versions Aug 20, 2026
Copilot AI requested a review from adegeo August 20, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OTEL article could use more information to help coding

3 participants