MESOS App Exporter for Promisheus
mae的Python项目详细描述
mae
mae
从您的mesos应用程序收集普罗米修斯度量。
请参阅Deployment Strategy以了解如何在mesos集群上设置mae
。
要求
mae
需要python(>;=2.7),并支持python 3(>;=3.5)。
安装
pip install mae
用法
$ mae --help
usage: mae [-h] app_port slave_address slave_port
positional arguments:
app_port Port on which this exporter will run on
slave_address Mesos slave address
slave_port Mesos slave port
cli的日志记录级别也可以用LOG_LEVEL
环境变量配置。阅读^{
任务标签
一旦mae
启动并运行,它将开始从所有具有prometheus.metrics.enabled
标签的应用程序收集度量。您还可以自定义如何收集度量-
Task Label | Description | Required? | Default |
---|---|---|---|
^{ | Enables metrics collection. If the label isn't found, the app's metrics are not collected. | Yes | |
^{ | The port index where your app is exposing its Prometheus metrics. This is useful for Mesos apps that use multiple ports. | No | ^{ |
^{ | The endpoint where your app is exposing its metrics. | No | ^{ |
部署策略
mae
设计为作为守护进程在所有mesos从节点上运行。理想情况下,这需要两个步骤-
- Install ^{
} 作为基本映像/ami的一部分或通过user data。 - 作为守护进程运行
mae
。例如,如果您的发行版支持systemd
,下面是一个示例脚本,它在端口8888
上运行导出程序-# Save this to /etc/systemd/system/mae.service [Unit] Description=Mesos App Exporter After=network.target [Service] Type=simple Restart=on-failure Environment="LOG_LEVEL=INFO" ExecStart=/usr/local/bin/mae 8888 localhost 5051 # Assuming the Mesos slave process is running on port 5051 [Install] WantedBy=multi-user.target