2024-06-06 11:03:45 发布
网友
我正在使用python prometheus客户端,在将度量值推送到VictoriaMetrics(VM)时遇到问题
有一个名为push_to_gateway的函数,我试图用VM:http://prometheus:9091 -> http://vm:8428/api/v1/write替换prometheus URL。但VM以400状态代码响应
push_to_gateway
http://prometheus:9091 -> http://vm:8428/api/v1/write
另外,请看一下我最近创建的客户端:https://github.com/gistart/prometheus-push-client
supports pushes directly to VictoriaMetrics via UDP and HTTP using InfluxDB line protocol
to StatsD or statsd-exporter in StatsD format via UDP
to pushgateway or prom-aggregation-gateway in OpenMetrics format via HTTP
可以将push_to_gateway方法用于维多利亚式测量,请参见gisthttps://gist.github.com/f41gh7/85b2eb895bb63b93ce46ef73448c62d0中的示例
我在/api/v1/import/csv使用CSV导入,如下所述:https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/README.md#how-to-import-csv-data
/api/v1/import/csv
直接从数据帧生成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)
另外,请看一下我最近创建的客户端:https://github.com/gistart/prometheus-push-client
可以将
push_to_gateway
方法用于维多利亚式测量,请参见gisthttps://gist.github.com/f41gh7/85b2eb895bb63b93ce46ef73448c62d0中的示例我在
/api/v1/import/csv
使用CSV导入,如下所述:https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/README.md#how-to-import-csv-data直接从数据帧生成CSV。比如:
相关问题 更多 >
编程相关推荐