# add meta informations
curl -X PUT -d '{"id": "db004-hf","name": "node","address": "172.16.168.15","port": 9101,"tags": ["nodes","hf004"],"meta":{"idc":"hf"},"checks": [{"http": "http://172.16.168.15:9101/metrics", "interval": "5s"}]}' http://172.16.168.10:8500/v1/agent/service/register
scrape_configs:
- job_name: 'consul-node'
consul_sd_configs:
- server: '172.16.168.10:8500'
tags:
- "nodes"
refresh_interval: 3s
relabel_configs:
- source_labels: [__meta_consul_tags]
regex: .*hf004.*
action: keep
- regex: __meta_consul_service_metadata_(.+)
action: labelmap
After restarting Prometheus, you can see that the label is automatically marked.
Read More:
- [Solved] prometheus Startup Error: opening storage failed
- [Solved] kubeadm join Cluster Error: error execution phase kubelet-start
- [Solved] nova-compute.log Error: Instance failed block device setup
- stream copy error: reading from a closed fifo [How to Solve]
- [Solved] Node uploads files to FTP server error: timed out while making data connection
- The problem of inconsistent host names in building rabbitmq on Linux
- Nginx Error: [emerg] bind() to [::]:80 failed (98: Address already in use)
- How to Solve NPM Error: listen EADDRINUSE 127.0.0.1:8080
- Configure the node environment under Linux, internal/modules/cjs/loader.js:583 throw err; solution
- [Solved] Error report of introducing Vue into ecarts GL
- Android: How to Start App Automatically
- Solve the problem of 404 Not Found error in nginx accessing dynamic interface
- [Solved] Web server failed to start. Port 8080 was already in use.
- Installation, Configuration and Simple Use of Rancher
- Restart and stop of nginx in Linux service
- CDH operation and maintenance: child node cloudera SCM agent starts Error
- The upgrade of Ubuntu results in an error in the compilation of Android Jack [Two Method to Solve]
- [Solve] Yinhe Qilin V10 System Error: Failed to download metadata for repo ‘ks10-adv-os‘
- U-boot NFS download file error: loading: * * * error: File lookup fail solution
- [Solved] source /etc/profile Error: not a valid identifier