Internal - Remove Host Name from Settings URL#542
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the agent’s settings-fetch behavior to remove the host name from the /v1/settings URL path, aligning the client with the collector endpoint contract (/v1/settings/{service}) and decoupling settings retrieval from host identity.
Changes:
- Simplified
HttpSettingsReadersettings URL construction to omit the hostname segment. - Removed
HOST_NAMEemission fromHostIdResourceUtilidentity attributes. - Updated
HttpSettingsReaderTestexpectations and removed now-unneeded resource/hostname mocking.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
custom/src/main/java/com/solarwinds/opentelemetry/extensions/config/HttpSettingsReader.java |
Removes hostname from the settings URL path and updates related debug logging. |
custom/src/main/java/com/solarwinds/opentelemetry/extensions/config/HostIdResourceUtil.java |
Stops adding host.name to the generated resource attributes. |
custom/src/test/java/com/solarwinds/opentelemetry/extensions/config/HttpSettingsReaderTest.java |
Updates URL assertions to match the new endpoint shape and simplifies test setup accordingly. |
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
The agent's
getSettingsHTTP call previously appended the hostname as a path segment (/v1/settings/{service}/{hostname}). This change removes the hostname from that URL, making the endpoint/v1/settings/{service}.What changed
Settings URL path simplified
The
HttpSettingsReaderno longer looks up the host name fromResourceArbiterto embed it in the settings URL. TheHOST_NAMEattribute was being read from the resolved OTel resource and appended as a trailing path segment, tying settings fetches to host identity at the URL level. Removing it decouples settings retrieval from host identity.HostIdResourceUtilno longer emitsHOST_NAMEThe same attribute was being injected into the resource identity map built by
HostIdResourceUtil. That line is removed, so the host name is no longer part of the identity attributes contributed by this utility.Rationale
The collector's
/v1/settingsendpoint does not require the hostname in the path as of current specification.Test services data