Skip to content

Commit

Permalink
fix Azure receiver not azure china open-telemetry#34315
Browse files Browse the repository at this point in the history
**Description:**

Adding azure china in azure monitor receiver.

**Link to tracking Issue:**

open-telemetry#34315
  • Loading branch information
mo-silent committed Jul 31, 2024
1 parent b418e59 commit a8f30df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion receiver/azuremonitorreceiver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
const (
azureCloud = "AzureCloud"
azureGovernmentCloud = "AzureUSGovernment"
azureChinaCloud = "AzureChinaCloud"
)

var (
Expand Down Expand Up @@ -292,7 +293,7 @@ func (c Config) Validate() (err error) {
return fmt.Errorf("authentication %v is not supported. supported authentications include [%v,%v,%v,%v]", c.Authentication, servicePrincipal, workloadIdentity, managedIdentity, defaultCredentials)
}

if c.Cloud != azureCloud && c.Cloud != azureGovernmentCloud {
if c.Cloud != azureCloud && c.Cloud != azureGovernmentCloud && c.Cloud != azureChinaCloud {
err = multierr.Append(err, errInvalidCloud)
}

Expand Down
2 changes: 2 additions & 0 deletions receiver/azuremonitorreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ func (s *azureScraper) getArmClientOptions() *arm.ClientOptions {
switch s.cfg.Cloud {
case azureGovernmentCloud:
cloudToUse = cloud.AzureGovernment
case azureChinaCloud:
cloudToUse = cloud.AzureChina
default:
cloudToUse = cloud.AzurePublic
}
Expand Down

0 comments on commit a8f30df

Please sign in to comment.