azure-dev icon indicating copy to clipboard operation
azure-dev copied to clipboard

Add telemetry upload functionality

Open weikanglim opened this issue 2 years ago • 1 comments

Add uploader that reads the telemetry storage queue and uploads telemetry. Also includes some surrounding functionality so that we can test the full telemetry pipeline. Fixes #458

The telemetry pipeline looks like:

  1. Telemetry is emitted using an OTel tracer. The tracer is configured to use our storage exporter. (telemetry.go)
  2. Traces are exported by our storage exporter. Traces are serialized in AppInsights format, then stored on disk. (storage_exporter.go)
  3. In a separate background process, we run the background upload process via RunBackgroundUpload (telemetry.go). Our Uploader is invoked to upload items in the queue. (uploader.go)

The full telemetry pipeline (with telemetry queue mocked out as an in-memory queue) is tested in uploader_test.go.

weikanglim avatar Aug 22 '22 23:08 weikanglim

Azure Dev CLI Install Instructions

Install scripts

MacOS/Linux

May elevate using sudo on some platforms and configurations

bash:

curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/510/uninstall-azd.sh | bash;
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/510/install-azd.sh | bash -s -- --base-url https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/510 --version '' --verbose

pwsh:

Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/510/uninstall-azd.ps1' -OutFile uninstall-azd.ps1; ./uninstall-azd.ps1
Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/510/install-azd.ps1' -OutFile install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/510' -Version '' -Verbose

Windows

powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/510/uninstall-azd.ps1' > uninstall-azd.ps1; ./uninstall-azd.ps1;"
powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/510/install-azd.ps1' > install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/510' -Version '' -Verbose;"

Standalone Binary

  • Linux - https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/510/azd-linux-amd64.tar.gz
  • MacOS - https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/510/azd-darwin-amd64.zip
  • Windows - https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/510/azd-windows-amd64.zip

Container

docker run -it azdevcliextacr.azurecr.io/azure-dev:pr-510

azure-sdk avatar Aug 26 '22 18:08 azure-sdk

Ended up fixing #513 since it came up in review comments.

weikanglim avatar Aug 26 '22 19:08 weikanglim