Skip to content

feat(telemetry): map INFORGE cloud/host resource attributes (ADR-0030)#24

Merged
pedromvgomes merged 1 commit into
mainfrom
feature/otel-cloud-resource-attrs
Jun 28, 2026
Merged

feat(telemetry): map INFORGE cloud/host resource attributes (ADR-0030)#24
pedromvgomes merged 1 commit into
mainfrom
feature/otel-cloud-resource-attrs

Conversation

@pedromvgomes

Copy link
Copy Markdown
Contributor

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 OTLP Resource (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():

env var resource attribute value (Hetzner)
INFORGE_HOST_TYPE host.type server-type SKU (e.g. cx23)
INFORGE_CLOUD_PROVIDER cloud.provider hetzner
INFORGE_CLOUD_REGION cloud.region Hetzner network_zone
INFORGE_CLOUD_AVAILABILITY_ZONE cloud.availability_zone Hetzner location

These 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.* / region rows). The change is therefore inert until inforge actually emits the new INFORGE_* vars, so it can merge ahead of, or independently of, inforge PR #148.

Tests

  • Extended resource_carries_the_inforge_identity_attributes to set the four new vars and assert the mapped attributes (with matching remove_var cleanup).
  • cargo test -p wardnet_common --lib telemetry → 6 passed.
  • cargo fmt -p wardnet_common --check clean; cargo clippy -p wardnet_common clean.

Merge Commit Message

feat(telemetry): map INFORGE cloud/host resource attributes (ADR-0030)

Wire the four new INFORGE_* env vars from inforge (ADR-0030 / PR #148) into the
OTLP resource so cloud/host attributes appear on every metric, trace, and log:
host.type, cloud.provider, cloud.region, cloud.availability_zone. Each mapping
is best-effort (a missing/empty var is omitted), matching the existing identity
rows, so the change is inert until inforge emits the vars and can merge
independently of the producer side.

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

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@pedromvgomes pedromvgomes merged commit 4efd515 into main Jun 28, 2026
15 checks passed
@pedromvgomes pedromvgomes deleted the feature/otel-cloud-resource-attrs branch June 28, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant