我有一个将由 Prometheus 监控的应用程序,但该应用程序需要自定义标头键,例如:
x-auth-token: <customrandomtoken>
Run Code Online (Sandbox Code Playgroud)
我应该如何处理 prometheus.yml?
我试图根据其他表中选定的数据插入数百/千个数据,但我发现错误“客户端太多”,这是错误
我使用 pgp (pg Promise) lib,这是我的代码片段
function call(){
for (let index = 0; index < 5; index++) {
getPendingData().then((result) => {
db.tx((t) => {
let counter = 0;
const queries = result.map((data) => {
counter++;
return db.none(`insert into test_data (id, isdeleted, parentid) values ('${uuidv1()}', 0, '${uuidv1()}x-${uuidv1()}' ) `);
});
return t.batch(queries);
});
});
}
}
let getPendingData = async () => {
return db.task('getPendingData', async (t) => {
return await t.any('select * from other_table');
});
}
(call())
Run Code Online (Sandbox Code Playgroud)
我设置 max pg …