Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Aclk proxy connect log#21789

Merged
stelfrag merged 4 commits intonetdata:masterfrom
stelfrag:aclk_proxy_connect_log
Feb 24, 2026
Merged

Aclk proxy connect log#21789
stelfrag merged 4 commits intonetdata:masterfrom
stelfrag:aclk_proxy_connect_log

Conversation

@stelfrag
Copy link
Collaborator

@stelfrag stelfrag commented Feb 19, 2026

Summary
  • Improve ACLK logging when a proxy is configured

Summary by cubic

Improved ACLK proxy logging and reporting across HTTPS and MQTT. Logs now show protocol, host:port, whether credentials are used, and where the proxy setting came from. Clear messages when no proxy is used or when env proxies are missing.

  • New Features

    • Unified proxy display via helpers; logs include HTTP/SOCKS5, host:port, credentials, and source (cloud.conf, netdata.conf [cloud], or env).
    • More explicit connection logs and errors: “connecting to host:port via proxy proto host:port (with/without credentials)” and detailed CONNECT failures/non-200 responses.
    • aclk_state and aclk_state_json now expose full proxy info under "aclk_proxy".
  • Bug Fixes

    • Fixed credential parsing by using the last '@' in proxy URLs.

Written for commit 5a8dadc. Summary will update on new commits.

- Enhance logging if proxy is used (with or without credentials)
…y` helper function.

- Simplify and unify proxy display construction in ACLK logging.
- Adjust key name in JSON payload from `aclk-proxy` to `aclk_proxy`.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant Config as Cloud Config (cloud-conf.c)
    participant Proxy as ACLK Proxy Helper (aclk_proxy.c)
    participant Net as Network Clients (HTTPS/MQTT)
    participant Logs as System Logs / State API
    
    Note over Config,Logs: Proxy Configuration & Initialization

    Proxy->>Config: Get proxy setting
    Config-->>Proxy: Return "env", URL, or "none"
    Config->>Config: NEW: Track source (cloud.conf vs netdata.conf)

    alt Proxy is "env"
        Proxy->>Proxy: Check http_proxy/https_proxy
        Proxy->>Logs: NEW: Log source as 'environment variable'
    else Proxy is URL
        Proxy->>Proxy: CHANGED: Parse credentials using LAST '@'
        Proxy->>Logs: NEW: Log proxy protocol, host, and source
    end

    Note over Config,Logs: Connection Runtime Flow

    Net->>Proxy: Fetch proxy settings
    Proxy-->>Net: Return type and host info
    
    Net->>Proxy: NEW: aclk_proxy_get_display()
    Proxy-->>Net: Return redacted string (proto://host:port)

    Net->>Logs: CHANGED: Log "connecting via proxy [proto][host]:[port]"
    Net->>Logs: NEW: Explicitly log if "with credentials" or "without credentials"

    alt Success
        Net->>Net: Establish TCP/SSL connection
    else Proxy Error (HTTP 401/407/5xx)
        Net->>Logs: NEW: Log detailed failure including proxy address and status code
    end

    Note over Config,Logs: Monitoring / Reporting

    Logs->>Proxy: aclk_state() or aclk_state_json()
    Proxy->>Proxy: NEW: aclk_proxy_get_full_display()
    Proxy-->>Logs: Return string: "host:port (credentials, from source)"
Loading

@stelfrag stelfrag marked this pull request as ready for review February 19, 2026 17:07
@stelfrag stelfrag requested a review from Ferroin as a code owner February 19, 2026 17:07
@stelfrag stelfrag requested review from thiagoftsm and removed request for Ferroin February 20, 2026 08:03
Copy link
Contributor

@thiagoftsm thiagoftsm left a comment

Choose a reason for hiding this comment

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

Information on proxy appear as expected with and without proxy. LGTM!

@stelfrag stelfrag merged commit b829cb3 into netdata:master Feb 24, 2026
144 checks passed
@stelfrag stelfrag deleted the aclk_proxy_connect_log branch February 24, 2026 10:45
kanelatechnical added a commit that referenced this pull request Feb 24, 2026
Add troubleshooting section explaining new log formats for ACLK proxy connection
messages that will be available starting from nightly build 2026-02-20.

- Document proxy resolution messages (no proxy, explicit none, env vars)
- Document connection time messages (MQTT WSS, HTTPS, OTP/challenge)
- Document error messages (CONNECT failed, proxy response errors)
- Document state reporting format changes
- Add interpretation guide for common issues
- Link to related security documentation

These new log formats will help users diagnose ACLK proxy configuration issues more easily
by showing exactly which proxy configuration is being used and where it came from.

Related to PR #21789 (internal ACLK logging improvements)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants