Skip to content

Commit

Permalink
Merge remote-tracking branch 'main' into dev/clguiman/event-source-pa…
Browse files Browse the repository at this point in the history
…rameter-captures
  • Loading branch information
clguiman committed Apr 22, 2024
2 parents 2ad13f6 + 243d394 commit 817cd10
Show file tree
Hide file tree
Showing 36 changed files with 139 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/add-markdown-feedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
git diff > ./pr/linter.diff
- name: Upload artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba
with:
name: pr-linter
path: pr/
2 changes: 1 addition & 1 deletion .github/workflows/lint-csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
git diff > ./pr/linter.diff
- name: Upload artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba
with:
name: pr-linter
path: pr/
2 changes: 1 addition & 1 deletion .github/workflows/scan-for-to-do-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
COMMENT_AUTHOR: ${{ github.event.comment.user.login }}

- name: Upload artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba
with:
name: issue-todo
path: issue/
14 changes: 7 additions & 7 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore</Uri>
<Sha>8e941eb42f819adb116b881195158b3887a70a1c</Sha>
</Dependency>
<Dependency Name="Microsoft.Diagnostics.Monitoring" Version="8.0.0-preview.24212.2">
<Dependency Name="Microsoft.Diagnostics.Monitoring" Version="8.0.0-preview.24219.1">
<Uri>https://github.com/dotnet/diagnostics</Uri>
<Sha>1f6a0ea3f4d8ced5dc5d640672d3c9b8f373d6fc</Sha>
<Sha>c206de0ffb36baa05722c3f43f40c9b4eeb1e5aa</Sha>
</Dependency>
<Dependency Name="Microsoft.Diagnostics.Monitoring.EventPipe" Version="8.0.0-preview.24212.2">
<Dependency Name="Microsoft.Diagnostics.Monitoring.EventPipe" Version="8.0.0-preview.24219.1">
<Uri>https://github.com/dotnet/diagnostics</Uri>
<Sha>1f6a0ea3f4d8ced5dc5d640672d3c9b8f373d6fc</Sha>
<Sha>c206de0ffb36baa05722c3f43f40c9b4eeb1e5aa</Sha>
</Dependency>
<Dependency Name="System.CommandLine" Version="2.0.0-beta4.24209.3">
<Uri>https://github.com/dotnet/command-line-api</Uri>
Expand Down Expand Up @@ -46,9 +46,9 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>188340e12c0a372b1681ad6a5e72c608021efdba</Sha>
</Dependency>
<Dependency Name="Microsoft.FileFormats" Version="1.0.517501">
<Uri>https://github.com/dotnet/symstore</Uri>
<Sha>550601c12a227c87ded32316345934101a8a2422</Sha>
<Dependency Name="Microsoft.FileFormats" Version="8.0.0-preview.24219.1">
<Uri>https://github.com/dotnet/diagnostics</Uri>
<Sha>c206de0ffb36baa05722c3f43f40c9b4eeb1e5aa</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="8.0.1" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
Expand Down
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
<!-- dotnet/command-line-api references -->
<SystemCommandLineVersion>2.0.0-beta4.24209.3</SystemCommandLineVersion>
<!-- dotnet/diagnostics references -->
<MicrosoftDiagnosticsMonitoringVersion>8.0.0-preview.24212.2</MicrosoftDiagnosticsMonitoringVersion>
<MicrosoftDiagnosticsMonitoringEventPipeVersion>8.0.0-preview.24212.2</MicrosoftDiagnosticsMonitoringEventPipeVersion>
<MicrosoftDiagnosticsMonitoringVersion>8.0.0-preview.24219.1</MicrosoftDiagnosticsMonitoringVersion>
<MicrosoftDiagnosticsMonitoringEventPipeVersion>8.0.0-preview.24219.1</MicrosoftDiagnosticsMonitoringEventPipeVersion>
<!-- dotnet/installer references -->
<MicrosoftDotnetSdkInternalVersion>8.0.103-servicing.24114.15</MicrosoftDotnetSdkInternalVersion>
<!-- dotnet/roslyn-analyzers -->
Expand All @@ -67,7 +67,7 @@
<MicrosoftNETCoreAppRuntimewinx64Version>8.0.1</MicrosoftNETCoreAppRuntimewinx64Version>
<VSRedistCommonNetCoreSharedFrameworkx6480Version>8.0.1-servicing.23580.1</VSRedistCommonNetCoreSharedFrameworkx6480Version>
<!-- dotnet/symstore references -->
<MicrosoftFileFormatsVersion>1.0.517501</MicrosoftFileFormatsVersion>
<MicrosoftFileFormatsVersion>8.0.0-preview.24219.1</MicrosoftFileFormatsVersion>
</PropertyGroup>
<PropertyGroup Label="Runtime Versions">
<MicrosoftAspNetCoreApp31Version>$(MicrosoftNETCoreApp31Version)</MicrosoftAspNetCoreApp31Version>
Expand Down
4 changes: 2 additions & 2 deletions eng/dependabot/independent/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- Import references updated by Dependabot. -->

