不推荐使用此方案:
由于promethues本身的默认储存是储存在本地的TSDB,但不符合大规模的监控数据的存储、对于大数据量的保存及查询支持不太友好、可靠性也较弱、无法支持集群的架构等,故需要选择一种远程储存的方案;
AppOptics: write
Chronix: write
Cortex: read and write
CrateDB: read and write
Elasticsearch: write
Gnocchi: write
Graphite: write
InfluxDB: read and write
Kafka: write
OpenTSDB: write
PostgreSQL/TimescaleDB: read and write
Splunk: read and write
现因为promethues支持提供remote_write和remote_read的特性,所以基于读写的要求可以选择influxdb作为储存方案:
修改promethues的配置文件
remote_write:
url: <string>
[ remote_timeout: <duration> | default = 30s ]
write_relabel_configs:
[ - <relabel_config> ... ]
basic_auth:
[ username: <string> ]
[ password: <string> ]
[ bearer_token: <string> ]
[ bearer_token_file: /path/to/bearer/token/file ]
tls_config:
[ <tls_config> ]
[ proxy_url: <string> ]
remote_read:
url: <string>
required_matchers:
[ <labelname>: <labelvalue> ... ]
[ remote_timeout: <duration> | default = 30s ]
[ read_recent: <boolean> | default = false ]
basic_auth:
[ username: <string> ]
[ password: <string> ]
[ bearer_token: <string> ]
[ bearer_token_file: /path/to/bearer/token/file ]
[ <tls_config> ]
[ proxy_url: <string> ]
其中url用于指定远程读写的HTTP服务地址,如果该URL启动了认证则可以通过basic_auth进行安全认证配置;对于https的支持需要设定tls_concig;proxy_url主要用于Prometheus无法直接访问适配器服务的情况下;write_relabel_configs用于标签重写功能。
浙公网安备 33010602011771号