Skip to content

Add host.id to host resource attributes - #5653

Open
jaydeluca wants to merge 9 commits into
open-telemetry:mainfrom
jaydeluca:add-host-id
Open

jaydeluca wants to merge 9 commits into
open-telemetry:mainfrom
jaydeluca:add-host-id

Conversation

@jaydeluca

Copy link
Copy Markdown
Member

Description

Updates the existing host resource detector to include host.id as defined in https://opentelemetry.io/docs/specs/semconv/resource/host/
Fixes #5652

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Unit tests for some of the flows. Tested on my mac with a local small app:

image

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Comment thread opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py Outdated
Comment thread opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py Outdated
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 11, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-09-14 17:15 UTC

Respond to 2 review items (e.g. link a commit, explain why not, ask a follow-up):

  • Inline threads: 1, 2
Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

Comment thread opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py
@jaydeluca
jaydeluca marked this pull request as ready for review September 11, 2026 21:18
@jaydeluca
jaydeluca requested a review from a team as a code owner September 11, 2026 21:18
self.assertEqual(resource.attributes["telemetry.sdk.language"], "python")
self.assertIn(HOST_NAME, resource.attributes)

@patch("platform.system", lambda: "Linux")

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.

Can we add some integration tests that run the full detector and perform basic validation on the attributes? (at least for Linux and Windows which run in CI)

Comment thread docs/sdk/resources.rst
opentelemetry.sdk.resources package
==========================================

Host resource detection

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.

@emdneto emdneto added the Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary label Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Add host.id resource attribute detector

5 participants