我使用的是python prometheus客户端,但在将指标推送到VictoriaMetrics (VM)时遇到了问题。
有一个名为push_to_gateway的函数,我尝试将prometheus URL替换为VM:http://prometheus:9091 -> http://vm:8428/api/v1/write。但是VM响应了400状态代码。
发布于 2021-01-20 17:26:47
可以在VictoriaMetrics中使用push_to_gateway方法,请查看gist https://gist.github.com/f41gh7/85b2eb895bb63b93ce46ef73448c62d0中示例
发布于 2021-01-25 02:10:47
我在/api/v1/import/csv上使用CSV import,如下所述:https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/README.md#how-to-import-csv-data
直接从熊猫数据帧生成CSV。类似于:
df.rename(columns={'timestamp': 'ts_ns'}, inplace=True)
data = df.to_csv(index=False, header=False)
csv_format = f'1:time:unix_ns{metric_format}{label_format}'
response = requests.post(url, params={'format': csv_format}, data=data)发布于 2021-05-17 06:31:54
另外,请看一下我最近创建的客户端:https://github.com/gistart/prometheus-push-client
支持通过UDP和HTTP直接推送到VictoriaMetrics,使用InfluxDB线路协议通过UDP推送到StatsD或StatsD格式的StatsD导出器,通过HTTP
推送OpenMetrics格式的网关或prom聚合网关
https://stackoverflow.com/questions/65751105
复制相似问题