小编Ron*_*ver的帖子

Prometheus scrape /metric 带有自定义标头

我有一个将由 Prometheus 监控的应用程序,但该应用程序需要自定义标头键,例如:

x-auth-token: <customrandomtoken>
Run Code Online (Sandbox Code Playgroud)

我应该如何处理 prometheus.yml?

monitoring prometheus prometheus-blackbox-exporter

13
推荐指数
1
解决办法
1万
查看次数

PG 在高并发请求上承诺太多客户端

我试图根据其他表中选定的数据插入数百/千个数据,但我发现错误“客户端太多”,这是错误太多客户

我使用 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 …

postgresql node.js pg-promise

0
推荐指数
1
解决办法
857
查看次数