【发布时间】:2019-12-08 05:24:57
【问题描述】:
我的服务是使用 NodeJS 编写的,我想创建一个单独的端点 \metrics,它将返回以下指标:
Average request latency
99th percentile request latencies
opencensus / prometheus 库是否有一个 hello world 示例?我没有找到任何在 NodeJS 中使用它的例子。
例如,当我从this tutorial 添加以下代码时,即使执行了几个请求,我的输出也是空的。
【问题讨论】:
-
这不是你想要的吗? opencensus.io/quickstart/nodejs/metrics
-
我被这行
const stream = fs.createReadStream("./test.txt");弄糊涂了,难道我们不想用 _opencensus_ 包装我们的源代码(即不要创建任何文件等)。 -
顺便问一下,我可以使用 gregoryguillou.github.io/gregoryguillou.github.io/2019-01/… 的设置 NodeJS 客户端库部分吗?这看起来很容易注入。
标签: node.js kibana prometheus opencensus