install --name=prometheus --namespace=monitoring -f prometheus.yam stable/prometheus-operator 如果需要 Prometheus-Pushgateway Prometheus 中添加 target serviceMonitor: enabled: true namespace: monitoring selector: app: prometheus-pushgateway traefik # ingress class hosts: - "pushgateway.mydomain.io" # 设置域名 同样的方式部署 helm install --name=prometheus-pushgateway --namespace=monitoring -f prometheus-pushgateway.yaml stable/prometheus-pushgateway 这样 Prometheus 的核心组件都部署完成了 参考 Prometheus 官网 Prometheus 与其他监控系统对比 Kubernetes Operator Prometheus Operator Prometheus-Pushgateway
install --name=prometheus --namespace=monitoring -f prometheus.yam stable/prometheus-operator 如果需要 Prometheus-Pushgateway Prometheus 中添加 target serviceMonitor: enabled: true namespace: monitoring selector: app: prometheus-pushgateway traefik # ingress class hosts: - "pushgateway.mydomain.io" # 设置域名 同样的方式部署 helm install --name=prometheus-pushgateway --namespace=monitoring -f prometheus-pushgateway.yaml stable/prometheus-pushgateway 这样 Prometheus 的核心组件都部署完成了 参考 Prometheus 官网 Prometheus 与其他监控系统对比 Kubernetes Operator Prometheus Operator Prometheus-Pushgateway
Engine >= 1.13 Docker Compose >= 1.11 Containers: Prometheus (metrics database) http://<host-ip>:9090 Prometheus-Pushgateway
v in labels.items()]) data = f'{metric_name}{{{labels_str}}} {value}\n' requests.post("http://prometheus-pushgateway
prometheus_io_scrape: pushgateway annotation的service,从匹配到的service列表中每个service抓取该service暴露的监控指标 - job_name: prometheus-pushgateway
meta_kubernetes_pod_node_name] action: replace target_label: kubernetes_node - job_name: 'prometheus-pushgateway
: node scrape_interval: 5m scrape_timeout: 30s - honor_labels: true job_name: prometheus-pushgateway