Visitar URL original
detectors/hetzner: add Hetzner Cloud resource detector by paulojmdias · Pull Request #8979 · open-telemetry/opentelemetry-go-contrib · GitHub
Skip to content

detectors/hetzner: add Hetzner Cloud resource detector - #8979

Merged
dashpole merged 9 commits into
open-telemetry:mainfrom
paulojmdias:feat/8962
May 13, 2026
Merged

dashpole merged 9 commits into
open-telemetry:mainfrom
paulojmdias:feat/8962

Conversation

@paulojmdias

@paulojmdias paulojmdias commented May 11, 2026 •

Copy link
Copy Markdown
Member

Ports the Hetzner Cloud resource detector from processor/resourcedetectionprocessor/internal/hetzner in
opentelemetry-collector-contrib to a new standalone Go module go.opentelemetry.io/contrib/detectors/hetzner.

Detected attributes:

  • cloud.provider
  • cloud.platform
  • cloud.region
  • cloud.availability_zone
  • host.id
  • host.name

Returns resource.Empty(), nil when not running on a Hetzner Cloud server. Returns a partial resource and resource.ErrPartialResource if the platform is detected but individual metadata endpoints fail.

Also registers the detector in detectors/autodetect as IDHetzner ("hetzner").

I'm proposing to be a codeowner of this detector as I am currently on the collector-contrib side.

Fixes #8962.
Relates #8940.

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
@paulojmdias
paulojmdias marked this pull request as ready for review May 11, 2026 21:48
@paulojmdias

Copy link
Copy Markdown
Member Author

\cc @dashpole @iblancasa

If any of you want to be a codeowner with me here, please let me know, and I will update the codeowners list.

@codecov

codecov Bot commented May 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.38462% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.5%. Comparing base (befc4c0) to head (0dc412a).

Files with missing lines Patch % Lines
detectors/hetzner/hetzner.go 93.6% 1 Missing and 2 partials ⚠️
detectors/hetzner/version.go 50.0% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #8979     +/-   ##
=======================================
- Coverage   83.6%   83.5%   -0.1%     
=======================================
  Files        193     195      +2     
  Lines      15910   15962     +52     
=======================================
+ Hits       13301   13337     +36     
- Misses      2137    2151     +14     
- Partials     472     474      +2     
Files with missing lines Coverage Δ
detectors/autodetect/autodetect.go 86.1% <100.0%> (+0.1%) ⬆️
detectors/hetzner/version.go 50.0% <50.0%> (ø)
detectors/hetzner/hetzner.go 93.6% <93.6%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dashpole
dashpole requested a review from Copilot May 12, 2026 15:30
@dashpole dashpole self-assigned this May 12, 2026
Comment thread detectors/hetzner/hetzner.go Resolved
Comment thread detectors/hetzner/README.md Resolved
Comment thread detectors/hetzner/README.md Resolved
Comment thread detectors/hetzner/version.go Resolved
@dashpole

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Hetzner Cloud resource detector module to opentelemetry-go-contrib, ported from the Collector Contrib implementation, and wires it into the detectors/autodetect registry so SDK users can enable Hetzner detection via autodetection.

Changes:

  • Introduces go.opentelemetry.io/contrib/detectors/hetzner (implementation, README, versioning, and tests).
  • Registers the Hetzner detector in detectors/autodetect as IDHetzner ("hetzner") and adds the dependency.
  • Updates repo metadata/docs (CODEOWNERS, CHANGELOG.md) for ownership and release notes.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
detectors/hetzner/hetzner.go Implements the Hetzner Cloud metadata-based resource.Detector.
detectors/hetzner/hetzner_test.go Adds unit tests with a fake metadata server for success/not-on-platform/partial-failure cases.
detectors/hetzner/README.md Documents installation, usage, and emitted attributes.
detectors/hetzner/version.go Adds module version helpers consistent with other detectors.
detectors/hetzner/version_test.go Verifies the version string is semver-shaped.
detectors/hetzner/go.mod Declares the new standalone module and dependencies.
detectors/hetzner/go.sum Records dependency checksums for the new module.
detectors/autodetect/autodetect.go Adds IDHetzner and registers the detector factory.
detectors/autodetect/go.mod Adds a dependency on the new hetzner detector module and a local replace.
detectors/autodetect/go.sum Updates sums due to new transitive dependencies.
CODEOWNERS Adds code ownership for detectors/hetzner/.
CHANGELOG.md Adds an entry announcing the new Hetzner detector module.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread detectors/autodetect/go.mod Resolved
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
…ontrib into feat/8962

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
@paulojmdias

Copy link
Copy Markdown
Member Author

@dashpole thanks for the review. I think I addressed everything properly, PTAL when you have a chance 🙏

@MrAlias MrAlias left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The earlier feedback around options, docs/examples, and release/versioning wiring appears to be addressed, and the new detector is integrated consistently with the existing detector modules.

Comment thread detectors/hetzner/hetzner.go Resolved
Comment thread detectors/hetzner/example_test.go Resolved
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
…ontrib into feat/8962

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
@paulojmdias

Copy link
Copy Markdown
Member Author

Can this be merged? I would like ensure everything is correct before moving with the other detectors 🙏

@dashpole
dashpole merged commit ba143fc into open-telemetry:main May 13, 2026
30 checks passed
@paulojmdias
paulojmdias deleted the feat/8962 branch May 13, 2026 20:59
@pellared pellared added this to the v1.44.0 milestone May 27, 2026
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.

[detectors/hetzner] Contribute hetzner detector from resourcedetectionprocessor

5 participants