Skip to content

Feature/add proxy support#152

Merged
derrick-dacosta merged 3 commits into
mainfrom
feature/add-proxy-support
Oct 22, 2025
Merged

Feature/add proxy support#152
derrick-dacosta merged 3 commits into
mainfrom
feature/add-proxy-support

Conversation

@derrick-dacosta
Copy link
Copy Markdown
Collaborator

@derrick-dacosta derrick-dacosta commented Sep 11, 2025

Testing results

docker compose.yml

services:
  redfish:
    image: dmtf/redfish-mockup-server:latest
    container_name: redfish
    command:
      - "-s"
      - "--cert=/server.crt"
      - "--key=/private.key"
    ports:
      - "8000:8000"
    restart: unless-stopped
    volumes:
      - ./private.key:/private.key
      - ./server.crt:/server.crt

  squid:
    image: ubuntu/squid:latest
    container_name: squid_proxy
    ports:
      - "3128:3128"
    restart: unless-stopped
    volumes:
      - ./squid.conf:/etc/squid/squid.conf:ro
    environment:
      - TZ=UTC

fishymetrics command

curl 'http://localhost:10023/scrape?target=https://redfish:8000&model=redfish-mockup&proxy_host=localhost:3128'

fishymetrics logs

% go run cmd/fishymetrics/*.go --insecure-skip-verify
{"level":"info","ts":"2025-09-11T10:36:18-04:00","caller":"fishymetrics/main.go:310","msg":"started fishymetrics service","app":"fishymetrics","host":"..."}
{"level":"info","ts":"2025-09-11T10:36:21-04:00","caller":"handlers/scrape.go:90","msg":"started scrape","app":"fishymetrics","host":"...","model":"redfish-mockup","target":"https://redfish:8000","credential_profile":"","trace_id":"ms4vcwzunuui7d1fbt1hyg4ivun49yqx"}
{"level":"info","ts":"2025-09-11T10:36:22-04:00","caller":"logging/logging.go:53","msg":"finished handling","app":"fishymetrics","host":"...","model":"redfish-mockup","target":"https://redfish:8000","sourceAddr":"127.0.0.1:52321","method":"GET","url":"/scrape?target=https://redfish:8000&model=redfish-mockup&proxy_host=localhost:3128","proto":"HTTP/1.1","status":200,"elapsed_time_sec":1.335071417,"trace_id":"ms4vcwzunuui7d1fbt1hyg4ivun49yqx"}

This commit adds support for routing Redfish requests through HTTP(S) proxies using standard HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables. Proxies can be configured via env vars or Helm chart values.

The change refactors HTTP client initialization to handle proxies consistently across full scrapes, partial scrapes, and Moonshot scraping. It also adds comprehensive test coverage around proxy functionality.
@derrick-dacosta derrick-dacosta linked an issue Sep 11, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator

@ibrahimkk-moideen ibrahimkk-moideen left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Copy Markdown
Collaborator

@ibrahimkk-moideen ibrahimkk-moideen left a comment

Choose a reason for hiding this comment

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

LGTM.

@derrick-dacosta derrick-dacosta merged commit 8973f49 into main Oct 22, 2025
4 checks passed
@derrick-dacosta derrick-dacosta deleted the feature/add-proxy-support branch November 20, 2025 18:16
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.

Add http client proxy support for exporters

2 participants