Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example extension to egress data to Azure #1953

Merged

Conversation

kelltrick
Copy link
Contributor

Adds code to accept data from extension interface and egress to Azure.

@kelltrick kelltrick requested a review from wiktork June 1, 2022 20:15
@kelltrick kelltrick requested a review from a team as a code owner June 1, 2022 20:15
src/Tools/AzureBlobStorage/AzureBlobStorage.csproj Outdated Show resolved Hide resolved
src/Tools/AzureBlobStorage/AzureBlobStorage.csproj Outdated Show resolved Hide resolved
src/Tools/AzureBlobStorage/AzureBlobStorage.csproj Outdated Show resolved Hide resolved
src/Tools/AzureBlobStorage/AzureBlobStorage.csproj Outdated Show resolved Hide resolved
src/Tools/AzureBlobStorage/Program.cs Outdated Show resolved Hide resolved
src/Tools/AzureBlobStorage/Program.cs Outdated Show resolved Hide resolved
src/Tools/AzureBlobStorage/Program.cs Outdated Show resolved Hide resolved
src/Tools/AzureBlobStorage/AzureBlobStorage.csproj Outdated Show resolved Hide resolved
src/Tools/AzureBlobStorage/AzureBlobStorage.csproj Outdated Show resolved Hide resolved
@kelltrick
Copy link
Contributor Author

Here is the setup I've been testing with:

  1. Compile dotnet-monitor.sln
  2. Copy [dotnet-monitor]\artifacts\bin\AzureBlobStorage\Debug\net6.0 to [dotnet-monitor]\artifacts\bin\dotnet-monitor\Debug\net6.0\extensions\azure-storage
  3. Install these settings:
{
    "$schema": "https://aka.ms/dotnet-monitor-schema",

    "DiagnosticPort": {
        "ConnectionMode": "Listen",
        "EndpointName": "dotnetmonitorpipe"
    },

    "DefaultProcess": {
        "Filters": [
            {
                "ProcessName": "AllocationTestApp"
            }
        ]
    },
    "Egress": {
        "AzureBlobStorage": {
            "monitorBlob": {
                "AccountKeyName": "AzAccountKey",
                "AccountUri": "https://pafenelodnmegress.blob.core.windows.net",
                "ContainerName": "dotnet-monitor",
                "BlobPrefix": "artifact"
            }
        },
        "FileSystem": {
            "localFile": {
                "DirectoryPath": "C:\\scratch"
            }
        },
        "Properties": {
            "AzAccountKey": "=====[REDACTED, this should be an Az Storage base 64 encoded key]======"
        },
        "azure-storage": {
            "azureTest": {
                "AccountKeyName": "AzAccountKey",
                "AccountUri": "https://pafenelodnmegress.blob.core.windows.net",
                "ContainerName": "dotnet-monitor",
                "BlobPrefix": "artifact"
            },
            "azure2Test": {
                "AccountKeyName": "AzAccountKey",
                "AccountUri": "https://companyblob.blob.core.windows.net",
                "ContainerName": "debugme",
                "BlobPrefix": "artifact"
            }
        },
        "AWS_S3": {
            "myBucketsEgress": {
                "AccountID": "sdfsdfhsldkf",
                "AccountKey": "foihj2930j0239r3322"
            }
        },
        "External": {
            "extTest": {}
        },
        "MyCustomProvider": {
            "custom": {}
        }
    }
}
  1. Launch a target debuggee app called AllocationTestApp.exe
  2. Launch dotnet-monitor collect --metrics false
  3. Call the http api https://localhost:56019/dump?type=WithHeap&egressProvider=azureTest
    [Observe dump getting egressed via external extension]

Copy link
Member

@wiktork wiktork left a comment

Choose a reason for hiding this comment

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

Left some feedback, but looks good otherwise.

@kelltrick
Copy link
Contributor Author

Todos after this PR gets done:

  1. @wiktork 's comment about when the Standard In stream gets assigned.

This is registered before StdInStream is assigned. Consider setting up the stream things upfront and then calling egress. This also removes the need for the GetStream function, which really should not be called from anywhere else.

  1. Double check that Console.ReadLine() will fully consume the \r\n Windows newline on a linux build. I want to make sure this isn't something special on WSL.

@kelltrick kelltrick merged commit 51df72b into dotnet:feature/egressExtension Jun 2, 2022
@kelltrick kelltrick deleted the dev/kelltrick/egressExtAz2 branch June 2, 2022 23:58
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.

3 participants