Skip to content

Conversation

mariamgerges
Copy link
Contributor

@mariamgerges mariamgerges commented Oct 10, 2025

@mariamgerges mariamgerges requested a review from a team as a code owner October 10, 2025 11:44
@Copilot Copilot AI review requested due to automatic review settings October 10, 2025 11:44
@dotnetrepoman dotnetrepoman bot added this to the October 2025 milestone Oct 10, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds documentation for the process log enricher functionality in .NET, introducing comprehensive guidance on how to use the process enricher to augment telemetry logs with process-specific information such as process ID and thread ID.

Key changes:

  • Added new documentation article explaining process log enricher usage and configuration
  • Created example code snippets demonstrating integration with host builder and dependency injection
  • Updated table of contents to include the new enrichment section

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docs/navigate/tools-diagnostics/toc.yml Added new "Enrichment" section with process log enricher entry
docs/core/enrichment/process-log-enricher.md Main documentation article explaining process enricher usage, configuration options, and examples
docs/core/enrichment/snippets/enrichment/Program.cs Example console application demonstrating process enricher setup
docs/core/enrichment/snippets/enrichment/Log.cs Helper class with LoggerMessage attribute for sample logging
docs/core/enrichment/snippets/enrichment/Enrichment.csproj Project file with required NuGet package references

---
title: Process enricher
description: Learn how to use the process log enricher in .NET.
ms.date: 10/10/2025
Copy link

Copilot AI Oct 10, 2025

Choose a reason for hiding this comment

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

According to the coding guidelines, this appears to be AI-generated content. The document should include the ai-usage frontmatter key with appropriate value (ai-generated or ai-assisted).

Copilot generated this review using guidance from repository custom instructions.

@evgenyfedorov2
Copy link
Member

evgenyfedorov2 commented Oct 10, 2025

  • I think we need an Overview page explaining what enrichment is. We can get an inspiration from Serilog https://github.com/serilog/serilog/wiki/Enrichment
  • Instead of Enrichment, the title should be Log enrichment, at least for the foreseeable future. Because Trace enrichment is part of OpenTelemetry .NET and Metric enrichment just does not exist (recommended replacement is OpenTelemetry .NET Resource)
  • Also we need information about dimension names (also known as keys, tags, etc)

@mariamgerges
Copy link
Contributor Author

  • I think we need an Overview page explaining what enrichment is. We can get an inspiration from Serilog https://github.com/serilog/serilog/wiki/Enrichment
  • Instead of Enrichment, the title should be Log enrichment, at least for the foreseeable future. Because Trace enrichment is part of OpenTelemetry .NET and Metric enrichment just does not exist (recommended replacement is OpenTelemetry .NET Resource)
  • Also we need information about dimension names (also known as keys, tags, etc)

I added an overview document and a custom enricher doc. please check


...

var hostBuilder = new HostBuilder()
Copy link
Member

Choose a reason for hiding this comment

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

I thought the HostBuilder was deprecated, no?

Copy link
Contributor Author

@mariamgerges mariamgerges Oct 15, 2025

Choose a reason for hiding this comment

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

AFAIK no it wasn’t

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I was thinking about something else. But that pattern is really dated, we keep trying to point folks in the more modern direction. Instead of the manually instantiating a HostBuilder, we often instead show the:

var builder = Host.CreateDefaultBuilder(args);

But it's preferred to instead show the:

var builder = Host.CreateApplicationBuilder(args);

See .NET Generic Host: Set up a host, and notice the default selected tab. It's a better API to show the:

var builder = Host.CreateApplicationBuilder(args);

// For example, this...
// builder.Services.Add*();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants