Commit a71793c7 authored by 胡凯旋's avatar 胡凯旋

fix

parent 7ff729e7
# -*- coding:utf-8 -*-
import time
import json
import random
import math
import yaml
from prometheus_client import start_http_server
from prometheus_client.core import REGISTRY
from exporter import TencentExporter, AliyunExporter
class RDSCollector(object):
def __init__(self):
self.exporter_list = [
# TencentExporter(),
AliyunExporter(),
]
def collect(self):
metrics = []
for exporter in self.exporter_list:
metrics.extend(exporter.export_prometheus_data())
for m in metrics:
yield m
def main():
REGISTRY.register(RDSCollector())
start_http_server(7086)
while True:
time.sleep(1)
if __name__ == '__main__':
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment