首页 > 解决方案 > 使用 NodeJS 将灯塔指标发送到 Graphite

问题描述

我正在尝试向 Graphite 发送一些灯塔报告。我遇到了这个NodeJS项目Github 灯塔项目,它生成灯塔报告并发送到石墨。

所以我做了几件事-

  1. 使用此图像在我的一个 EC2 实例上启动一个石墨容器 - https://hub.docker.com/r/graphiteapp/graphite-statsd/
  2. 使用 Graphite 的相关细节修改 index.js 以将数据从灯塔推送到我的石墨容器。
  3. 运行node index.js也可以正常工作,没有任何错误,但我无法在 Graphite Web UI 中看到任何数据。

这些是我们需要在 index.js 中配置的东西 -

const graphitePort = '8080'; // my container is exposed to port 8080
const graphiteHost = '<mypublicip of EC2>'; // e.g. 'carbon.hostedgraphite.com'
**const graphitePath = '<<No Idea on this >>'; // e.g. 'lighthouse.performance' or 'your-api-key'**
const url = 'https://github.com/';

我不知道graphitePath 在这里是什么以及如何获得它。如果有人可以就此提出建议,那将非常有帮助

标签: node.jsmetricsgraphitelighthousegraphite-carbon

解决方案


推荐阅读