def create_reporter(app): if "GRAPHITE_HOST" in app.config: from pyformance.reporters.carbon_reporter import CarbonReporter reporter = CarbonReporter(prefix=app.config["GRAPHITE_PREFIX"], server=app.config["GRAPHITE_HOST"], reporting_interval=30) reporter.start()