Skip to content

Fix HA connection metric for failed tunnel dials#1638

Open
officialasishkumar wants to merge 1 commit intocloudflare:masterfrom
officialasishkumar:fix/ha-connections-active-metric
Open

Fix HA connection metric for failed tunnel dials#1638
officialasishkumar wants to merge 1 commit intocloudflare:masterfrom
officialasishkumar:fix/ha-connections-active-metric

Conversation

@officialasishkumar
Copy link
Copy Markdown

Summary

  • count cloudflared_tunnel_ha_connections only after a tunnel connection successfully registers with the edge
  • avoid incrementing the active HA gauge for failed dial or registration attempts
  • add focused supervisor tests for connected and unconnected fuse behavior

Fixes #1633.

Testing

  • git diff --check
  • go test -mod=vendor ./supervisor
  • go test -mod=vendor ./supervisor ./connection
  • go test -mod=vendor ./... (local environment failure limited to ingress ICMP tests because this container cannot create the required ping/raw sockets: GID 1000 is outside ping_group_range and ICMPv6 socket creation is denied)

Count active HA connections only after a tunnel connection has successfully registered with the edge. Failed dial or registration attempts now leave cloudflared_tunnel_ha_connections at zero, matching the metric description and avoiding misleading readiness data.

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
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.

🐛 Cloudflared metrics return 1 HA connection when there are none.

1 participant