网络类型 | 地址 |
外网 | https:// ${region} .cls.tencentcs.com/prometheus/${topicId} /api/v1/write |
内网 | https:// ${region} .cls.tencentyun.com/prometheus/${topicId} /api/v1/write |
${region}
需替换为指标主题所在的地域,例如 ap-beijing,更多地域简称参见 可用地域,目前仅支持北京、上海、广州及南京地域。${topicId}
需替换为指标主题 ID,例如 0e69453c-0727-4c9c-xxxx-ea51b10d2aba,可在 指标主题列表 中查询。${SecretId}
${SecretKey}
{"version": "2.0","statement": [{"effect": "allow","action": ["cls:MetricsRemoteWrite"],"resource": ["*"]}]}
[[outputs.http]]## 上报地址,请替换其中的${region}及${topicId},本示例采用外网地址,如果网络条件允许建议使用内网地址## 内网地址 url = "https://${region}.cls.tencentyun.com/prometheus/${topicId}/api/v1/write"url = "https://${region}.cls.tencentcs.com/prometheus/${topicId}/api/v1/write"## 鉴权信息,请替换其中的${SecretId
}及${SecretKey
}username = "${SecretId
}"password = "${SecretKey
}"## Telegraf output 数据格式配置,请勿修改data_format = "prometheusremotewrite"[outputs.http.headers]Content-Type = "application/x-protobuf"Content-Encoding = "snappy"X-Prometheus-Remote-Write-Version = "0.1.0"
./vmagent-prod \\-remoteWrite.url=https://${region}.cls.tencentcs.com/prometheus/${topicId}/api/v1/write \\-remoteWrite.basicAuth.username=${SecretId
} \\-remoteWrite.basicAuth.password=${SecretKey
}
https://${region}.cls.tencentyun.com/prometheus/${topicId}/api/v1/write
。# 上报地址,请替换其中的${region}及${topicId},本示例采用外网地址,如果网络条件允许建议使用内网地址# 内网地址 url: https://${region}.cls.tencentyun.com/prometheus/${topicId}/api/v1/writeurl: https://${region}.cls.tencentcs.com/prometheus/${topicId}/api/v1/write# 鉴权信息,请替换其中的${SecretId}及${SecretKey}basic_auth:username: ${SecretId
}password: ${SecretKey
}# 数据写入策略,包括缓存及重试等,数据量较大时可参考如下配置queue_config:capacity: 20480min_shards: 100max_samples_per_send: 2048batch_send_deadline: 20smin_backoff: 100msmax_backoff: 5s
kubectl create secret generic kubepromsecret \\--from-literal=username=${SecretId
} \\--from-literal=password=${SecretKey
} \\-n monitoring
${SecretId}
及${SecretKey}
-n monitoring
为正确的 namespace。kube-prometheus/manifests/prometheus-prometheus.yaml
。remoteWrite:- url: "https://${region}.cls.tencentcs.com/prometheus/${topicId}/api/v1/write"basicAuth:username:name: kubepromsecretkey: usernamepassword:name: kubepromsecretkey: password
${region}
及${topicId}
,本示例采用外网地址,如果网络条件允许建议使用内网地址。url: "https://${region}.cls.tencentyun.com/prometheus/${topicId}/api/v1/write"
queueConfig:capacity: 204800minShards: 100maxShards: 2048maxSamplesPerSend: 4096batchSendDeadline: 30sminBackoff: 100msmaxBackoff: 5s
kubectl apply -f prometheus-prometheus.yaml -n monitoring
prometheus-prometheus.yaml
为正确的配置文件路径-n monitoring
为正确的 namespace。
本页内容是否解决了您的问题?