ネットワークタイプ | アドレス |
外部ネットワーク | 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です。このIDは指標トピックリストで照会できます。${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に変更してください。フィードバック