fix: snapshot reporting use HTTP_PROXY and HTTPS_PROXY env vars #1954
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.
Proposed Change
The AgentClient wrapper around http.Client (used to add headers to snapshot reports) didn't include a proxy setting in its Transport, so snapshots failed in environments configured with a proxy and without DNS access, specifically for Windows.
Testing
We have a proxy configured on the localnet at bp-qa-ub-proxy.bluemedora.localnet:9094
See https://observiq.com/docs/advanced-setup/configuration/proxy for setting up an agent with a proxy. The current agent will create an error when the snapshot console is opened in BP, with this PR snapshot should appear normally.
For Windows:
Using regedit, add to the
Environment
key forobserviq-otel-collector
Restart the collector using
Services
.For macOS agent:
Add
HTTP_PROXY
andHTTPS_PROXY
to theEnvironmentVariables
dict in the launchd service file/Library/LaunchDaemons/com.observiq.collector.plist
(other values are shown for context):Then restart the agent:
Checklist