Skip to content

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

Open
adegeo with Copilot wants to merge 11 commits into
mainfrom
copilot/update-otel-article
Open

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

Conversation

Copilot AI commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What was changed:

  • Fixed the OTEL code so it now exports metrics to Aspire.
  • Update packages from 1.9.0 (security vulnerability) to 1.17.0
  • Described the namespaces a user needs.
  • Describe the env vars that need to be set in appsettings.dev.json
  • Let the user know that the CURL port is just an example and use port the website reports.
  • Reordered the steps to prevent the user from ping-pong around the Program.cs file.
  • Rewrite title/description for SEO.
  • New first paragraph that describes what the user will learn by reading this.
  • Edit pass.
  • Moved source to its own folder per guidelines so changes don't impact other articles.

Fixes #45899
Fixes #55622

File Preview link
docs/core/diagnostics/observability-otlp-example.md Preview published page

Copilot's stuff...

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/observability-otlp-example.md Preview published page
docs/core/diagnostics/observability-with-otel.md Preview published page
docs/core/diagnostics/snippets/observability-otlp-example/csharp/observability-otlp-example.csproj Preview published page
docs/core/diagnostics/snippets/observability-otlp-example/csharp/Program.cs Preview published page
docs/navigate/tools-diagnostics/toc.yml 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
adegeo and others added 8 commits August 20, 2026 15:52
The Program.cs under snippets/OTLP-Example/csharp is shared with
observability-applicationinsights.md, so editing it for this article
risked breaking that unrelated article. Create a dedicated
snippets/observability-otlp-example/csharp project (via dotnet new web)
with its own Program.cs, NuGet package references, and snippet region
markers, and point this article's code references at it. Revert the
Snippet_Usings markers that had been added to the shared file.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ge commands

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Move the NuGet package reference step right after project creation
- Drop the trailing ();  when referencing builder.Build in prose
- Simplify the OTEL configuration step intro instead of linking back
- Fix a comment typo and add spacing/comment in the metrics setup

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Convert passive voice to active voice throughout
- Replace weak instruction language with imperative mood
- Remove first-person plural (we/our), gerund clauses, and 'there are' constructions
- Fix word choice (may->might/can, as->because, additional->other, env vars->environment variables)
- Format file names and identifiers as code, not italics
- Rename gerund headings (Viewing the metrics/tracing -> Metrics view/Tracing view)
- Add ai-usage: ai-assisted front matter

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Add a new opening paragraph stating what the article shows how to do
- Shorten title/H1 to 'Use OpenTelemetry with OTLP and the Aspire Dashboard'
  (drop redundant 'Example:' and 'standalone')
- Rewrite meta description as a concise, keyword-focused summary
- Update the matching link text in observability-with-otel.md and the TOC entry

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@adegeo
adegeo marked this pull request as ready for review August 21, 2026 15:55
@adegeo
adegeo requested review from a team and tommcdon as code owners August 21, 2026 15:55
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 No telemetry showing up in the dashboard with latest packages

3 participants