update nameko demo

This commit is contained in:
BryantHe 2023-06-17 01:38:04 +08:00
parent 670442f9ea
commit 37fc07a068
1 changed files with 5 additions and 1 deletions

View File

@ -5,12 +5,16 @@ from nameko.web.handlers import http
from nameko.timer import timer from nameko.timer import timer
from statsd import StatsClient from statsd import StatsClient
from circuitbreaker import circuit from circuitbreaker import circuit
from chassis.chassis import init_logger, init_statsd, init_sentry
from config.config import Config
class DemoChassisService: class DemoChassisService:
name = "demo_chassis_service" name = "demo_chassis_service"
statsd = StatsClient('localhost', 8125, prefix='simplebank-nameko_demo') sentry = init_sentry()
statsd = init_statsd(Config.STATSD_PERMISSION_PREFIX, Config.STATSD_HOST, Config.STATSD_PORT)
logger = init_logger()
@http('GET', '/health') @http('GET', '/health')
@statsd.timer('health') @statsd.timer('health')