consul/contributing/service-discovery/health-checks.md

1.8 KiB

Health Checks

This section is still a work in progress.

Check Registration flows

There are many paths to register a check. Many of these use different struct types, so to properly validate and convert a check, all of these paths must be reviewed and tested.

  1. API /v1/catalog/register - the Checks field on structs.RegisterRequest. The entrypoint is CatalogRegister in agent/catalog_endpoint.go.
  2. API /v1/agent/check/register - the entrypoint is AgentRegisterCheck in agent/agent_endpoint.go
  3. API /v1/agent/service/register - the Check or Checks fields on ServiceDefinition. The entrypoint is AgentRegisterService in agent/agent_endpoint.go.
  4. Config Checks - the Checks and Check fields on config.Config in agent/config/config.go.
  5. Config Service.Checks - the Checks and Check fields on ServiceDefinition in agent/config/config.go.
  6. CLI consul services register - the Checks and Check fields on api.AgentServiceRegistration. The entrypoint is ServicesFromFiles in command/services/config.go.