prometheus.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:juju-charm-prometheus 作者: tasdomas 项目源码 文件源码
def update_prometheus_alertmanager(alertmanager):
    services = alertmanager.services()
    if not (data_changed('alertmanager-service.related_services', services)):
        return
    # XXX: as of prometheus 0.17, it can only point to a single alertmanager,
    #      last one from below loop will be used.
    for service in services:
        for unit in service['hosts']:
            hookenv.log('{} has a unit {}:{}'.format(
                service['service_name'],
                unit['hostname'],
                unit['port']))
            runtime_args('-alertmanager.url',
                         'http://{hostname}:{port}'.format(**unit))
    set_state('prometheus.do-check-reconfig')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号