Skip to content

NH-138965 draft: make resource as a separate lib for joboe#518

Closed
xuan-cao-swi wants to merge 1 commit into
mainfrom
azure-metadata-upstream-resource
Closed

NH-138965 draft: make resource as a separate lib for joboe#518
xuan-cao-swi wants to merge 1 commit into
mainfrom
azure-metadata-upstream-resource

Conversation

@xuan-cao-swi

@xuan-cao-swi xuan-cao-swi commented Jun 12, 2026

Copy link
Copy Markdown

Tl;dr:

Using azure-resource detector for fetching all azure related metadata and map to HostId.AzureVmMetadata

Context:

With this approach, it will avoid the no class found for CloudResourceProvider due to SPI.

azure-resource seems explicitly designed for autoconfigure (e.g. declarative configuration).

Although it will increase the agent (jar) size, and may violate apm-java convention that only do compileOnly for third-party library.

Test Plan:

Standard unit test

Test services data

  1. e-2325544509411880452

@cheempz

cheempz commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

I looked a bit more and it seems the trick to getting things to work is setting OTEL_RESOURCE_PROVIDERS_AZURE_ENABLED=true.

Longer story: our distro bundles the upstream agent, which does include the azure resource detector. I updated your test app service with the current apm-java GA release and set the env var, the resulting traces (under xuan-test-java-app-services) do show resource attributes described in https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/azure-resources. Will update the Jira with points of improvement but can wait for Chubi to tackle those.

@cheempz cheempz changed the title draft: make resource as a separate lib for joboe NH-138965 draft: make resource as a separate lib for joboe Jun 16, 2026
@xuan-cao-swi

xuan-cao-swi commented Jun 16, 2026

Copy link
Copy Markdown
Author

Thanks! I think this separate resources is no longer needed?

@cheempz

cheempz commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Thanks! I think this separate resources is no longer needed?

Yep, i'll close this PR.

@cheempz cheempz closed this Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants