Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: snapshot reporting use HTTP_PROXY and HTTPS_PROXY env vars #1954

Conversation

shazlehu
Copy link
Contributor

@shazlehu shazlehu commented Nov 11, 2024

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 for observiq-otel-collector

HTTP_PROXY=http://bp-qa-ub-proxy.bluemedora.localnet:9094
HTTPS_PROXYhttp://bp-qa-ub-proxy.bluemedora.localnet:9094
image

Restart the collector using Services.

For macOS agent:

Add HTTP_PROXY and HTTPS_PROXY to the EnvironmentVariables dict in the launchd service file /Library/LaunchDaemons/com.observiq.collector.plist (other values are shown for context):

<key>EnvironmentVariables</key>
<dict>
    <key>HTTP_PROXY</key>
    <string>http://bp-qa-ub-proxy.bluemedora.localnet:9094</string>    
    <key>HTTPS_PROXY</key>
    <string>http://bp-qa-ub-proxy.bluemedora.localnet:9094</string>    
    <key>OIQ_OTEL_COLLECTOR_HOME</key>
    <string>/opt/observiq-otel-collector/</string>
    <key>OIQ_OTEL_COLLECTOR_STORAGE</key>
    <string>/opt/observiq-otel-collector/storage</string>
</dict>

Then restart the agent:

sudo launchctl unload /Library/LaunchDaemons/com.observiq.collector.plist
sudo launchctl load /Library/LaunchDaemons/com.observiq.collector.plist
Checklist
  • Changes are tested
  • CI has passed

@shazlehu shazlehu requested review from dpaasman00 and a team as code owners November 11, 2024 20:03
@shazlehu shazlehu changed the base branch from release/v1.64.0 to release/v1.65.0 November 14, 2024 14:25
@shazlehu shazlehu force-pushed the samhazlehurst/bpop-1162-agent-proxy-snapshots-do-not-use-the-configured-proxy branch from 45620f9 to 25b9dc0 Compare November 14, 2024 17:03
@shazlehu shazlehu force-pushed the samhazlehurst/bpop-1162-agent-proxy-snapshots-do-not-use-the-configured-proxy branch from 25b9dc0 to 8789a6c Compare November 14, 2024 17:12
Copy link
Contributor

@dpaasman00 dpaasman00 left a comment

Choose a reason for hiding this comment

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

LGTM - verified good behavior on linux

…xy-snapshots-do-not-use-the-configured-proxy
@shazlehu shazlehu merged commit 1829e93 into release/v1.65.0 Nov 19, 2024
15 checks passed
@shazlehu shazlehu deleted the samhazlehurst/bpop-1162-agent-proxy-snapshots-do-not-use-the-configured-proxy branch November 19, 2024 18:53
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.

2 participants