MESOS App Exporter for Promisheus

mae的Python项目详细描述


maeMaintainabilityTest Coverage

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环境变量配置。阅读^{} library's levels了解所有可用级别。

任务标签

一旦mae启动并运行,它将开始从所有具有prometheus.metrics.enabled标签的应用程序收集度量。您还可以自定义如何收集度量-

Task LabelDescriptionRequired?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从节点上运行。理想情况下,这需要两个步骤-

  1. Install ^{}作为基本映像/ami的一部分或通过user data
  2. 作为守护进程运行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
    

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
在Java中使用工厂设计模式   解析服务器安全性的java最佳实践   java如何解决由于某种原因导致的执行失败?   关于Servlet的java   如何在java中生成一个大的(30MB+)xml文件?   匿名类重写与传递接口,用于在Java中设计回调   java jar从运行时开始。getRuntime()。exec()比从命令行运行的时间长   java Ant脚本排除文件夹(某些文件除外)   java在Windows 10计算机上运行时遇到Maven错误   java Hibernate在同一个表中级联   java PayPal API设置返回URL   java如何在选项卡的右侧显示关闭按钮   当按下Jmenu按钮时,使用java操作侦听器退出程序