dhiaayachi / consul

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
https://www.consul.io
Other
0 stars 0 forks source link

[CC-7044] Start HCP manager as part of link creation #1303

Open dhiaayachi opened 1 month ago

dhiaayachi commented 1 month ago

Description

Depends on https://github.com/hashicorp/consul/pull/20306

This PR starts the HCP manger when an HCP link resource is created instead of when Consul is started. This allows the linking process to be initiated via the HCP link API.

These changes are best viewed commit-by-commit. A summary of the changes are:

This PR also introduces a breaking change, though that change actually fixes Consul's behavior to match what we have documented. The agent telemetry docs and the agent configuration docs for telemetry.disable_hostname both state that by default, the hostname of the Consul agent should prefix gauge-type metrics. However, before this PR, if there were no additional metrics sinks enabled, the hostname prefixing was disabled. Now that we're always enabling the HCP metrics sink, we will now always prefix the gauge-metrics by default.

Testing & Reproduction steps

Linking via API:

  1. Start Consul without a cloud configuration
  2. Make a PUT request to create a link resource
  3. Inspect logs to see that HCP manager has started
  4. Check in HCP portal that all features are working as expected (server info and services syncing, observability, global workflows, etc.)
  5. Make a GET request to the link and check the status is successful

Other variations tested:

Links

PR Checklist