Skip to content

Commit

Permalink
Move more stuff out of *Telemetry* namespaces (#4447)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Taillefer <mataille@microsoft.com>
  • Loading branch information
geeknoid and Martin Taillefer authored Sep 20, 2023
1 parent 5d1d954 commit 1a91344
Show file tree
Hide file tree
Showing 86 changed files with 172 additions and 170 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics;

internal static class Constants
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Toolchains.InProcess.Emit;

namespace Microsoft.AspNetCore.Telemetry.Bench;
namespace Microsoft.AspNetCore.Diagnostics.Bench;

internal static class Program
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Microsoft.Extensions.ObjectPool;
using Microsoft.Shared.Pools;

namespace Microsoft.AspNetCore.Telemetry.Bench;
namespace Microsoft.AspNetCore.Diagnostics.Bench;

[GcServer(true)]
[MinColumn]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics;

internal readonly struct RouteSegment
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft.Extensions.Diagnostics.Latency;
using Microsoft.Extensions.Primitives;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Latency;

/// <summary>
/// A middleware that populates Server-Timing header with response processing time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.Latency;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Latency;

/// <summary>
/// Middleware that should be put at the beginning of the middleware pipeline to capture time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Latency;

/// <summary>
/// Adds <see cref="CapturePipelineEntryMiddleware"/> at the beginning of the middleware pipeline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.Latency;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Latency;

/// <summary>
/// Middleware that should be put at the end of the pipeline to capture time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.Latency;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Latency;

/// <summary>
/// A middleware that captures response times.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using Microsoft.Extensions.Diagnostics.Latency;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Latency;

internal static class LatencyContextControlExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Latency;

/// <summary>
/// Project constants.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Microsoft.Extensions.Diagnostics.Latency;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Latency;

/// <summary>
/// Extensions used to register Request Checkpoint feature.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Telemetry.Internal;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Diagnostics.Latency;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Latency;

/// <summary>
/// Extensions for registering the request latency telemetry middleware.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using Microsoft.Extensions.Options;
using Microsoft.Shared.Pools;

namespace Microsoft.AspNetCore.Telemetry.Internal;
namespace Microsoft.AspNetCore.Diagnostics.Latency;

/// <summary>
/// Middleware that manages latency context for requests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Microsoft.AspNetCore.Telemetry.Internal;
using Microsoft.Shared.Data.Validation;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Latency;

/// <summary>
/// Options to configure the request latency middleware.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using Microsoft.Extensions.Options;

namespace Microsoft.AspNetCore.Telemetry.Internal;
namespace Microsoft.AspNetCore.Diagnostics.Latency;

[OptionsValidator]
internal sealed partial class RequestLatencyTelemetryOptionsValidator : IValidateOptions<RequestLatencyTelemetryOptions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Microsoft.Extensions.Compliance.Classification;
using Microsoft.Extensions.Compliance.Redaction;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

internal sealed class HeaderReader
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Concurrent;
using Microsoft.AspNetCore.Diagnostics.Logging;
using Microsoft.Extensions.Logging;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

internal static class HttpLogPropertiesProvider
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Diagnostics.Logging;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Telemetry.Internal;
using Microsoft.Extensions.Compliance.Classification;
using Microsoft.Extensions.Compliance.Redaction;
using Microsoft.Extensions.Http.Telemetry;
Expand All @@ -26,7 +26,7 @@
using Microsoft.Shared.Pools;

// Keeping this namespace so that users are able to control logging:
namespace Microsoft.AspNetCore.Telemetry.Http.Logging;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

internal sealed class HttpLoggingMiddleware : IMiddleware
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Telemetry.Http.Logging;
using Microsoft.AspNetCore.Telemetry.Internal;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
Expand All @@ -14,7 +12,7 @@
using Microsoft.IO;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

/// <summary>
/// Extension methods to register the HTTP logging feature within the service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

/// <summary>
/// Constants used for incoming HTTP request logging tags.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

internal static class HttpRequestBodyReader
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Shared.Diagnostics;

namespace Microsoft.AspNetCore.Telemetry.Internal;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

/// <summary>
/// Telemetry utility extensions for incoming http requests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Diagnostics.Enrichment;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

/// <summary>
/// Interface for implementing log enrichers for incoming HTTP requests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Compliance.Classification;

namespace Microsoft.AspNetCore.Telemetry.Internal;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

/// <summary>
/// Telemetry utilities for incoming http requests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#endif
using Microsoft.Extensions.Compliance.Classification;

namespace Microsoft.AspNetCore.Telemetry.Internal;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

internal sealed class IncomingHttpRouteUtility : IIncomingHttpRouteUtility
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

/// <summary>
/// Strategy to decide how request path is logged.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Telemetry.Internal;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

internal sealed class IncomingRequestLogRecord
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Diagnostics.Logging;
using Microsoft.Extensions.Logging;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

#pragma warning disable S109

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Diagnostics.Logging;
using Microsoft.Extensions.Compliance.Classification;
using Microsoft.Extensions.Http.Telemetry;
using Microsoft.Shared.Data.Validation;
using Microsoft.Shared.DiagnosticIds;

namespace Microsoft.AspNetCore.Telemetry;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

/// <summary>
/// Top-level model for formatting incoming HTTP requests and their corresponding responses.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using Microsoft.Extensions.Options;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

[OptionsValidator]
internal sealed partial class LoggingOptionsValidator : IValidateOptions<LoggingOptions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using Microsoft.AspNetCore.Mvc.Formatters;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

internal static class MediaTypeSetExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

internal static class PipeReaderExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Shared.Pools;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

/// <summary>
/// Intercepts data being written to stream and writes its copy to another data structure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft.Extensions.ObjectPool;
using Microsoft.Shared.Pools;

namespace Microsoft.AspNetCore.Telemetry.Http.Logging;
namespace Microsoft.AspNetCore.Diagnostics.Logging;

internal static class ResponseInterceptingStreamPool
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>Microsoft.AspNetCore.Telemetry</RootNamespace>
<RootNamespace>Microsoft.AspNetCore.Diagnostics</RootNamespace>
<Description>ASP.NET Core middleware for collecting high-quality telemetry.</Description>
<PackageTags>$(PackageTags);aspnetcore</PackageTags>
<Workstream>Telemetry</Workstream>
Expand Down
Loading

0 comments on commit 1a91344

Please sign in to comment.