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

Azure receiver not azure china #34315

Closed
mo-silent opened this issue Jul 30, 2024 · 3 comments
Closed

Azure receiver not azure china #34315

mo-silent opened this issue Jul 30, 2024 · 3 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request receiver/azuremonitor

Comments

@mo-silent
Copy link
Contributor

mo-silent commented Jul 30, 2024

Component(s)

receiver/azuremonitor

What happened?

Description

When I use azure monitorreceiver, I find that it does not work with azure china, and in the source code, I see that azure china is not defined
I would love to be able to use azure china.
As follows code:

func (s *azureScraper) getArmClientOptions() *arm.ClientOptions {
	var cloudToUse cloud.Configuration
	switch s.cfg.Cloud {
	case azureGovernmentCloud:
		cloudToUse = cloud.AzureGovernment
        // Add the following code
        case azureChinaCloud:
		cloudToUse = cloud.AzureChina
        // --------------
	default:
		cloudToUse = cloud.AzurePublic
	}
	options := arm.ClientOptions{
		ClientOptions: azcore.ClientOptions{
			Cloud: cloudToUse,
		},
	}

	return &options
}

Collector version

laster

Environment information

Environment

OS: dokcer

OpenTelemetry Collector configuration

No response

Log output

error: reply status code was 400:\n{\"error\":\"invalid_resource\",\"error_description\":\"AADSTS500011: The resource principal named https://management.core.windows.net/ was not found in the tenant named Procter & Gamble Guangzhou. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant.

Additional context

No response

@mo-silent mo-silent added bug Something isn't working needs triage New item requiring triage labels Jul 30, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@JaredTan95
Copy link
Member

I think you're getting close to a final solution, can you try to contribute?

@JaredTan95 JaredTan95 added enhancement New feature or request and removed needs triage New item requiring triage labels Jul 31, 2024
@mo-silent
Copy link
Contributor Author

Sure, I can.

mo-silent added a commit to mo-silent/opentelemetry-collector-contrib that referenced this issue Jul 31, 2024
**Description:**

Adding azure china in azure monitor receiver.

**Link to tracking Issue:**

open-telemetry#34315
f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this issue Sep 12, 2024
Fixes open-telemetry#34315

---------

Co-authored-by: Curtis Robert <crobert@splunk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request receiver/azuremonitor
Projects
None yet
Development

No branches or pull requests

2 participants