fix: host.arch reports real CPU arch, not the hostname (#90)#91
Merged
Conversation
The IO resource detector copy-pasted Platform.localHostname into host.arch. Resolve the real architecture (amd64/arm64/arm32/x86/riscv*) from Platform.version's 'on "<os>_<arch>"' tail, mapped to registry values; omit when unparseable. Also key every attribute from the generated registry enums (Host.*, Os.*, ProcessAttributes.*) instead of string literals so a mistyped key is a compile error — the exact bug class behind #90 — and correct the malformed host.os.name to os.name. Drop host.processors, host.locale, and process.num_threads: none are OTel registry attributes. Fixes #90. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #90.
The bug
The IO resource detector copy-pasted
Platform.localHostnameintohost.arch, so every VM-platform resource carried e.g.host.arch: "my-macbook"instead of the CPU architecture. Backends selecting per-architecture artifacts off the resource (debug symbols for native crash symbolication) got junk to key on.Fix
host.archfromPlatform.version'son "<os>_<arch>"tail, mapped to registry values (amd64/arm64/arm32/x86/riscv*); omit the attribute when unparseable. Pure Dart, nodart:ffi.Host.*,Os.*,ProcessAttributes.*) rather than string literals — a mistyped key is now a compile error, which is exactly the bug class that produced IO resource detector sets host.arch to the hostname #90. This also caught a second literal bug: the malformedhost.os.nameis corrected to the registryos.name.host.processors,host.locale, andprocess.num_threads— none are OTel registry attributes (verified against the v1.43.0+21 model). Their tests are removed with them.Verification
resource_detector_test.dart: 32 pass (host.archnow asserted to be a registry arch value and not the hostname). Analyze clean. The 2 failures incontext_propagation_teston the full suite are pre-existing flaky collector-integration tests (timeouts / double-init), unrelated to this change.🤖 Generated with Claude Code