<PropertyGroup>
<AzureIdentityVersion>1.11.0</AzureIdentityVersion>
<AzureIdentityVersion>1.11.1</AzureIdentityVersion>
<AzureStorageBlobsVersion>12.19.1</AzureStorageBlobsVersion>
<AzureStorageQueuesVersion>12.17.1</AzureStorageQueuesVersion>
<MicrosoftIdentityWebVersion>2.17.4</MicrosoftIdentityWebVersion>
<MicrosoftIdentityWebVersion>2.17.5</MicrosoftIdentityWebVersion>
<MicrosoftOpenApiReadersVersion>1.6.13</MicrosoftOpenApiReadersVersion>
<SystemPrivateUriVersion>4.3.2</SystemPrivateUriVersion>
<SystemSecurityPrincipalWindowsVersion>5.0.0</SystemSecurityPrincipalWindowsVersion>
Expand Down
63 changes: 44 additions & 19 deletions eng/pipelines/jobs/test-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,52 @@ jobs:
- ${{ if ne(parameters.osGroup, 'Linux_Musl')}}:
# Linux builds (of all variants) run in Mariner containers and do not include pwsh by default
- ${{ if eq(parameters.osGroup, 'Linux') }}:
- script: sudo -n tdnf install -y --refresh powershell
- script: |
$(Build.SourcesDirectory)/restore.sh
$(Build.SourcesDirectory)/.dotnet/dotnet tool install --global PowerShell
echo "##vso[task.prependpath]/home/cloudtest_azpcontainer/.dotnet/tools"
displayName: Install pwsh
# Calculate the fully qualified Nodejs version first so that any new releases will result in a new cache key
- pwsh: eng/helix/GetNodejsVersion.ps1
-MajorVersion $(NodeMajorVersion)
-TaskVariableName 'FqNodejsVersion'
displayName: Calculate Node.js version

- task: Cache@2
displayName: Node.js Cache
inputs:
# Wrap FqNodejsVersion in quotes to prevent it being interpreted as a file
key: 'nodejs | ${{ parameters.osGroup }} | ${{ parameters.architecture }} | "$(FqNodejsVersion)"'
path: $(HelixNodejsPayloadPath)

- pwsh: eng/helix/InstallNodejs.ps1
-Version $(FqNodejsVersion)
-Architecture ${{ parameters.architecture }}
-DestinationFolder "$(HelixNodejsPayloadPath)"
displayName: Hydrate Node.js Installation
# Calculate the fully qualified Nodejs version first so that any new releases will result in a new cache key
- script: |
pwsh ../eng/helix/GetNodejsVersion.ps1 -MajorVersion $(NodeMajorVersion) -TaskVariableName 'FqNodejsVersion'
displayName: Calculate Node.js version Linux
workingDirectory: "$(Build.SourcesDirectory)/.dotnet"
env:
DOTNET_ROOT: "$(Build.SourcesDirectory)/.dotnet"
- task: Cache@2
displayName: Node.js Cache Linux
inputs:
# Wrap FqNodejsVersion in quotes to prevent it being interpreted as a file
key: 'nodejs | ${{ parameters.osGroup }} | ${{ parameters.architecture }} | "$(FqNodejsVersion)"'
path: $(HelixNodejsPayloadPath)

- script: |
pwsh ../eng/helix/InstallNodejs.ps1 -Version $(FqNodejsVersion) -Architecture ${{ parameters.architecture }} -DestinationFolder "$(HelixNodejsPayloadPath)"
displayName: Hydrate Node.js Installation Linux
workingDirectory: "$(Build.SourcesDirectory)/.dotnet"
env:
DOTNET_ROOT: "$(Build.SourcesDirectory)/.dotnet"
- ${{ else }}:
- pwsh: eng/helix/GetNodejsVersion.ps1
-MajorVersion $(NodeMajorVersion)
-TaskVariableName 'FqNodejsVersion'
displayName: Calculate Node.js version Non-Linux

- task: Cache@2
displayName: Node.js Cache Non-Linux
inputs:
# Wrap FqNodejsVersion in quotes to prevent it being interpreted as a file
key: 'nodejs | ${{ parameters.osGroup }} | ${{ parameters.architecture }} | "$(FqNodejsVersion)"'
path: $(HelixNodejsPayloadPath)

- pwsh: eng/helix/InstallNodejs.ps1
-Version $(FqNodejsVersion)
-Architecture ${{ parameters.architecture }}
-DestinationFolder "$(HelixNodejsPayloadPath)"
displayName: Hydrate Node.js Installation Non-Linux

- ${{ else }}:
- ${{ if ne(parameters.osGroup, 'Windows') }}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.FunctionProbes;
using Microsoft.Diagnostics.Monitoring.HostingStartup.ParameterCapturing.Pipeline;
using Microsoft.Diagnostics.Monitoring.StartupHook;
using Microsoft.Diagnostics.Monitoring.StartupHook.Monitoring;
using Microsoft.Diagnostics.Tools.Monitor.ParameterCapturing;
using Microsoft.Diagnostics.Tools.Monitor.Profiler;
using Microsoft.Diagnostics.Tools.Monitor.StartupHook;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.Diagnostics.Monitoring.WebApi
{
internal class StorageOptions
public class StorageOptions
{
[Display(
ResourceType = typeof(OptionsDisplayStrings),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.Diagnostics.Monitoring.StartupHook.Exceptions;
using Microsoft.Diagnostics.Monitoring.StartupHook.Monitoring;
using Microsoft.Diagnostics.Tools.Monitor;
using Microsoft.Diagnostics.Tools.Monitor.HostingStartup;
using Microsoft.Diagnostics.Tools.Monitor.Profiler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.


using Microsoft.Diagnostics.Monitoring.StartupHook.Monitoring;
using System;
using System.Collections.Generic;
using System.IO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.


using Microsoft.Diagnostics.Monitoring.StartupHook.Monitoring;
using Microsoft.Diagnostics.Tools.Monitor.Profiler;
using System;
using System.Runtime.InteropServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Microsoft.Diagnostics.Monitoring.WebApi
{
internal static class AuthConstants
public static class AuthConstants
{
public const string PolicyName = "AuthorizedUserPolicy";
public const string NegotiateSchema = "Negotiate";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.Diagnostics.Monitoring.WebApi
{
internal static class ContentTypes
public static class ContentTypes
{
public const string ApplicationJson = "application/json";
public const string ApplicationJsonSequence = "application/json-seq";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;
Expand All @@ -10,34 +11,38 @@ namespace Microsoft.Diagnostics.Monitoring.WebApi.Controllers
{
public abstract class DiagnosticsControllerBase : ControllerBase
{
protected DiagnosticsControllerBase(IServiceProvider serviceProvider, ILogger logger) :
this(serviceProvider.GetRequiredService<IDiagnosticServices>(), serviceProvider.GetRequiredService<EgressOperationStore>(), logger)
{ }

private protected DiagnosticsControllerBase(IDiagnosticServices diagnosticServices, EgressOperationStore operationStore, ILogger logger)
{
DiagnosticServices = diagnosticServices ?? throw new ArgumentNullException(nameof(diagnosticServices));
OperationStore = operationStore ?? throw new ArgumentNullException(nameof(operationStore));
Logger = logger ?? throw new ArgumentNullException(nameof(logger));
}

private protected Task<ActionResult> InvokeForProcess(Func<IProcessInfo, ActionResult> func, ProcessKey? processKey, string artifactType = null)
protected Task<ActionResult> InvokeForProcess(Func<IProcessInfo, ActionResult> func, ProcessKey? processKey, string artifactType = null)
{
Func<IProcessInfo, Task<ActionResult>> asyncFunc =
processInfo => Task.FromResult(func(processInfo));

return InvokeForProcess(asyncFunc, processKey, artifactType);
}

private protected async Task<ActionResult> InvokeForProcess(Func<IProcessInfo, Task<ActionResult>> func, ProcessKey? processKey, string artifactType)
protected async Task<ActionResult> InvokeForProcess(Func<IProcessInfo, Task<ActionResult>> func, ProcessKey? processKey, string artifactType)
{
ActionResult<object> result = await InvokeForProcess<object>(async processInfo => await func(processInfo), processKey, artifactType);

return result.Result;
}

private protected Task<ActionResult<T>> InvokeForProcess<T>(Func<IProcessInfo, ActionResult<T>> func, ProcessKey? processKey, string artifactType = null)
protected Task<ActionResult<T>> InvokeForProcess<T>(Func<IProcessInfo, ActionResult<T>> func, ProcessKey? processKey, string artifactType = null)
{
return InvokeForProcess(processInfo => Task.FromResult(func(processInfo)), processKey, artifactType);
}

private protected async Task<ActionResult<T>> InvokeForProcess<T>(Func<IProcessInfo, Task<ActionResult<T>>> func, ProcessKey? processKey, string artifactType = null)
protected async Task<ActionResult<T>> InvokeForProcess<T>(Func<IProcessInfo, Task<ActionResult<T>>> func, ProcessKey? processKey, string artifactType = null)
{
IDisposable artifactTypeRegistration = null;
if (!string.IsNullOrEmpty(artifactType))
Expand Down Expand Up @@ -68,7 +73,7 @@ private protected async Task<ActionResult<T>> InvokeForProcess<T>(Func<IProcessI
}
}

private protected async Task<ActionResult> Result(
protected async Task<ActionResult> Result(
string artifactType,
string providerName,
IArtifactOperation operation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public sealed class ExceptionsController :
public ExceptionsController(
IServiceProvider serviceProvider,
ILogger<ExceptionsController> logger)
: base(serviceProvider.GetRequiredService<IDiagnosticServices>(), serviceProvider.GetRequiredService<EgressOperationStore>(), logger)
: base(serviceProvider, logger)
{
_options = serviceProvider.GetRequiredService<IOptions<ExceptionsOptions>>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Microsoft.Diagnostics.Monitoring.WebApi
{
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
internal sealed class EgressValidationAttribute : ActionFilterAttribute, IFilterFactory
public sealed class EgressValidationAttribute : ActionFilterAttribute, IFilterFactory
{
public bool IsReusable => true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

namespace Microsoft.Diagnostics.Monitoring.WebApi
{
internal interface IEndpointInfo
public interface IEndpointInfo
{
IpcEndpoint Endpoint { get; }
internal IpcEndpoint Endpoint { get; }

int ProcessId { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.Diagnostics.Monitoring.WebApi
/// To do this, we determine what port the request is on, and disallow other actions on the prometheus port.
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
internal sealed class HostRestrictionAttribute : Attribute, IActionConstraintFactory
public sealed class HostRestrictionAttribute : Attribute, IActionConstraintFactory
{
private sealed class HostConstraint : IActionConstraint
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.Diagnostics.Monitoring.WebApi
/// Represents an operation that can produce a diagnostic
/// artifact to the provided output stream.
/// </summary>
internal interface IArtifactOperation : IStartable
public interface IArtifactOperation : IStartable
{
/// <summary>
/// Produces a diagnostic artifact to the output stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal interface IDiagnosticServices
Task<IProcessInfo> GetProcessAsync(ProcessKey? processKey, CancellationToken token);
}

internal interface IProcessInfo
public interface IProcessInfo
{
IEndpointInfo EndpointInfo { get; }

Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Diagnostics.Monitoring.WebApi/IStartable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.Diagnostics.Monitoring.WebApi
{
internal interface IStartable
public interface IStartable
{
Task Started { get; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Microsoft.Diagnostics.Monitoring.WebApi
// - Event Log Logger: checks for IEnumerable<KeyValuePair<string, object>> and formats each value
// in the enumeration; otherwise falls back to ToString.
// - Structured Logger: expects a IReadOnlyList<KeyValuePair<string, object>> and formats each value in the enumeration.
internal class KeyValueLogScope : IReadOnlyList<KeyValuePair<string, object>>
public class KeyValueLogScope : IReadOnlyList<KeyValuePair<string, object>>
{
public List<KeyValuePair<string, object>> Values = new();

Expand Down
Loading

0 comments on commit 817cd10

Please sign in to comment.