Thank you very much, vpc endpoint solved my problem. 在2021年1月5日星期二 UTC+8 下午5:15:47<Stuart Clark> 写道:
> On 05/01/2021 05:11, 辛二 wrote: > > config now: > > - *job_name*: 'ec2-sd' > > proxy_url: '172.31.2.224:3001' > > *scrape_interval*: 5s > > *ec2_sd_configs*: > > - *region*: cn-north-1 > > *access_key*: xxxxxxxxx > > *secret_key*: xxxxxxxxx > > *port*: 9100 > > *relabel_configs*: > > - *source_labels*: ["__meta_ec2_tag_Usage"] > > *target_label*: "usage" > error log: > > level=error ts=2021-01-05T05:05:37.883Z caller=refresh.go:95 > component="discovery manager scrape" discovery=ec2 msg="Unable to refresh > target groups" err="could not describe instances: RequestError: send > request failed\ncaused by: Post https://ec2.cn-north-1.amazonaws.com.cn/: > dial tcp 54.222.5.106:443: connect: connection timed out" > 在2021年1月5日星期二 UTC+8 下午1:08:44<辛二> 写道: > >> Our prometheus instance has`t public ip, can not discovery ec2 instance >> directly, how to config prometheus to discovery ec2 instance >> > If you don't have access to the Internet from your Prometheus server you > probably need to add a VPC endpoint for the EC2 API ( > https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html), > possibly also setting the endpoint in the EC2 SD configuration ( > https://prometheus.io/docs/prometheus/latest/configuration/configuration/#ec2_sd_config > ). > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f396b1c9-632f-44d6-abb8-456f9ea62b86n%40googlegroups.com.

