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 intoMar 14, 2023
Conversation
f1241a9 to
599ab3c
Compare
Achooo
approved these changes
Mar 14, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
consulBackground
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>.sockto forward Envoy metrics.Code changes
internal/bootstrap/bootstrap_config.go: Add aHCPMetricsBindSocketDirstring type in theBootstrapConfigstruct and a functionappendHCPMetricsConfigto generate the socket name, configure the stats sink and cluster for metrics forwarding.internal/bootstrap/bootstrap_config_test.go: add relevant tests to the abovepkg/consuldp/bootstrap_test.go: Add a test to generate a golden test fileinternal/bootstrap/bootstrap_tpl.go: small change to move brackets[]into the template instead, which facilitates config generationNext 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