Skip to content

Commit

Permalink
Add more dimensions to telemetry (#1337)
Browse files Browse the repository at this point in the history
Add more dimensions to telemetry

Related to #1305
  • Loading branch information
aholstrup1 authored Nov 26, 2024
1 parent b709a31 commit b436adf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Actions/TelemetryHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function AddTelemetryEvent()

### Add GitHub Repository information
Add-TelemetryProperty -Hashtable $Data -Key 'Repository' -Value $ENV:GITHUB_REPOSITORY_ID
Add-TelemetryProperty -Hashtable $Data -Key 'RepositoryOwnerID' -Value $ENV:GITHUB_REPOSITORY_OWNER_ID

$repoSettings = ReadSettings
if ($repoSettings.microsoftTelemetryConnectionString -ne '') {
Expand All @@ -84,6 +85,11 @@ function AddTelemetryEvent()
$MicrosoftTelemetryClient.Flush()
}

### Add telemetry that is only sent to the partner
Add-TelemetryProperty -Hashtable $Data -Key 'RepositoryOwner' -Value $ENV:GITHUB_REPOSITORY_OWNER
Add-TelemetryProperty -Hashtable $Data -Key 'RepositoryName' -Value $ENV:GITHUB_REPOSITORY
Add-TelemetryProperty -Hashtable $Data -Key 'RefName' -Value $ENV:GITHUB_REF_NAME

if ($repoSettings.partnerTelemetryConnectionString -ne '') {
Write-Host "Enabling partner telemetry..."
$PartnerTelemetryClient = Get-ApplicationInsightsTelemetryClient -TelemetryConnectionString $repoSettings.partnerTelemetryConnectionString
Expand Down

0 comments on commit b436adf

Please sign in to comment.