consul/agent/proxycfg
Ashvitha f95ffe0355
Allow HCP metrics collection for Envoy proxies
Co-authored-by: Ashvitha Sridharan <ashvitha.sridharan@hashicorp.com>
Co-authored-by: Freddy <freddygv@users.noreply.github.com>

Add a new envoy flag: "envoy_hcp_metrics_bind_socket_dir", a directory
where a unix socket will be created with the name
`<namespace>_<proxy_id>.sock` to forward Envoy metrics.

If set, this will configure:
- In bootstrap configuration a local stats_sink and static cluster.
  These will forward metrics to a loopback listener sent over xDS.

- A dynamic listener listening at the socket path that the previously
  defined static cluster is sending metrics to.

- A dynamic cluster that will forward traffic received at this listener
  to the hcp-metrics-collector service.


Reasons for having a static cluster pointing at a dynamic listener:
- We want to secure the metrics stream using TLS, but the stats sink can
  only be defined in bootstrap config. With dynamic listeners/clusters
  we can use the proxy's leaf certificate issued by the Connect CA,
  which isn't available at bootstrap time.

- We want to intelligently route to the HCP collector. Configuring its
  addreess at bootstrap time limits our flexibility routing-wise. More
  on this below.

Reasons for defining the collector as an upstream in `proxycfg`:
- The HCP collector will be deployed as a mesh service.

- Certificate management is taken care of, as mentioned above.

- Service discovery and routing logic is automatically taken care of,
  meaning that no code changes are required in the xds package.

- Custom routing rules can be added for the collector using discovery
  chain config entries. Initially the collector is expected to be
  deployed to each admin partition, but in the future could be deployed
  centrally in the default partition. These config entries could even be
  managed by HCP itself.
2023-03-10 13:52:54 -07:00
..
internal/watch perf: remove expensive reflection from xDS hot path (#14934) 2022-10-14 10:26:42 +01:00
api_gateway.go Protobuf Refactoring for Multi-Module Cleanliness (#16302) 2023-02-17 16:14:46 -05:00
connect_proxy.go Allow HCP metrics collection for Envoy proxies 2023-03-10 13:52:54 -07:00
data_sources.go feat: xDS updates for peerings control plane through mesh gw 2022-10-07 08:46:42 -06:00
data_sources_oss.go proxycfg: replace direct agent cache usage with interfaces (#13320) 2022-06-01 16:18:06 +01:00
deep-copy.sh Implement APIGateway proxycfg snapshot (#16194) 2023-02-08 15:52:12 -06:00
ingress_gateway.go Protobuf Refactoring for Multi-Module Cleanliness (#16302) 2023-02-17 16:14:46 -05:00
manager.go proxycfg: ensure that an irrecoverable error in proxycfg closes the xds session and triggers a replacement proxycfg watcher (#16497) 2023-03-03 14:27:53 -06:00
manager_test.go Protobuf Refactoring for Multi-Module Cleanliness (#16302) 2023-02-17 16:14:46 -05:00
mesh_gateway.go Protobuf Refactoring for Multi-Module Cleanliness (#16302) 2023-02-17 16:14:46 -05:00
mesh_gateway_oss.go proxycfg: remove dependency on `cache.UpdateEvent` (#13144) 2022-05-20 15:47:40 +01:00
naming.go Fix configuration merging for implicit tproxy upstreams. (#16000) 2023-01-18 13:43:53 -06:00
naming_oss.go peering: Make Upstream peer-aware (#12900) 2022-04-29 18:12:51 -04:00
naming_test.go Cluster peering failover disco chain changes (#14296) 2022-08-23 09:13:43 -04:00
proxycfg.deepcopy.go Protobuf Refactoring for Multi-Module Cleanliness (#16302) 2023-02-17 16:14:46 -05:00
proxycfg.go Regenerate files according to 1.19.2 formatter 2022-10-24 16:12:08 -04:00
snapshot.go Protobuf Refactoring for Multi-Module Cleanliness (#16302) 2023-02-17 16:14:46 -05:00
snapshot_test.go Protobuf Refactoring for Multi-Module Cleanliness (#16302) 2023-02-17 16:14:46 -05:00
state.go proxycfg: ensure that an irrecoverable error in proxycfg closes the xds session and triggers a replacement proxycfg watcher (#16497) 2023-03-03 14:27:53 -06:00
state_oss_test.go proxycfg: replace direct agent cache usage with interfaces (#13320) 2022-06-01 16:18:06 +01:00
state_test.go Allow HCP metrics collection for Envoy proxies 2023-03-10 13:52:54 -07:00
terminating_gateway.go Fix issue where terminating gateway service resolvers weren't properly cleaned up (#16498) 2023-03-03 09:56:57 -05:00
testing.go Protobuf Refactoring for Multi-Module Cleanliness (#16302) 2023-02-17 16:14:46 -05:00
testing_api_gateway.go Inline API Gateway TLS cert code (#16295) 2023-02-17 12:46:03 -05:00
testing_connect_proxy.go Allow HCP metrics collection for Envoy proxies 2023-03-10 13:52:54 -07:00
testing_ingress_gateway.go Add ServiceResolver RequestTimeout for route timeouts to make TerminatingGateway upstream timeouts configurable (#16495) 2023-03-03 09:37:12 -05:00
testing_mesh_gateway.go Add ServiceResolver RequestTimeout for route timeouts to make TerminatingGateway upstream timeouts configurable (#16495) 2023-03-03 09:37:12 -05:00
testing_oss.go proxycfg: replace direct agent cache usage with interfaces (#13320) 2022-06-01 16:18:06 +01:00
testing_peering.go Protobuf Refactoring for Multi-Module Cleanliness (#16302) 2023-02-17 16:14:46 -05:00
testing_terminating_gateway.go Add extension validation on config save and refactor extensions. (#16110) 2023-01-30 15:35:26 -06:00
testing_tproxy.go troubleshoot: service to service validation (#16096) 2023-01-27 11:43:16 -08:00
testing_upstreams.go Add ServiceResolver RequestTimeout for route timeouts to make TerminatingGateway upstream timeouts configurable (#16495) 2023-03-03 09:37:12 -05:00
upstreams.go Protobuf Refactoring for Multi-Module Cleanliness (#16302) 2023-02-17 16:14:46 -05:00