简体   繁体   English

将石墨指标与bosun集成

[英]Integrate graphite metrics with bosun

I am running Docker container for bosun. 我正在为bosun运行Docker容器。 I want to integrate the graphite metrics with bosun. 我想将石墨指标与bosun集成。
What are the configuration changes that need to be done for this? 需要对此进行哪些配置更改?

@kyle-brandt's answer is okay and I gave it an upvote but it and the Bosun docs don't really explain enough of how to use a Graphite that you don't host, ie hostedgraphite.com. @ kyle-brandt的回答是可以的,我给了它一个upvote但它和Bosun文档并没有真正解释如何使用你没有托管的Graphite,即hostedgraphite.com。 Using the docs and some trial and error I figured things out. 使用文档和一些反复试验,我想出了一些事情。 So here it goes: 所以这里:

  1. Make a Graphite API key: http://docs.hostedgraphite.com/advanced/access-keys.html (you should whitelist IP addresses). 制作Graphite API密钥: http//docs.hostedgraphite.com/advanced/access-keys.html (您应该将IP地址列入白名单)。 Let's say you got https://www.hostedgraphite.com/deadbeef/431-831/graphite/ . 假设你有https://www.hostedgraphite.com/deadbeef/431-831/graphite/
  2. Create data.conf with: 使用以下命令创建data.conf

    tsdbHost = localhost:4242 stateFile = /data/bosun.state graphiteHost = https://www.hostedgraphite.com/deadbeef/431-831/graphite/render

  3. Start the Docker container: docker run -d \\ -p 80:8070 \\ --name=bosun \\ -v `pwd`/bosun.conf:/data/bosun.conf \\ stackexchange/bosun Note that I didn't do the 4242 port mapping because I'm getting my data just from hostedgraphite.com and I mapped 8070 to 80 so that I don't have to specify the port when going to Bosun in the browser. 启动Docker容器: docker run -d \\ -p 80:8070 \\ --name=bosun \\ -v `pwd`/bosun.conf:/data/bosun.conf \\ stackexchange/bosun请注意,我没有这样做4242端口映射,因为我只是从hostedgraphite.com获取我的数据,并且我将8070映射到80,这样我在浏览器中访问Bosun时不必指定端口。
  4. Adding expressions: The docs say to use GraphiteQuery but that didn't work for me, graphite worked instead. 添加表达式: 文档说要使用GraphiteQuery但这对我不起作用,而graphite起作用。 For example: graphite("my.long.metric.name.for.some.method", "10m", "", "") . 例如: graphite("my.long.metric.name.for.some.method", "10m", "", "") There is also an example graphite alert in the examples part of the documentation (thanks @kyle-brandt). 在文档的示例部分中还有一个示例石墨警报 (感谢@ kyle-brandt)。

As per the documentation you linked, you must set the graphiteHost in the config: 根据您链接的文档,您必须在配置中设置graphiteHost

graphiteHost: an ip, hostname, ip:port, hostname:port or a URL, defaults to standard http/https ports, defaults to “/render” path. graphiteHost:ip,hostname,ip:port,hostname:port或URL,默认为标准的http / https端口,默认为“/ render”路径。 Any non-zero path (even “/” overrides path) 任何非零路径(甚至“/”覆盖路径)

The graphing page and items page in Bosun only work with OpenTSDB as the backend. Bosun中的图形页面和项目页面仅适用于OpenTSDB作为后端。 However, you can still you the expression page, dashboard, and config editor. 但是,您仍然可以使用表达式页面,仪表板和配置编辑器。 When you use expressions that return a seriesSet as the graphite query functions do, you will see a graph tab on the expression tabe. 当您使用返回seriesSet表达式作为石墨查询函数时,您将在表达式tabe上看到一个图形选项卡。 You can also use the .Graph and .GraphAll template functions with graphite. 您也可以使用.Graph.GraphAll模板函数与石墨。 So it is largely functional. 所以它很有用。

There is also an example graphite alert in the examples part of the documentation. 在文档的示例部分中还有一个示例石墨警报

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM