Skip to content

Backport of [CC-4361] Add HCPMetricsBindSocketDir to Envoy bootstrap config into release/1.0.x#91

Merged
hc-github-team-consul-core merged 4 commits into
release/1.0.xfrom
backport/cc-4361/hcp-metrics-bootstrap-config/lately-tender-catfish
Mar 14, 2023
Merged

Backport of [CC-4361] Add HCPMetricsBindSocketDir to Envoy bootstrap config into release/1.0.x#91
hc-github-team-consul-core merged 4 commits into
release/1.0.xfrom
backport/cc-4361/hcp-metrics-bootstrap-config/lately-tender-catfish

Conversation

@hc-github-team-consul-core
Copy link
Copy Markdown
Collaborator

Backport

This PR is auto-generated from #90 to be assessed for backporting due to the inclusion of the label backport/1.0.

The below text is copied from the body of the original PR.


This PR is very similar to hashicorp/consul#16511 in consul

Background

The HCP Cloud team is working on enabling observability metrics in HCP.
In particular, we want to forward Envoy metrics.

This PR aims to allow Envoy bootstrap configuration of 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.

Code changes

  • internal/bootstrap/bootstrap_config.go : Add a HCPMetricsBindSocketDir string type in the BootstrapConfig struct and a function appendHCPMetricsConfig to generate the socket name, configure the stats sink and cluster for metrics forwarding.
  • internal/bootstrap/bootstrap_config_test.go: add relevant tests to the above
  • pkg/consuldp/bootstrap_test.go: Add a test to generate a golden test file
  • internal/bootstrap/bootstrap_tpl.go : small change to move brackets [] into the template instead, which facilitates config generation

Next Steps

There will be a follow-up PR to generate a listener and cluster dynamically that will be listening on this socket
That listener and cluster will be configured to route to collector instances through the service mesh.

Caveat: we needed to add this local listener indirection as a workaround due to this issue


Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core requested a review from a team as a code owner March 14, 2023 19:33
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/cc-4361/hcp-metrics-bootstrap-config/lately-tender-catfish branch from f1241a9 to 599ab3c Compare March 14, 2023 19:33
@hc-github-team-consul-core hc-github-team-consul-core enabled auto-merge (squash) March 14, 2023 19:33
@hc-github-team-consul-core hc-github-team-consul-core merged commit 7730470 into release/1.0.x Mar 14, 2023
@hc-github-team-consul-core hc-github-team-consul-core deleted the backport/cc-4361/hcp-metrics-bootstrap-config/lately-tender-catfish branch March 14, 2023 19:50
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.

2 participants