home/versioned_docs/version-1.8.0/help/consul_sd.md
HertzBeat integrates with Consul registry to automatically discover service instances and create monitoring tasks for them.
Consul Service Discovery allows HertzBeat to connect to your Consul server and automatically discover all registered service instances. When a new service instance is registered or an existing instance goes offline, HertzBeat will automatically create or delete corresponding monitoring tasks, achieving automated monitoring in microservice environments.
http://your-consul-server:8500/ui/| Parameter name | Parameter help description |
|---|---|
| Target Name | Identify the name of this monitoring. The name needs to be unique. |
| Consul Host | Consul server IP address or domain name. Note⚠️Without protocol header (eg: https://, http://). Example: consul-server or 192.168.1.100 |
| Consul Port | Port provided by the Consul server. The default is 8500 |
| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds. |
| Description remarks | For more information about identifying and describing this monitoring, users can note information here. |
Create Service Discovery Monitoring
Configure Monitoring Template
Automatic Discovery
View Discovered Instances
Suppose your Consul server is running at 192.168.1.100:8500, and you want to automatically monitor all service instances registered in it.
Configuration example:
Consul-Service-Discovery192.168.1.100850060 secondsPort monitoring (to detect instance availability)After configuration:
api-service-192.168.1.101:8080){ServiceName}-{Host}:{Port}| Metric name | Metric unit | Metric help description |
|---|---|---|
| target | none | Discovered service instance target |
| host | none | Service instance host address |
| port | none | Service instance port number |