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

Allow shutdown-manager to watch non-http connections #6928

Open
qcattez opened this issue Mar 3, 2025 · 1 comment
Open

Allow shutdown-manager to watch non-http connections #6928

qcattez opened this issue Mar 3, 2025 · 1 comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor.

Comments

@qcattez
Copy link

qcattez commented Mar 3, 2025

Please describe the problem you have
In my setup, I'm using envoy to proxy TCP traffic. I noticed that the shutdown-manager doesn't work in such cases because it's hardcoded to watch http metrics :

const (
	// The prometheusURL is used to fetch the envoy metrics. Note that the filter
	// value matches Envoy's raw stat names (i.e. those on the `/stats/` endpoint).
	prometheusURL      = "http://unix/stats/prometheus?filter=^http\\..*\\.downstream_cx_active$"
	healthcheckFailURL = "http://unix/healthcheck/fail"
	prometheusStat     = "envoy_http_downstream_cx_active"
)

(https://github.com/qcattez/contour/blob/main/cmd/contour/shutdownmanager.go#L36-L38)

To allow us to shutdown properly other connections than HTTP, it would be nice to either :

  • be able to configure prometheusURL and prometheusStat
  • replace the prometheusStat with envoy_listener_downstream_cx_active and prometheusURL with http://unix/stats/prometheus?filter=^listener\\..*\\.downstream_cx_active$

A sample of my metrics :

# TYPE envoy_http_downstream_cx_active gauge
envoy_http_downstream_cx_active{envoy_http_conn_manager_prefix="admin"} 1
# TYPE envoy_http_downstream_cx_http1_active gauge
envoy_http_downstream_cx_http1_active{envoy_http_conn_manager_prefix="admin"} 1
# TYPE envoy_http_downstream_cx_http1_soft_drain gauge
envoy_http_downstream_cx_http1_soft_drain{envoy_http_conn_manager_prefix="admin"} 0
# TYPE envoy_http_downstream_cx_http2_active gauge
envoy_http_downstream_cx_http2_active{envoy_http_conn_manager_prefix="admin"} 0
# TYPE envoy_http_downstream_cx_http3_active gauge
envoy_http_downstream_cx_http3_active{envoy_http_conn_manager_prefix="admin"} 0
# TYPE envoy_http_downstream_cx_rx_bytes_buffered gauge
envoy_http_downstream_cx_rx_bytes_buffered{envoy_http_conn_manager_prefix="admin"} 84
# TYPE envoy_http_downstream_cx_ssl_active gauge
envoy_http_downstream_cx_ssl_active{envoy_http_conn_manager_prefix="admin"} 0
# TYPE envoy_http_downstream_cx_tx_bytes_buffered gauge
envoy_http_downstream_cx_tx_bytes_buffered{envoy_http_conn_manager_prefix="admin"} 0
# TYPE envoy_http_downstream_cx_upgrades_active gauge
envoy_http_downstream_cx_upgrades_active{envoy_http_conn_manager_prefix="admin"} 0
# TYPE envoy_http_downstream_rq_active gauge
envoy_http_downstream_rq_active{envoy_http_conn_manager_prefix="admin"} 1
...
# TYPE envoy_listener_admin_downstream_cx_active gauge
envoy_listener_admin_downstream_cx_active{} 1
# TYPE envoy_listener_admin_downstream_pre_cx_active gauge
envoy_listener_admin_downstream_pre_cx_active{} 0
# TYPE envoy_listener_admin_main_thread_downstream_cx_active gauge
envoy_listener_admin_main_thread_downstream_cx_active{} 1
# TYPE envoy_listener_downstream_cx_active gauge
envoy_listener_downstream_cx_active{envoy_listener_address="0.0.0.0_8080"} 0
# TYPE envoy_listener_downstream_pre_cx_active gauge
envoy_listener_downstream_pre_cx_active{envoy_listener_address="0.0.0.0_8080"} 0
# TYPE envoy_listener_worker_downstream_cx_active gauge
envoy_listener_worker_downstream_cx_active{envoy_worker_id="0",envoy_listener_address="0.0.0.0_8080"} 0
envoy_listener_worker_downstream_cx_active{envoy_worker_id="1",envoy_listener_address="0.0.0.0_8080"} 0

What would be the best way ?

@qcattez qcattez added kind/feature Categorizes issue or PR as related to a new feature. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor. labels Mar 3, 2025
Copy link

github-actions bot commented Mar 3, 2025

Hey @qcattez! Thanks for opening your first issue. We appreciate your contribution and welcome you to our community! We are glad to have you here and to have your input on Contour. You can also join us on our mailing list and in our channel in the Kubernetes Slack Workspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor.
Projects
None yet
Development

No branches or pull requests

1 participant