feat(telemetry): map INFORGE cloud/host resource attributes (ADR-0030)#24
Merged
Merged
Conversation
Wire the four new INFORGE_* env vars from inforge into the OTLP resource so cloud/host attributes appear on every metric, trace, and log: INFORGE_HOST_TYPE -> host.type INFORGE_CLOUD_PROVIDER -> cloud.provider INFORGE_CLOUD_REGION -> cloud.region INFORGE_CLOUD_AVAILABILITY_ZONE -> cloud.availability_zone Each mapping is best-effort (a missing/empty var is omitted), matching the existing identity-attribute rows, so this is inert until inforge emits the vars and can merge independently of the producer side.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
Consumer side of inforge ADR-0030 / inforge PR #148 (wardnet/inforge#148). The producer side now injects four new
INFORGE_*env vars into every service; this wires them into the cloud-side OTLPResource(crates/common/src/telemetry.rs) so the attributes actually land on metrics, traces, and logs in Grafana Cloud.New mappings added alongside the existing identity-attribute rows in
resource():INFORGE_HOST_TYPEhost.typecx23)INFORGE_CLOUD_PROVIDERcloud.providerhetznerINFORGE_CLOUD_REGIONcloud.regionnetwork_zoneINFORGE_CLOUD_AVAILABILITY_ZONEcloud.availability_zoneThese let Grafana Cloud queries slice app telemetry by cloud region / AZ / machine-type, and they match the resource attributes inforge's host VM-metrics collector (ADR-0031) stamps — so host metrics and app telemetry correlate on
host.id.Safe to merge independently
Each mapping is best-effort: a missing or empty env var is simply omitted (same pattern as the existing
service.*/host.id/deployment.*/regionrows). The change is therefore inert until inforge actually emits the newINFORGE_*vars, so it can merge ahead of, or independently of, inforge PR #148.Tests
resource_carries_the_inforge_identity_attributesto set the four new vars and assert the mapped attributes (with matchingremove_varcleanup).cargo test -p wardnet_common --lib telemetry→ 6 passed.cargo fmt -p wardnet_common --checkclean;cargo clippy -p wardnet_commonclean.Merge Commit Message