コード例 #1
0
 def handle(self, *args, **kwargs):
     """Initialize the prometheus exporter and koku-listener."""
     LOG.info("Initializing the prometheus exporter")
     start_http_server(9999, registry=WORKER_REGISTRY)
     LOG.info("Starting Kafka handler")
     LOG.debug("handle args: %s, kwargs: %s", str(args), str(kwargs))
     initialize_kafka_handler()
コード例 #2
0
 def handle(self, *args, **kwargs):
     """Initialize the prometheus exporter and koku-listener."""
     while not check_migrations():
         LOG.warning("Migrations not done. Sleeping")
         time.sleep(5)
     LOG.info("Initializing the prometheus exporter")
     start_http_server(CLOWDER_METRICS_PORT, registry=WORKER_REGISTRY)
     LOG.info("Starting Kafka handler")
     LOG.debug("handle args: %s, kwargs: %s", str(args), str(kwargs))
     initialize_kafka_handler()
コード例 #3
0
    def handle(self, *args, **kwargs):
        """Initialize the prometheus exporter and koku-listener."""
        httpd = start_probe_server(ListenerProbeServer)

        # This is a special case because check_migrations() returns three values
        # True means migrations are up-to-date
        while check_migrations() != True:  # noqa
            LOG.warning("Migrations not done. Sleeping")
            time.sleep(5)

        httpd.RequestHandlerClass.ready = True  # Set `ready` to true to indicate migrations are done.

        LOG.info("Initializing UNLEASH_CLIENT for masu-listener.")
        UNLEASH_CLIENT.initialize_client()

        LOG.info("Starting Kafka handler")
        LOG.debug("handle args: %s, kwargs: %s", str(args), str(kwargs))
        initialize_kafka_handler()
コード例 #4
0
 def handle(self, *args, **kwargs):
     """Initialize listener."""
     LOG.info('Starting Kafka handler')
     LOG.debug('handle args: %s, kwargs: %s', str(args), str(kwargs))
     initialize_kafka_handler()
コード例 #5
0
ファイル: run.py プロジェクト: prasadanvekar/koku
#
# Copyright 2018 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
#
"""Masu listener entry-point."""

from masu import create_app
from masu.celery import celery, update_celery_config
from masu.external.kafka_msg_handler import initialize_kafka_handler
from masu.prometheus_stats import initialize_prometheus_exporter

initialize_prometheus_exporter()

MASU = create_app()
MASU.app_context().push()
update_celery_config(celery, MASU)

initialize_kafka_handler()