使用跨区域工作空间为适用于 Prometheus 的亚马逊托管服务增加高可用性 - Amazon Managed Service for Prometheus

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

使用跨区域工作空间为适用于 Prometheus 的亚马逊托管服务增加高可用性

要为您的数据添加跨区域可用性,您可以将指标发送到跨 AWS 区域的多个工作空间。Prometheus 支持多个写入器和跨区域写入。

以下示例说明如何设置在代理模式下运行的 Prometheus 服务器,以便使用 Helm 将指标发送到不同区域的两个工作区。

extensions: sigv4auth: service: "aps" receivers: prometheus: config: scrape_configs: - job_name: 'kubernetes-kubelet' scheme: https tls_config: ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt insecure_skip_verify: true bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token kubernetes_sd_configs: - role: node relabel_configs: - action: labelmap regex: __meta_kubernetes_node_label_(.+) - target_label: __address__ replacement: kubernetes.default.svc.cluster.local:443 - source_labels: [__meta_kubernetes_node_name] regex: (.+) target_label: __metrics_path__ replacement: /api/v1/nodes/$${1}/proxy/metrics exporters: prometheusremotewrite/one: endpoint: "https://aps-workspaces.workspace_1_region.amazonaws.com/workspaces/ws-workspace_1_id/api/v1/remote_write" auth: authenticator: sigv4auth prometheusremotewrite/two: endpoint: "https://aps-workspaces.workspace_2_region.amazonaws.com/workspaces/ws-workspace_2_id/api/v1/remote_write" auth: authenticator: sigv4auth service: extensions: [sigv4auth] pipelines: metrics/one: receivers: [prometheus] exporters: [prometheusremotewrite/one] metrics/two: receivers: [prometheus] exporters: [prometheusremotewrite/two]